fix loading

it appears that modules with a shutdown cause a load failure ???
This commit is contained in:
Joe Walker 2010-11-23 13:29:26 +00:00
commit 504acb230c
3 changed files with 40 additions and 21 deletions

View file

@ -37,12 +37,14 @@
define(function(require, exports, module) {
var console = require('util/console');
var Trace = require('util/stacktrace').Trace;
var Event = require('events').Event;
var history = require('canon/history');
var console = require('pilot/console');
var Trace = require('pilot/stacktrace').Trace;
//var Event = require('events').Event;
exports.startup = function(data, reason) {
if (!data.env || !data.env.settings) {
return;
}
var settings = data.env.settings;
// TODO register these using new registration functionality
@ -89,7 +91,7 @@ exports.Canon.prototype = {
}
};
exports.addedRequestOutput = new Event();
// exports.addedRequestOutput = new Event();
/**
* Current requirements are around displaying the command line, and provision
@ -188,7 +190,7 @@ exports.Request = function(options) {
this.completed = false;
this.error = false;
this.changed = new Event();
// this.changed = new Event();
};
/**
@ -199,7 +201,7 @@ exports.Request.prototype._beginOutput = function() {
this._begunOutput = true;
this.outputs = [];
history.addRequestOutput(this);
exports.addRequestOutput(this);
};
/**

View file

@ -35,17 +35,34 @@
*
* ***** END LICENSE BLOCK ***** */
define(function(require, exports, module) {
var deps = [
"pilot/fixoldbrowsers",
"pilot/types/basic",
"pilot/canon"
];
exports.startup = function(data, reason) {
require("fixoldbrowsers").startup(data, reason);
require("types/basic").startup(data, reason);
require("canon").startup(data, reason);
};
var packages = deps.slice();
packages.unshift("require", "exports", "module");
exports.shutdown(data, reason) {
require("fixoldbrowsers").shutdown(data, reason);
require("types/basic").shutdown(data, reason);
require("canon").shutdown(data, reason);
};
define(packages, function(require, exports, module) {
exports.startup = function(data, reason) {
deps.forEach(function(dep) {
console.log("test startup for " + dep);
var module = require(dep);
if (typeof module.startup === "function") {
module.startup(data, reason);
}
});
};
/*
exports.shutdown(data, reason) {
deps.forEach(function(dep) {
var module = require(dep);
if (typeof module.shutdown === "function") {
module.shutdown(data, reason);
}
});
};
*/
});

View file

@ -38,16 +38,16 @@
define(function(require, exports, module) {
var types = require("types");
var types = require("pilot/types");
/**
* These are the basic types that we accept. They are vaguely based on the
* Jetpack settings system (https://wiki.mozilla.org/Labs/Jetpack/JEP/24)
* although clearly more restricted.
*
*
* <p>In addition to these types, Jetpack also accepts range, member, password
* that we are thinking of adding.
*
*
* <p>This module probably should not be accessed directly, but instead used
* through types.js
*/