Mercurial > js4py
diff core-javascript/core-javascript-work/tutorial.js @ 140:abfb176c7346 core-javascript
Add Discussion and Explanation to bind-is-transient.rst.
| author | Jonathan Fine <jfine@pytex.org> |
|---|---|
| date | Mon, 31 Oct 2011 20:41:47 +0000 |
| parents | de308579ea0d |
| children | e8bfe6c50a01 |
line wrap: on
line diff
--- a/core-javascript/core-javascript-work/tutorial.js Mon Oct 31 20:09:50 2011 +0000 +++ b/core-javascript/core-javascript-work/tutorial.js Mon Oct 31 20:41:47 2011 +0000 @@ -96,16 +96,21 @@ var obj = { return_this : return_this }; + assert( obj.return_this === return_this ); // Deferring method call changes the outcome. var method_deferred = obj.return_this; assert( method_deferred === obj.return_this ); - assert( method_deferred() !== obj.return_this() ); + assert( method_deferred() !== obj.return_this() ); // AAA // The two outcomes, precisely stated. assert( obj.return_this() === obj ); assert( method_deferred().telltail === 'global' ); + // Another view on the matter. + assert( method_deferred === return_this ); + assert( method_deferred() === return_this() ); // BBB + }); // end transient-bind
