Changeset 2678 for lang/javascript/jsdeferred
- Timestamp:
- 12/06/07 23:56:56 (13 months ago)
- Files:
-
- 1 modified
-
lang/javascript/jsdeferred/trunk/test-rhino.js (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
lang/javascript/jsdeferred/trunk/test-rhino.js
r2677 r2678 23 23 24 24 var out = []; 25 out.push( "[", [expects - testfuns.length, expects].join("/"), "]");25 out.push(color(46, "[", [expects - testfuns.length, expects].join("/"), "]")); 26 26 if (okng == "ng") { 27 27 expect = (typeof expect == "function") ? uneval(expect).match(/[^{]+/)+"..." : uneval(expect); … … 31 31 quit(); 32 32 } else { 33 out.push(" ", "ok");33 out.push(" ", color(32, "ok")); 34 34 print(out.join("")); 35 35 } … … 56 56 } 57 57 58 function color (code) { 59 var str = ""; 60 for (var i = 1; i < arguments.length; i++) str += arguments[i]; 61 return [ 62 String.fromCharCode(27), "[", code, "m", 63 str, 64 String.fromCharCode(27), "[0m" 65 ].join(""); 66 } 58 67 59 68 // run tests 60 69 eval(data); 70 71 addFinalizer(function () { 72 if (expects - testfuns.length == expects) { 73 print(color(32, "All tests passed")); 74 } else { 75 print(color(31, "Some tests failed...")); 76 } 77 }); 61 78 62 79 //Deferred.define(); … … 122 139 runQueue._id = 0; 123 140 141 Global.addFinalizer = function (fun) { 142 Global.addFinalizer.finalizers.push(fun); 143 }; 144 Global.addFinalizer.finalizers = []; 145 124 146 Global.setTimeout = function (func, delay) { 125 147 // print("setTimeout:"+uneval(func)); … … 144 166 runQueue.process(); 145 167 } 168 Global.addFinalizer.finalizers.forEach(function (i) { i() }); 146 169 }); 147 170 })();
![(please configure the [header_logo] section in trac.ini)](/share/chrome/site/your_project_logo.png)