Bug 1167823 - Handle various list-ful nodes by kind when checking for side effects. r=shu
authorJeff Walden <jwalden@mit.edu>
Fri, 22 May 2015 19:02:40 -0700
changeset 247702 6d8aa39b651877b93b1c2714e304100586fc6df9
parent 247701 5baf4bf01aa2b4e66f7af715b5b891c6e9e62662
child 247703 2c3682b273017fe36f08aa92a89cd1515918891f
push idunknown
push userunknown
push dateunknown
reviewersshu
bugs1167823
milestone41.0a1
Bug 1167823 - Handle various list-ful nodes by kind when checking for side effects. r=shu
js/src/frontend/BytecodeEmitter.cpp
--- a/js/src/frontend/BytecodeEmitter.cpp
+++ b/js/src/frontend/BytecodeEmitter.cpp
@@ -2039,16 +2039,18 @@ BytecodeEmitter::checkSideEffects(ParseN
       case PNK_URSHASSIGN:
       case PNK_MULASSIGN:
       case PNK_DIVASSIGN:
       case PNK_MODASSIGN:
         MOZ_ASSERT(pn->isArity(PN_BINARY));
         *answer = true;
         return true;
 
+      case PNK_STATEMENTLIST:
+      case PNK_CATCHLIST:
       // Strict equality operations and logical operators are well-behaved and
       // perform no conversions.
       case PNK_OR:
       case PNK_AND:
       case PNK_STRICTEQ:
       case PNK_STRICTNE:
       // Any subexpression of a comma expression could be effectful.
       case PNK_COMMA:
@@ -2226,24 +2228,22 @@ BytecodeEmitter::checkSideEffects(ParseN
       case PNK_SWITCH:
       case PNK_LETBLOCK:
       case PNK_CLASSMETHOD:
       case PNK_WITH:
       case PNK_CLASSNAMES:
       case PNK_RETURN:
       case PNK_CLASS:
       case PNK_GENEXP:
-      case PNK_STATEMENTLIST:
       case PNK_ARGSBODY:
       case PNK_ARRAYCOMP:
       case PNK_CLASSMETHODLIST:
       case PNK_TEMPLATE_STRING_LIST:
       case PNK_EXPORT_SPEC_LIST:
       case PNK_IMPORT_SPEC_LIST:
-      case PNK_CATCHLIST:
       case PNK_LABEL:
       case PNK_LEXICALSCOPE:
       case PNK_NAME:
       case PNK_FUNCTION:
       case PNK_EXPORT_SPEC:
       case PNK_IMPORT_SPEC:
       case PNK_CALLSITEOBJ:
         break; // for now