Backed out changeset 3754355930d5
authorDavid Anderson <danderson@mozilla.com>
Fri, 17 Sep 2010 12:10:52 -0700
changeset 74585 0f2870ac9b878376f638a45c3d2965782fe7951b
parent 74584 3754355930d5047abd919605f738d07212d4fad2
child 74587 a5a255965167b428f4c45dd192187d32ca84269b
push id2
push userbsmedberg@mozilla.com
push dateFri, 19 Aug 2011 14:38:13 +0000
milestone2.0b6pre
backs out3754355930d5047abd919605f738d07212d4fad2
Backed out changeset 3754355930d5
js/src/jsparse.cpp
js/src/jsparse.h
--- a/js/src/jsparse.cpp
+++ b/js/src/jsparse.cpp
@@ -1496,21 +1496,21 @@ MakeAssignment(JSParseNode *pn, JSParseN
     pn->pn_right = rhs;
     return lhs;
 }
 
 static JSParseNode *
 MakeDefIntoUse(JSDefinition *dn, JSParseNode *pn, JSAtom *atom, JSTreeContext *tc)
 {
     /*
-     * If dn is arg, or in [var, const, let], and has an initializer, then we
-     * must rewrite it to be an assignment node, whose freshly allocated
-     * left-hand side becomes a use of pn.
+     * If dn is var, const, or let, and it has an initializer, then we must
+     * rewrite it to be an assignment node, whose freshly allocated left-hand
+     * side becomes a use of pn.
      */
-    if (dn->isArgOrBindingForm()) {
+    if (dn->isBindingForm()) {
         JSParseNode *rhs = dn->expr();
         if (rhs) {
             JSParseNode *lhs = MakeAssignment(dn, rhs, tc);
             if (!lhs)
                 return NULL;
             //pn->dn_uses = lhs;
             dn = (JSDefinition *) lhs;
         }
@@ -2451,20 +2451,20 @@ const char js_argument_str[] = "argument
 const char js_variable_str[] = "variable";
 const char js_unknown_str[]  = "unknown";
 
 const char *
 JSDefinition::kindString(Kind kind)
 {
     static const char *table[] = {
         js_var_str, js_const_str, js_let_str,
-        js_argument_str, js_function_str, js_unknown_str
+        js_function_str, js_argument_str, js_unknown_str
     };
 
-    JS_ASSERT(unsigned(kind) <= unsigned(FUNCTION));
+    JS_ASSERT(unsigned(kind) <= unsigned(ARG));
     return table[kind];
 }
 
 static JSFunctionBox *
 EnterFunction(JSParseNode *fn, JSTreeContext *funtc, JSAtom *funAtom = NULL,
               uintN lambda = JSFUN_LAMBDA)
 {
     JSTreeContext *tc = funtc->parent;
--- a/js/src/jsparse.h
+++ b/js/src/jsparse.h
@@ -837,20 +837,19 @@ struct JSDefinition : public JSParseNode
         JS_ASSERT(pn_defn);
         return pn_cookie.isFree() || test(PND_GVAR);
     }
 
     // Grr, windows.h or something under it #defines CONST...
 #ifdef CONST
 # undef CONST
 #endif
-    enum Kind { VAR, CONST, LET, ARG, FUNCTION, UNKNOWN };
+    enum Kind { VAR, CONST, LET, FUNCTION, ARG, UNKNOWN };
 
     bool isBindingForm() { return int(kind()) <= int(LET); }
-    bool isArgOrBindingForm() { return int(kind()) <= int(ARG); }
 
     static const char *kindString(Kind kind);
 
     Kind kind() {
         if (PN_TYPE(this) == js::TOK_FUNCTION)
             return FUNCTION;
         JS_ASSERT(PN_TYPE(this) == js::TOK_NAME);
         if (PN_OP(this) == JSOP_NOP)