Commit | Line | Data |
---|---|---|
6a1aa64f DV |
1 | /** |
2 | ||
3 | run with: | |
4 | cscript.exe //nologo scripts\jscriptmochi.js | |
5 | ||
6 | **/ | |
7 | if (typeof(print) == "undefined" && typeof(WScript) != "undefined") { | |
8 | // Make JScript look like SpiderMonkey and Rhino | |
9 | var print = WScript.Echo; | |
10 | var load = function (fn) { | |
11 | var fso = new ActiveXObject("Scripting.FileSystemObject"); | |
12 | var textStream = fso.OpenTextFile(fn, 1); | |
13 | var namespace = undefined; | |
14 | if (typeof(JSAN) != "undefined") { | |
15 | namespace = JSAN.global; | |
16 | } | |
17 | arguments.callee.do_eval.apply(namespace, [textStream.ReadAll()]); | |
18 | }; | |
19 | load.do_eval = function () { | |
20 | eval(arguments[0]); | |
21 | }; | |
22 | } | |
23 | ||
24 | load('tests/standalone.js'); |