Bug Report
Current Behavior
When @babel/plugin-transform-runtime has corejs set to 3, it can incorrectly transform property access using a variable called filter. (Note: NOT the property filter.)
Actual output:
import _filterInstanceProperty from "@babel/runtime-corejs3/core-js-stable/instance/filter";
var filter = 'foo';
var bar = {
foo: function () {
return 'foo';
}
};
console.log(_filterInstanceProperty(bar).call(bar));
Input Code
var filter = 'foo';
var bar = { foo: function() { return 'foo';}};
console.log(bar[filter]());
Expected behavior/code
Expected output: (if corejs is set to false, this is the output, as expected)
var filter = 'foo';
var bar = {
foo: function () {
return 'foo';
}
};
console.log(bar[filter]());
Babel Configuration
module.exports = (api) => {
api.cache(true);
return {
'plugins': [
['@babel/plugin-transform-runtime', {
'corejs': 3,
'regenerator': true,
'useESModules': true
}]
],
};
};
Environment
- Babel version(s): (@babel/cli 7.5.0) (@babel/core 7.5.4) (@babel/plugin-transform-runtime 7.5.0)
- Node/npm version: Node 10.13/npm 6.4.1/yarn 1.15.2
- OS: OSX 10.13.6
- Monorepo: N/A
- How you are using Babel: cli for this example, but it was manifesting the same way with webpack
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.
Bug Report
Current Behavior
When
@babel/plugin-transform-runtimehascorejsset to3, it can incorrectly transform property access using a variable calledfilter. (Note: NOT the propertyfilter.)Actual output:
Input Code
Expected behavior/code
Expected output: (if
corejsis set tofalse, this is the output, as expected)Babel Configuration
Environment
Additional context/Screenshots
Add any other context about the problem here. If applicable, add screenshots to help explain.