diff --git a/mozilla/js/src/jsopcode.c b/mozilla/js/src/jsopcode.c index 5b4d82f7687..fb549655219 100644 --- a/mozilla/js/src/jsopcode.c +++ b/mozilla/js/src/jsopcode.c @@ -2065,11 +2065,22 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb) goto do_forloop; } if (SN_TYPE(sn) == SRC_DECL) { - todo = SprintCString(&ss->sprinter, rval); - if (todo < 0 || - !PushOff(ss, todo, JSOP_NOP)) { - return NULL; + if (ss->top == jp->script->depth) { + /* + * This must be an empty destructuring + * in the head of a let whose body block + * is also empty. + */ + pc = pc2 + 1; + len = js_GetSrcNoteOffset(sn, 0); + LOCAL_ASSERT(pc[len] == JSOP_LEAVEBLOCK); + js_printf(jp, "\tlet (%s) {\n", rval); + js_printf(jp, "\t}\n"); + goto end_setsp; } + todo = SprintCString(&ss->sprinter, rval); + if (todo < 0 || !PushOff(ss, todo, JSOP_NOP)) + return NULL; op = JSOP_POP; pc = pc2 + 1; goto do_letheadbody; @@ -2091,9 +2102,11 @@ Decompile(SprintStack *ss, jsbytecode *pc, intN nb) /* * If control flow reaches this point with todo still -2, + * just print rval as an expression statement. */ if (todo == -2) js_printf(jp, "\t%s;\n", rval); + end_setsp: break; } #endif