Permalink
Browse files

updated dist

  • Loading branch information...
1 parent 237a92f commit cd692304f5ee41333a4c0ed97dcac604d072b533 @cadorn cadorn committed Jul 12, 2012
@@ -800,12 +800,16 @@ exports.loadBundleCode = function(uri, callback)
var platformRequire = require;
var isMain = ((platformRequire && platformRequire.main === module)?true:false);
require = LOADER_INJECTED.require;
- sourcemint.sandbox(__dirname + "/01-HelloWorldServer.js", function(sandbox) {
+ sourcemint.sandbox(((typeof __dirname !== "undefined")?__dirname:".") + "/01-HelloWorldServer.js", function(sandbox) {
if (typeof exports === "object") {
- var mainExports = sandbox.boot();
+ var mainExports = sandbox.boot();
+ if (typeof mainExports === "function") {
+ module.exports = mainExports;
+ } else {
for (var key in mainExports) {
exports[key] = mainExports[key];
}
+ }
} else {
sandbox.main();
}
@@ -1760,12 +1760,16 @@ exports.loadBundleCode = function(uri, callback)
var platformRequire = require;
var isMain = ((platformRequire && platformRequire.main === module)?true:false);
require = LOADER_INJECTED.require;
- sourcemint.sandbox(__dirname + "/02-ConnectServer.js", function(sandbox) {
+ sourcemint.sandbox(((typeof __dirname !== "undefined")?__dirname:".") + "/02-ConnectServer.js", function(sandbox) {
if (typeof exports === "object") {
- var mainExports = sandbox.boot();
+ var mainExports = sandbox.boot();
+ if (typeof mainExports === "function") {
+ module.exports = mainExports;
+ } else {
for (var key in mainExports) {
exports[key] = mainExports[key];
}
+ }
} else {
sandbox.main();
}

0 comments on commit cd69230

Please sign in to comment.