Mercurial > js4py
comparison 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 |
comparison
equal
deleted
inserted
replaced
| 170:fc3411a0efe9 | 171:19e88fb18c4e |
|---|---|
| 1 var telltail = 'global'; | 1 var telltail = 'global'; |
| 2 var _assertion_count = 0; | 2 var _assertion_count = 0; |
| 3 | 3 |
| 4 // Define a global function 'log'. | 4 // Define a global function 'log'. |
| 5 var log; | 5 var log; |
| 6 if (this.hasOwnProperty('jsArguments')){ | 6 if (this.writeln){ |
| 7 log = writeln; | |
| 7 | 8 |
| 9 } else { | |
| 8 log = function(s){ | 10 log = function(s){ |
| 9 print(s + '\n'); | 11 print(s + '\n'); |
| 10 }; | 12 }; |
| 11 } else { | |
| 12 log = print; | |
| 13 log = writeln; // Wrong, but get us working in jsdb.exe. | |
| 14 } | 13 } |
| 15 | 14 |
| 16 // | 15 // |
| 17 var TEST = function(title, code){ | 16 var TEST = function(title, code){ |
| 18 | 17 |
