mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-24 10:45:42 +00:00
Fix labeled brace source annotation harder (352415, r=mrbkap).
This commit is contained in:
parent
28d714c602
commit
93dd592cda
@ -5087,11 +5087,12 @@ js_EmitTree(JSContext *cx, JSCodeGenerator *cg, JSParseNode *pn)
|
||||
if (!ale)
|
||||
return JS_FALSE;
|
||||
pn2 = pn->pn_expr;
|
||||
noteIndex = js_NewSrcNote2(cx, cg,
|
||||
(pn2->pn_type == TOK_LC ||
|
||||
pn2->pn_type == TOK_LEXICALSCOPE)
|
||||
? SRC_LABELBRACE
|
||||
: SRC_LABEL,
|
||||
noteType = (pn2->pn_type == TOK_LC ||
|
||||
(pn2->pn_type == TOK_LEXICALSCOPE &&
|
||||
pn2->pn_expr->pn_type == TOK_LC))
|
||||
? SRC_LABELBRACE
|
||||
: SRC_LABEL;
|
||||
noteIndex = js_NewSrcNote2(cx, cg, noteType,
|
||||
(ptrdiff_t) ALE_INDEX(ale));
|
||||
if (noteIndex < 0 ||
|
||||
js_Emit1(cx, cg, JSOP_NOP) < 0) {
|
||||
@ -5108,7 +5109,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 || pn2->pn_type == TOK_LEXICALSCOPE) {
|
||||
if (noteType == SRC_LABELBRACE) {
|
||||
if (js_NewSrcNote(cx, cg, SRC_ENDBRACE) < 0 ||
|
||||
js_Emit1(cx, cg, JSOP_NOP) < 0) {
|
||||
return JS_FALSE;
|
||||
|
Loading…
Reference in New Issue
Block a user