Ensure only one Promise constructor is ever used by tools code.

This commit is contained in:
Ben Newman
2016-07-07 11:04:18 -04:00
parent 95589c3978
commit eadb6e65cc
4 changed files with 6 additions and 9 deletions

View File

@@ -1,8 +1,6 @@
// Note that this file is required before we install our Babel hooks in
// ../tool-env/install-babel.js, so we can't use ES2015+ syntax here.
var Promise = global.Promise || require("promise/lib/es6-extensions");
var win32Extensions = {
node: ".exe",
npm: ".cmd"

View File

@@ -8,7 +8,6 @@
var fs = require("fs");
var path = require("path");
var rootDir = path.resolve(__dirname, "..", "..");
var Promise = global.Promise || require("promise/lib/es6-extensions");
var defaultDevBundlePromise =
Promise.resolve(path.join(rootDir, "dev_bundle"));

View File

@@ -1,3 +1,9 @@
// Install a global ES2015-compliant Promise constructor that knows how to
// run all its callbacks in Fibers.
var Promise = global.Promise = global.Promise ||
require("promise/lib/es6-extensions");
require("meteor-promise").makeCompatible(Promise, require("fibers"));
require("./cli/dev-bundle-bin-commands.js").then(function (child) {
if (! child) {
// Use process.nextTick here to prevent the Promise from swallowing

View File

@@ -2,12 +2,6 @@
// Symbol, Map, and Set, patching the native implementations if available.
require("meteor-ecmascript-runtime");
// Install a global ES2015-compliant Promise constructor that knows how to
// run all its callbacks in Fibers.
var Promise = global.Promise = global.Promise ||
require("promise/lib/es6-extensions");
require("meteor-promise").makeCompatible(Promise, require("fibers"));
// Verify that the babel-runtime package is available to be required.
// The .join("/") prevents babel-plugin-transform-runtime from
// "intelligently" converting this to an import statement.