use ES6 polyfill for worker and tests, not in openpgp.js
This commit is contained in:
parent
37eec2bde2
commit
ac440b9ae6
2199
npm-shrinkwrap.json
generated
2199
npm-shrinkwrap.json
generated
File diff suppressed because it is too large
Load Diff
|
@ -71,10 +71,10 @@
|
||||||
"zlibjs": "~0.3.1"
|
"zlibjs": "~0.3.1"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"asmcrypto-lite": "git+https://github.com/openpgpjs/asmcrypto-lite.git",
|
||||||
|
"asn1.js": "^5.0.0",
|
||||||
"bn.js": "^4.11.8",
|
"bn.js": "^4.11.8",
|
||||||
"buffer": "^5.0.8",
|
"buffer": "^5.0.8",
|
||||||
"asn1.js": "^5.0.0",
|
|
||||||
"asmcrypto-lite": "git+https://github.com/openpgpjs/asmcrypto-lite.git",
|
|
||||||
"elliptic": "git+https://github.com/openpgpjs/elliptic.git",
|
"elliptic": "git+https://github.com/openpgpjs/elliptic.git",
|
||||||
"es6-promise": "^4.2.4",
|
"es6-promise": "^4.2.4",
|
||||||
"jwk-to-pem": "^1.2.6",
|
"jwk-to-pem": "^1.2.6",
|
||||||
|
|
|
@ -19,6 +19,11 @@
|
||||||
|
|
||||||
self.window = {}; // to make UMD bundles work
|
self.window = {}; // to make UMD bundles work
|
||||||
|
|
||||||
|
// ES6 Promise polyfill
|
||||||
|
if (typeof Promise === 'undefined') {
|
||||||
|
require('es6-promise').polyfill();
|
||||||
|
}
|
||||||
|
|
||||||
importScripts('openpgp.js');
|
importScripts('openpgp.js');
|
||||||
var openpgp = window.openpgp;
|
var openpgp = window.openpgp;
|
||||||
|
|
||||||
|
|
|
@ -1,3 +1,8 @@
|
||||||
|
// ES6 Promise polyfill
|
||||||
|
if (typeof Promise === 'undefined') {
|
||||||
|
require('es6-promise').polyfill();
|
||||||
|
}
|
||||||
|
|
||||||
(typeof window !== 'undefined' ? window : global).resolves = function(val) {
|
(typeof window !== 'undefined' ? window : global).resolves = function(val) {
|
||||||
return new Promise(function(res) { res(val); });
|
return new Promise(function(res) { res(val); });
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user