From c0c6a44f0458a1d0e6f8b1148d93340c18af2b4c Mon Sep 17 00:00:00 2001 From: Luke Wagner Date: Fri, 25 May 2012 11:44:38 +0200 Subject: [PATCH] Bug 756918 - Fix aliased, empty destructuring let (r=waldo) --- js/src/frontend/BytecodeEmitter.cpp | 1 + js/src/jit-test/tests/basic/testBug756918.js | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 js/src/jit-test/tests/basic/testBug756918.js diff --git a/js/src/frontend/BytecodeEmitter.cpp b/js/src/frontend/BytecodeEmitter.cpp index c9a4b6e5561..c06a10d25e4 100644 --- a/js/src/frontend/BytecodeEmitter.cpp +++ b/js/src/frontend/BytecodeEmitter.cpp @@ -1033,6 +1033,7 @@ EmitEnterBlock(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, JSOp op) /* Beware the empty destructuring dummy. */ if (!dn) { JS_ASSERT(i + 1 <= blockObj->slotCount()); + blockObj->setAliased(i, bce->sc->bindingsAccessedDynamically()); continue; } diff --git a/js/src/jit-test/tests/basic/testBug756918.js b/js/src/jit-test/tests/basic/testBug756918.js new file mode 100644 index 00000000000..2787b38813b --- /dev/null +++ b/js/src/jit-test/tests/basic/testBug756918.js @@ -0,0 +1,6 @@ +// |jit-test| error:Error + +with({}) + let([] = []) { + eval("throw new Error()"); + }