diff core-javascript/tutorial.js @ 134:31a94b4c8687 core-javascript

Add text to what-is-this.rst.
author jf3243
date Mon, 31 Oct 2011 11:01:49 +0000
parents d99695cdd230
children
line wrap: on
line diff
--- a/core-javascript/tutorial.js	Mon Oct 31 10:13:41 2011 +0000
+++ b/core-javascript/tutorial.js	Mon Oct 31 11:01:49 2011 +0000
@@ -67,9 +67,8 @@
     var return_this = function(){
         return this;
     };
-    
+
     var default_this = return_this();
-    
     assert( default_this.telltail === 'global' );
     
     var obj = {};
@@ -77,10 +76,14 @@
     assert( obj.return_this === return_this );
     
     assert( obj.return_this() === obj );
+    assert( obj['return_this']() === obj );
     
     assert( return_this.call(obj) === obj );
     assert( return_this.apply(obj) === obj );
 
+    assert( return_this.call(undefined).telltail === 'global' );
+    assert( return_this.apply(undefined).telltail === 'global' );
+
 });
 // end return_this