fixing patternmatched assigns within assigns within calls
This commit is contained in:
parent
b32a60585b
commit
4ed51536bb
|
@ -756,9 +756,10 @@
|
||||||
// object literals to a value. Peeks at their properties to assign inner names.
|
// object literals to a value. Peeks at their properties to assign inner names.
|
||||||
// See: http://wiki.ecmascript.org/doku.php?id=harmony:destructuring
|
// See: http://wiki.ecmascript.org/doku.php?id=harmony:destructuring
|
||||||
compile_pattern_match: function compile_pattern_match(o) {
|
compile_pattern_match: function compile_pattern_match(o) {
|
||||||
var _a, _b, access_class, assigns, code, i, idx, obj, val, val_var;
|
var _a, _b, access_class, assigns, code, i, idx, obj, val, val_var, value;
|
||||||
val_var = o.scope.free_variable();
|
val_var = o.scope.free_variable();
|
||||||
assigns = [this.idt() + val_var + ' = ' + this.value.compile(o) + ';'];
|
value = this.value.is_statement() ? ClosureNode.wrap(this.value) : this.value;
|
||||||
|
assigns = [this.idt() + val_var + ' = ' + value.compile(o) + ';'];
|
||||||
o.top = true;
|
o.top = true;
|
||||||
o.as_statement = true;
|
o.as_statement = true;
|
||||||
_a = this.variable.base.objects;
|
_a = this.variable.base.objects;
|
||||||
|
|
|
@ -604,7 +604,8 @@ AssignNode: exports.AssignNode: inherit BaseNode, {
|
||||||
# See: http://wiki.ecmascript.org/doku.php?id=harmony:destructuring
|
# See: http://wiki.ecmascript.org/doku.php?id=harmony:destructuring
|
||||||
compile_pattern_match: (o) ->
|
compile_pattern_match: (o) ->
|
||||||
val_var: o.scope.free_variable()
|
val_var: o.scope.free_variable()
|
||||||
assigns: [@idt() + val_var + ' = ' + @value.compile(o) + ';']
|
value: if @value.is_statement() then ClosureNode.wrap(@value) else @value
|
||||||
|
assigns: [@idt() + val_var + ' = ' + value.compile(o) + ';']
|
||||||
o.top: true
|
o.top: true
|
||||||
o.as_statement: true
|
o.as_statement: true
|
||||||
for obj, i in @variable.base.objects
|
for obj, i in @variable.base.objects
|
||||||
|
|
Loading…
Reference in New Issue