on_load -> onLoad
This commit is contained in:
parent
5d57fa5060
commit
d105d88625
14
src/main.js
14
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 + ">");
|
||||
|
||||
|
@ -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;
|
||||
|
@ -1,6 +1,6 @@
|
||||
include("mjsunit");
|
||||
|
||||
function on_load () {
|
||||
function onLoad () {
|
||||
assertInstanceof(setTimeout, Function);
|
||||
var starttime = new Date;
|
||||
|
||||
|
@ -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);
|
||||
|
Loading…
x
Reference in New Issue
Block a user