mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-25 22:29:07 +00:00
Update SRC_LABELBRACE selection logic to be block-scope aware (352402, r=mrbkap).
This commit is contained in:
parent
871991f5d3
commit
9fd6ba01ff
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user