Index: src/asmjs/asm-wasm-builder.cc |
diff --git a/src/asmjs/asm-wasm-builder.cc b/src/asmjs/asm-wasm-builder.cc |
index 0dfd5e2ade8061d400f782556e419ac4e06f29bd..6419459307be958b5d32e80a6471ec01fb56dc2a 100644 |
--- a/src/asmjs/asm-wasm-builder.cc |
+++ b/src/asmjs/asm-wasm-builder.cc |
@@ -830,6 +830,12 @@ class AsmWasmBuilderImpl final : public AstVisitor<AsmWasmBuilderImpl> { |
void VisitAssignment(Assignment* expr) { |
bool as_init = false; |
if (scope_ == kModuleScope) { |
+ // Skip extra assignment inserted by the parser when in this form: |
+ // (function Module(a, b, c) {... }) |
+ if (expr->target()->IsVariableProxy() && |
+ expr->target()->AsVariableProxy()->var()->mode() == CONST_LEGACY) { |
+ return; |
+ } |
Property* prop = expr->value()->AsProperty(); |
if (prop != nullptr) { |
VariableProxy* vp = prop->obj()->AsVariableProxy(); |