From 9fd6ba01ffe488012cad7c3bcfae03a9a564f0ec Mon Sep 17 00:00:00 2001 From: "brendan%mozilla.org" Date: Tue, 12 Sep 2006 22:09:12 +0000 Subject: [PATCH] Update SRC_LABELBRACE selection logic to be block-scope aware (352402, r=mrbkap). --- js/src/jsemit.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/js/src/jsemit.c b/js/src/jsemit.c index 604b77d1ea5b..62420e51d627 100644 --- a/js/src/jsemit.c +++ b/js/src/jsemit.c @@ -5088,7 +5088,8 @@ js_EmitTree(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn) return JS_FALSE; pn2 = pn->pn_expr; noteIndex = js_NewSrcNote2(cx, cg, - (pn2->pn_type == TOK_LC) + (pn2->pn_type == TOK_LC || + pn2->pn_type == TOK_LEXICALSCOPE) ? SRC_LABELBRACE : SRC_LABEL, (ptrdiff_t) ALE_INDEX(ale)); @@ -5107,7 +5108,7 @@ js_EmitTree(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn) return JS_FALSE; /* If the statement was compound, emit a note for the end brace. */ - if (pn2->pn_type == TOK_LC) { + if (pn2->pn_type == TOK_LC || pn2->pn_type == TOK_LEXICALSCOPE) { if (js_NewSrcNote(cx, cg, SRC_ENDBRACE) < 0 || js_Emit1(cx, cg, JSOP_NOP) < 0) { return JS_FALSE;