diff --git a/build/jslib/build.js b/build/jslib/build.js index c0014ace..a35cf6df 100644 --- a/build/jslib/build.js +++ b/build/jslib/build.js @@ -157,6 +157,10 @@ define(function (require) { return build._run(cmdConfig); }).then(null, function (e) { errorMsg = e.toString(); + //In wsh, get an unhelpful toString, so adjust + if (errorMsg === '[object Error]') { + errorMsg = e.message + ': ' + e.description; + } errorTree = e.moduleTree; stackMatch = stackRegExp.exec(errorMsg); @@ -473,10 +477,15 @@ define(function (require) { //Be sure not to remove other build layers. if (config.removeCombined) { module.layer.buildFilePaths.forEach(function (path) { - if (file.exists(path) && !modules.some(function (mod) { - return mod._buildPath === path; - })) { - file.deleteFile(path); + if (file.exists(path)) { + var pathMatched; + lang.each(modules, function (mod) { + pathMatched = mod._buildPath === path; + return pathMatched; + }); + if (!pathMatched) { + file.deleteFile(path); + } } }); } @@ -1220,7 +1229,8 @@ define(function (require) { syncChecks = { rhino: true, node: true, - xpconnect: true + xpconnect: true, + wsh: true }, deferred = prim(); diff --git a/build/jslib/env.js b/build/jslib/env.js index ab92ddd7..ce138e43 100644 --- a/build/jslib/env.js +++ b/build/jslib/env.js @@ -5,8 +5,9 @@ */ /*jslint strict: false */ -/*global Packages: false, process: false, window: false, navigator: false, - document: false, define: false */ +/*global Packages: false, process: false, navigator: false, + document: false, define: false, WScript, ActiveXObject, Components, + self, importScripts */ /** * A plugin that modifies any /env/ path to be the right path based on @@ -25,6 +26,8 @@ env = 'browser'; } else if (typeof Components !== 'undefined' && Components.classes && Components.interfaces) { env = 'xpconnect'; + } else if (typeof WScript !== 'undefined' && typeof ActiveXObject !== 'undefined') { + env = 'wsh'; } define({ diff --git a/build/jslib/es5-shimsham.README b/build/jslib/es5-shimsham.README new file mode 100644 index 00000000..39d4a669 --- /dev/null +++ b/build/jslib/es5-shimsham.README @@ -0,0 +1,8 @@ +es5-shimsham is a combination of es5-shim and es5-sham, version 2.0.5. + +From https://github.com/kriskowal/es5-shim, MIT licensed. + +Look for this comment for the boundary between shim and sham: + +// START SHAM + diff --git a/build/jslib/es5-shimsham.js b/build/jslib/es5-shimsham.js new file mode 100644 index 00000000..df877c6a --- /dev/null +++ b/build/jslib/es5-shimsham.js @@ -0,0 +1,1352 @@ +// Copyright 2009-2012 by contributors, MIT License +// vim: ts=4 sts=4 sw=4 expandtab + +// Module systems magic dance +(function (definition) { + // RequireJS + if (typeof define == "function") { + define(definition); + // YUI3 + } else if (typeof YUI == "function") { + YUI.add("es5", definition); + // CommonJS and