Bug 997590 (part 1) - Remove a dead else-branch. r=sstangl.
authorNicholas Nethercote <nnethercote@mozilla.com>
Tue, 22 Apr 2014 20:12:33 -0700
changeset 181046 2e077142ca7335f8286d764c79eafd2caffbcd2a
parent 181045 c8744094c98540d3a07afcfd2992ffe042ace477
child 181047 91347e9322202bf354fafa5d931c7033942575f6
push id272
push userpvanderbeken@mozilla.com
push dateMon, 05 May 2014 16:31:18 +0000
reviewerssstangl
bugs997590
milestone32.0a1
Bug 997590 (part 1) - Remove a dead else-branch. r=sstangl.
js/src/frontend/Parser.cpp
--- a/js/src/frontend/Parser.cpp
+++ b/js/src/frontend/Parser.cpp
@@ -6905,21 +6905,18 @@ typename ParseHandler::Node
 Parser<ParseHandler>::newRegExp()
 {
     // Create the regexp even when doing a syntax parse, to check the regexp's syntax.
     const jschar *chars = tokenStream.getTokenbuf().begin();
     size_t length = tokenStream.getTokenbuf().length();
     RegExpFlag flags = tokenStream.currentToken().regExpFlags();
 
     Rooted<RegExpObject*> reobj(context);
-    if (RegExpStatics *res = context->global()->getRegExpStatics())
-        reobj = RegExpObject::create(context, res, chars, length, flags, &tokenStream);
-    else
-        reobj = RegExpObject::createNoStatics(context, chars, length, flags, &tokenStream);
-
+    RegExpStatics *res = context->global()->getRegExpStatics();
+    reobj = RegExpObject::create(context, res, chars, length, flags, &tokenStream);
     if (!reobj)
         return null();
 
     return handler.newRegExp(reobj, pos(), *this);
 }
 
 template <typename ParseHandler>
 typename ParseHandler::Node