only use raw type references in coreAliasing on Symbol - fixes #421
This commit is contained in:
parent
348fe045d3
commit
ad6ab57fe3
@ -31,8 +31,8 @@ exports.ast = {
|
||||
this.skip();
|
||||
return t.prependToMemberExpression(node, file._coreId);
|
||||
}
|
||||
} else if (t.isIdentifier(node) && !t.isMemberExpression(parent) && t.isReferenced(node, parent) && coreHas(node)) {
|
||||
// new Promise -> new _core.Promise
|
||||
} else if (t.isIdentifier(node) && !t.isMemberExpression(parent) && t.isReferenced(node, parent) && node.name === "Symbol") {
|
||||
// new Symbol -> new _core.Symbol
|
||||
return t.memberExpression(file._coreId, node);
|
||||
} else if (t.isCallExpression(node)) {
|
||||
// arr[Symbol.iterator]() -> _core.$for.getIterator(arr)
|
||||
|
||||
1
test/fixtures/transformation/optional-core-aliasing/ignore-natives/actual.js
vendored
Normal file
1
test/fixtures/transformation/optional-core-aliasing/ignore-natives/actual.js
vendored
Normal file
@ -0,0 +1 @@
|
||||
obj.constructor === Object;
|
||||
9
test/fixtures/transformation/optional-core-aliasing/ignore-natives/expected.js
vendored
Normal file
9
test/fixtures/transformation/optional-core-aliasing/ignore-natives/expected.js
vendored
Normal file
@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequire = function (obj) {
|
||||
return obj && (obj["default"] || obj);
|
||||
};
|
||||
|
||||
var _core = _interopRequire(require("core-js/library"));
|
||||
|
||||
obj.constructor === Object;
|
||||
2
test/fixtures/transformation/optional-core-aliasing/map-symbol/actual.js
vendored
Normal file
2
test/fixtures/transformation/optional-core-aliasing/map-symbol/actual.js
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
Symbol("test");
|
||||
Symbol();
|
||||
10
test/fixtures/transformation/optional-core-aliasing/map-symbol/expected.js
vendored
Normal file
10
test/fixtures/transformation/optional-core-aliasing/map-symbol/expected.js
vendored
Normal file
@ -0,0 +1,10 @@
|
||||
"use strict";
|
||||
|
||||
var _interopRequire = function (obj) {
|
||||
return obj && (obj["default"] || obj);
|
||||
};
|
||||
|
||||
var _core = _interopRequire(require("core-js/library"));
|
||||
|
||||
_core.Symbol("test");
|
||||
_core.Symbol();
|
||||
Loading…
x
Reference in New Issue
Block a user