Mercurial > js4py
diff core-javascript/javascript-exercises/testtools.js @ 171:19e88fb18c4e javascript-exercises
Modify testtools.js to work with Rhino (and hope still works with jsdb).
| author | jf3243 |
|---|---|
| date | Thu, 10 Nov 2011 17:06:52 +0000 |
| parents | 2d78ae4f0dfa |
| children |
line wrap: on
line diff
--- a/core-javascript/javascript-exercises/testtools.js Thu Nov 10 16:52:51 2011 +0000 +++ b/core-javascript/javascript-exercises/testtools.js Thu Nov 10 17:06:52 2011 +0000 @@ -3,14 +3,13 @@ // Define a global function 'log'. var log; -if (this.hasOwnProperty('jsArguments')){ +if (this.writeln){ + log = writeln; +} else { log = function(s){ print(s + '\n'); }; -} else { - log = print; - log = writeln; // Wrong, but get us working in jsdb.exe. } //
