Skip to content

Commit 83b3200

Browse files
committed
fix(polyfill): use core-js instead of native-promise-only
1 parent 5fc52b5 commit 83b3200

File tree

6 files changed

+9
-9
lines changed

6 files changed

+9
-9
lines changed

CONTRIBUTING.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
PromisesはECMAScriptであることを元に進めるが、現実的に非同期な処理がECMAScriptには少ないのでDOM APIも使用する。
44

5-
Promisesが実装されていない環境もあるため、[native-promise-only](https://github.com/getify/native-promise-only/ "native-promise-only")をPolyfillとして利用する。
5+
Promisesが実装されていない環境もあるため、[core-js](https://github.com/zloirock/core-js)をPolyfillとして利用する。
66

77
## プロジェクト構造
88

gulpfile.js

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ gulp.task("embed", function() {
6363
.pipe(gulp.dest("./"));
6464
});
6565
gulp.task("lint-html", function(callback) {
66-
require("native-promise-only");
6766
var File = require("./Ch4_AdvancedPromises/src/promise-chain/fs-promise-chain");
6867
var checkHTML = require("./test/html/missing-internal-link").checkInternalLinks;
6968

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
"dependencies": {
2929
"codemirror": "^5.46.0",
3030
"codemirror-console-ui": "^2.0.5",
31-
"native-promise-only": "^0.8.1",
31+
"core-js": "^3.0.1",
3232
"w3c-xmlhttprequest": "^2.1.3",
3333
"ypromise": "^0.3.0"
3434
},

public/js/console-editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* LICENSE : MIT
44
*/
55
"use strict";
6-
var Promise = require("native-promise-only");
6+
var Promise = require("core-js-pure/features/promise'");
77
var consoleUI = require("codemirror-console-ui");
88
module.exports.initialize = function () {
99
var attachToElement = consoleUI.attachToElement;

test/test-helper.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* LICENSE : MIT
44
*/
55
"use strict";
6-
global.Promise = require("native-promise-only");
6+
global.Promise = require("core-js-pure/features/promise");
77
global.shouldFulfilled = require("promise-test-helper").shouldFulfilled;
88
global.shouldRejected = require("promise-test-helper").shouldRejected;
99

yarn.lock

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1175,6 +1175,11 @@ core-js@^2.0.0:
11751175
version "2.4.1"
11761176
resolved "https://registry.yarnpkg.com/core-js/-/core-js-2.4.1.tgz#4de911e667b0eae9124e34254b53aea6fc618d3e"
11771177

1178+
core-js@^3.0.1:
1179+
version "3.0.1"
1180+
resolved "https://registry.yarnpkg.com/core-js/-/core-js-3.0.1.tgz#1343182634298f7f38622f95e73f54e48ddf4738"
1181+
integrity sha512-sco40rF+2KlE0ROMvydjkrVMMG1vYilP2ALoRXcYR4obqbYIuV3Bg+51GEDW+HF8n7NRA+iaA4qD0nD9lo9mew==
1182+
11781183
core-util-is@~1.0.0:
11791184
version "1.0.2"
11801185
resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7"
@@ -3685,10 +3690,6 @@ nanomatch@^1.2.9:
36853690
snapdragon "^0.8.1"
36863691
to-regex "^3.0.1"
36873692

3688-
native-promise-only@^0.8.1:
3689-
version "0.8.1"
3690-
resolved "https://registry.yarnpkg.com/native-promise-only/-/native-promise-only-0.8.1.tgz#20a318c30cb45f71fe7adfbf7b21c99c1472ef11"
3691-
36923693
needle@^2.2.1:
36933694
version "2.3.1"
36943695
resolved "https://registry.yarnpkg.com/needle/-/needle-2.3.1.tgz#d272f2f4034afb9c4c9ab1379aabc17fc85c9388"

0 commit comments

Comments
 (0)