summaryrefslogtreecommitdiff
path: root/orig
diff options
context:
space:
mode:
authorDimitri Sokolyuk <demon@dim13.org>2017-09-24 00:56:08 +0200
committerDimitri Sokolyuk <demon@dim13.org>2017-09-24 00:56:08 +0200
commitd457a952eceb1698b2d71f5d9ec80736be423824 (patch)
tree602f43e20d4692c4c2d0696fb39ffd8b6b20e3a9 /orig
parente256ea5d0849bbeeca5e7f0210369d458ad7e0a2 (diff)
...
Diffstat (limited to 'orig')
-rw-r--r--orig/pq-web/sim.js42
1 files changed, 17 insertions, 25 deletions
diff --git a/orig/pq-web/sim.js b/orig/pq-web/sim.js
index 2b0b5a7..a6e4976 100644
--- a/orig/pq-web/sim.js
+++ b/orig/pq-web/sim.js
@@ -75,31 +75,23 @@ $.each = function (object, callback) {
var document = null;
-if (typeof process !== "undefined") {
- // Node
- var fs = require("fs");
- var load = function (filename) {
- var content = fs.readFileSync(filename);
- require("vm").runInThisContext(content, filename);
- //global.eval.call(global, String(content));
- };
- var print = function () {
- args = Array.prototype.slice.call(arguments);
- console.log(args.join(" "));
- };
- var read = function (f) { return fs.readFileSync(f); };
- var write = function (f,c) { fs.writeFileSync(f,c); };
-
- global.window = window;
- global.document = document;
- global.navigator = navigator;
- global.$ = $;
- print("node");
-} else {
- // V8 shell
- global = this;
- print("v8");
-}
+var fs = require("fs");
+var load = function (filename) {
+ var content = fs.readFileSync(filename);
+ require("vm").runInThisContext(content, filename);
+ //global.eval.call(global, String(content));
+};
+var print = function () {
+ args = Array.prototype.slice.call(arguments);
+ console.log(args.join(" "));
+};
+var read = function (f) { return fs.readFileSync(f); };
+var write = function (f,c) { fs.writeFileSync(f,c); };
+
+global.window = window;
+global.document = document;
+global.navigator = navigator;
+global.$ = $;
var alert = global.alert = function (m) { print("ALERT: " + m); };