File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ test("'this' inside a method", function () {
44 var person = {
55 name : 'bob' ,
66 intro : function ( ) {
7- return "Hello, my name is " + this . __ ;
7+ return "Hello, my name is " + this . name ;
88 }
99 }
1010 equals ( person . intro ( ) , "Hello, my name is bob" ) ;
@@ -22,7 +22,7 @@ test("'this' on unattached function", function () {
2222
2323 // if the function is not called as an object property 'this' is the global context
2424 // (window in a browser)
25- window . __ = 'Peter' ;
25+ window . name = 'Peter' ;
2626 equals ( "Hello, my name is Peter" , alias ( ) ) ;
2727} ) ;
2828
@@ -35,7 +35,7 @@ test("'this' set explicitly", function () {
3535 }
3636
3737 // calling a function with 'call' lets us assign 'this' explicitly
38- var message = person . intro . call ( { __ : "Frank" } ) ;
38+ var message = person . intro . call ( { window . name : "Frank" } ) ;
3939 equals ( message , "Hello, my name is Frank" ) ;
4040} ) ;
4141
You can’t perform that action at this time.
0 commit comments