diff --git a/src/main.js b/src/main.js index 8ea372e895..5195f4992a 100644 --- a/src/main.js +++ b/src/main.js @@ -72,18 +72,18 @@ node.path = new function () { function Scaffold (source, filename, module) { // wrap the source in a strange function var source = "function (__filename) {" - + " var on_load;" + + " var onLoad;" + " var exports = this;" + " var require = this.__require;" + " var include = this.__include;" + source - + " this.__on_load = on_load;" + + " this.__onLoad = onLoad;" + "};" ; // returns the function var compiled = node.compile(source, filename); - if (module.__on_load) { + if (module.__onLoad) { //node.debug("<"+ filename+"> has onload! this is bad"); } @@ -103,11 +103,11 @@ node.path = new function () { this.filename = filename; this.module = module; this.subs = module.__subs; - this.on_load = module.__on_load; + this.onLoad = module.__onLoad; // remove these references so they don't get exported. delete module.__subs; - delete module.__on_load; + delete module.__onLoad; delete module.__require; delete module.__include; } @@ -125,9 +125,9 @@ node.path = new function () { function finish() { //node.debug("finish 1 load <" + filename + ">"); - if (scaffold.on_load instanceof Function) { + if (scaffold.onLoad instanceof Function) { //node.debug("foo bar <" + filename + ">"); - scaffold.on_load(); + scaffold.onLoad(); } //node.debug("finish 2 load <" + filename + ">"); diff --git a/test/test-file-open.js b/test/test-file-open.js index 6a738f1a75..68cd7cbd9f 100644 --- a/test/test-file-open.js +++ b/test/test-file-open.js @@ -1,8 +1,9 @@ include("mjsunit"); var assert_count = 0; -function onload () { - var fixtures = node.path.join(script.dirname, "fixtures"); +function onLoad () { + var dirname = node.path.dirname(__filename); + var fixtures = node.path.join(dirname, "fixtures"); var x = node.path.join(fixtures, "x.txt"); file = new File; diff --git a/test/test-setTimeout.js b/test/test-setTimeout.js index ef29fe2296..4664f8e0bc 100644 --- a/test/test-setTimeout.js +++ b/test/test-setTimeout.js @@ -1,6 +1,6 @@ include("mjsunit"); -function on_load () { +function onLoad () { assertInstanceof(setTimeout, Function); var starttime = new Date; diff --git a/test/test-test.js b/test/test-test.js index 0a4404f7f5..41906740ce 100644 --- a/test/test-test.js +++ b/test/test-test.js @@ -1,7 +1,7 @@ include("mjsunit"); var a = require("fixtures/a"); -function on_load () { +function onLoad () { assertFalse(false, "testing the test program."); assertInstanceof(a.A, Function);