Commit b645cb8c authored by Eddy Bruel's avatar Eddy Bruel
Browse files

CLOSED TREE. (Bug 568593) Backed out changeset e0aa698192b7

parent f21fcc86
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -253,7 +253,7 @@ frontend::CompileFunctionBody(JSContext *cx, HandleFunction fun, CompileOptions
    fun->setArgCount(formals.length());

    /* FIXME: make Function format the source for a function definition. */
    ParseNode *fn = CodeNode::create(PNK_FUNCTION, &parser);
    ParseNode *fn = FunctionNode::create(PNK_FUNCTION, &parser);
    if (!fn)
        return false;

+1 −1
Original line number Diff line number Diff line
@@ -1477,7 +1477,7 @@ CheckSideEffects(JSContext *cx, BytecodeEmitter *bce, ParseNode *pn, bool *answe
        return true;

    switch (pn->getArity()) {
      case PN_CODE:
      case PN_FUNC:
        /*
         * A named function, contrary to ES3, is no longer useful, because we
         * bind its name lexically (using JSOP_CALLEE) instead of creating an
+3 −9
Original line number Diff line number Diff line
@@ -254,15 +254,9 @@ frontend::FoldConstants(JSContext *cx, ParseNode **pnp, Parser *parser, bool inG
    JS_CHECK_RECURSION(cx, return false);

    switch (pn->getArity()) {
      case PN_CODE:
        if (pn->getKind() == PNK_MODULE) {
            if (!FoldConstants(cx, &pn->pn_body, parser))
                return false;
        } else {
            JS_ASSERT(pn->getKind() == PNK_FUNCTION);
      case PN_FUNC:
        if (!FoldConstants(cx, &pn->pn_body, parser, pn->pn_funbox->inGenexpLambda))
            return false;
        }
        break;

      case PN_LIST:
+2 −2
Original line number Diff line number Diff line
@@ -273,7 +273,7 @@ class NameResolver
        if (cur == NULL)
            return;

        if (cur->isKind(PNK_FUNCTION) && cur->isArity(PN_CODE)) {
        if (cur->isKind(PNK_FUNCTION) && cur->isArity(PN_FUNC)) {
            RootedAtom prefix2(cx, resolveFun(cur, prefix));
            /*
             * If a function looks like (function(){})() where the parent node
@@ -314,7 +314,7 @@ class NameResolver
            resolve(cur->pn_kid2, prefix);
            resolve(cur->pn_kid3, prefix);
            break;
          case PN_CODE:
          case PN_FUNC:
            JS_ASSERT(cur->isKind(PNK_FUNCTION));
            resolve(cur->pn_body, prefix);
            break;
+0 −7
Original line number Diff line number Diff line
@@ -36,13 +36,6 @@ ParseNode::name() const
    return atom->asPropertyName();
}

inline JSAtom *
ParseNode::atom() const
{
    JS_ASSERT(isKind(PNK_MODULE) || isKind(PNK_STRING));
    return isKind(PNK_MODULE) ? pn_modulebox->module()->atom() : pn_atom;
}

inline bool
ParseNode::isConstant()
{
Loading