From dd2ffda387414ef590cf18f4fdd96ce1bac07006 Mon Sep 17 00:00:00 2001 From: Jimmy Jia Date: Sun, 10 Mar 2019 18:22:59 -0400 Subject: [PATCH] fix: Don't transpile ES2018 symbol properties (#9650) This is a repeat of #5195 to work around the same upstream issue. --- .../scripts/build-dist.js | 10 +++++++++- .../babel-plugin-transform-runtime/src/definitions.js | 3 ++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/packages/babel-plugin-transform-runtime/scripts/build-dist.js b/packages/babel-plugin-transform-runtime/scripts/build-dist.js index 4f8375d284..590440aff3 100644 --- a/packages/babel-plugin-transform-runtime/scripts/build-dist.js +++ b/packages/babel-plugin-transform-runtime/scripts/build-dist.js @@ -19,7 +19,15 @@ writeHelpers("@babel/runtime-corejs2", { corejs: 2 }); function writeCoreJS2(runtimeName) { const pkgDirname = getRuntimeRoot(runtimeName); - const paths = ["is-iterable", "get-iterator"]; + const paths = [ + "is-iterable", + "get-iterator", + + // This was previously in definitions, but was removed to work around + // zloirock/core-js#262. We need to keep it in @babel/runtime-corejs2 to + // avoid a breaking change there. + "symbol/async-iterator", + ]; Object.keys(corejs2Definitions.builtins).forEach(key => { const path = corejs2Definitions.builtins[key]; diff --git a/packages/babel-plugin-transform-runtime/src/definitions.js b/packages/babel-plugin-transform-runtime/src/definitions.js index ac044910a0..b0874d0803 100644 --- a/packages/babel-plugin-transform-runtime/src/definitions.js +++ b/packages/babel-plugin-transform-runtime/src/definitions.js @@ -109,7 +109,8 @@ export default runtimeVersion => { : {}), Symbol: { - asyncIterator: "symbol/async-iterator", + // FIXME: Disabled to work around zloirock/core-js#262. + // asyncIterator: "symbol/async-iterator", for: "symbol/for", hasInstance: "symbol/has-instance", isConcatSpreadable: "symbol/is-concat-spreadable",