Skip to content

Commit

Permalink
Adding es6-promise as a local polyfill for unsupported browsers
Browse files Browse the repository at this point in the history
  • Loading branch information
step2yeung committed Oct 23, 2018
1 parent f3f43e3 commit 71d4810
Show file tree
Hide file tree
Showing 7 changed files with 887 additions and 5 deletions.
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@
"babel-preset-env": "1.6.1",
"co": "4.6.0",
"commitplease": "3.1.0",
"es6-promise": "^4.2.5",
"eslint-config-jquery": "1.0.1",
"eslint-plugin-html": "4.0.1",
"eslint-plugin-qunit": "3.2.0",
Expand All @@ -70,6 +71,7 @@
"proxyquire": "1.8.0",
"requirejs": "2.3.5",
"rollup-plugin-babel": "3.0.2",
"rollup-plugin-node-resolve": "^3.4.0",
"semver": "5.4.1"
},
"scripts": {
Expand Down
6 changes: 3 additions & 3 deletions rollup.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
/* eslint-env node */

var babel = require( "rollup-plugin-babel" );
var resolve = require( "rollup-plugin-node-resolve" );

module.exports = {
format: "iife",
exports: "none",
plugins: [
babel( {
exclude: "node_modules/**"
} )
resolve( { modulesOnly: true } ),
babel()
],

// eslint-disable-next-line no-multi-str
Expand Down
1 change: 1 addition & 0 deletions src/core/logging.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import config from "./config";
import { objectType } from "./utilities";
import Promise from "../promise";

// Register logging callbacks
export function registerLoggingCallbacks( obj ) {
Expand Down
3 changes: 2 additions & 1 deletion src/core/processing-queue.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
runLoggingCallbacks
} from "./logging";

import Promise from "../promise";
import {
globalSuite
} from "../core";
Expand All @@ -33,7 +34,7 @@ const taskQueue = [];
function advance() {
advanceTaskQueue();

if ( !taskQueue.length && !config.blocking ) {
if ( !taskQueue.length && !config.blocking && !config.current) {
advanceTestQueue();
}
}
Expand Down
3 changes: 3 additions & 0 deletions src/promise.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import _Promise from "es6-promise/lib/es6-promise";

export default typeof Promise !== "undefined" ? Promise : _Promise;
1 change: 1 addition & 0 deletions src/test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { begin } from "./core";
import { setTimeout, clearTimeout } from "./globals";
import { emit } from "./events";
import Assert from "./assert";
import Promise from "./promise";

import config from "./core/config";
import {
Expand Down
Loading

0 comments on commit 71d4810

Please sign in to comment.