Bug 704369: Factor break emit. (r=Waldo)
authorChris Leary <cdleary@mozilla.com>
Tue, 22 Nov 2011 10:41:11 -0800
changeset 82891 2a4220da28dbc978c96dd61255c70aacf93f4c53
parent 82890 89da5f4649408c3bd46cb4e02bbae5c48551fdf0
child 82892 62ea2d21d2ec9d22e2a984e65a13fdd9c2157508
push idunknown
push userunknown
push dateunknown
reviewersWaldo
bugs704369
milestone11.0a1
Bug 704369: Factor break emit. (r=Waldo)
js/src/frontend/BytecodeEmitter.cpp
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -6016,31 +6016,29 @@ EmitBreak(JSContext *cx, BytecodeEmitter
 {
     StmtInfo *stmt = bce->topStmt;
     JSAtom *atom = pn->pn_atom;
 
     SrcNoteType noteType;
     jsatomid labelIndex;
     if (atom) {
         if (!bce->makeAtomIndex(atom, &labelIndex))
-            return JS_FALSE;
+            return false;
 
         while (stmt->type != STMT_LABEL || stmt->label != atom)
             stmt = stmt->down;
         noteType = SRC_BREAK2LABEL;
     } else {
         labelIndex = INVALID_ATOMID;
         while (!STMT_IS_LOOP(stmt) && stmt->type != STMT_SWITCH)
             stmt = stmt->down;
         noteType = (stmt->type == STMT_SWITCH) ? SRC_SWITCHBREAK : SRC_BREAK;
     }
 
-    if (EmitGoto(cx, bce, stmt, &stmt->breaks, labelIndex, noteType) < 0)
-        return JS_FALSE;
-    return true;
+    return EmitGoto(cx, bce, stmt, &stmt->breaks, labelIndex, noteType) >= 0;
 }
 
 JSBool
 frontend::EmitTree(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn)
 {
     JSBool useful, wantval;
     StmtInfo stmtInfo;
     StmtInfo *stmt;