summaryrefslogtreecommitdiff
path: root/orig/pq-web
diff options
context:
space:
mode:
Diffstat (limited to 'orig/pq-web')
-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); };