You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When running extensible destructuring against the following:
const a = 0;
const { [a]: test = 'default' } = { 0: 'test' };
The variable 'test' evaluates to 'default', when this should be 'test'. Without this plugin, when just using babel-env, babel produces the correct expected output. This syntax is extremely helpful for handling when a computed property is not matched in the parent object.
Running babel produces the following syntax:
var __extensible_get__ = require('extensible-runtime').immutable;
var a = 0;
var _ = { 0: 'test' };
var test = __extensible_get__(_, 'a', 'default');
(Note, the string 'a' instead of variable a)
I was able to resolve this on my own codebase by change to line 214 of src/index.js to the following, however unsure if this will have unintended side effects. objRef = extensibleGet(propRef, prop.computed ? prop.key : t.stringLiteral(prop.key.name), pattern.right)
The text was updated successfully, but these errors were encountered:
When running extensible destructuring against the following:
The variable 'test' evaluates to 'default', when this should be 'test'. Without this plugin, when just using babel-env, babel produces the correct expected output. This syntax is extremely helpful for handling when a computed property is not matched in the parent object.
Running babel produces the following syntax:
(Note, the string 'a' instead of variable a)
I was able to resolve this on my own codebase by change to line 214 of src/index.js to the following, however unsure if this will have unintended side effects.
objRef = extensibleGet(propRef, prop.computed ? prop.key : t.stringLiteral(prop.key.name), pattern.right)
The text was updated successfully, but these errors were encountered: