Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit abfafc3

Browse files
fix object destructuring with custom variable name
When doing object destructuring with a custom variable name (`{ obj_prop: var_name }`), we get an error: The generated code contains `var _vm.var_name = ref.obj_prop` which is invalid syntax. So we need to skip overwriting to add a `_vm.` to the variable name. Fixes #6
1 parent 2e19d1c commit abfafc3

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

‎buble.js‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7025,6 +7025,8 @@ var Identifier1ドル = (function (Node$1ドル) {
70257025
!(this.parent.type === 'MemberExpression' && this.parent.property === this && !this.parent.computed) &&
70267026
// not in an Array destructure pattern
70277027
!(this.parent.type === 'ArrayPattern') &&
7028+
// not in an Object destructure pattern
7029+
!(this.parent.parent.type === 'ObjectPattern') &&
70287030
// skip globals + commonly used shorthands
70297031
!hash[this.name] &&
70307032
// not already in scope

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /