Changeset 5209 in webkit for trunk/JavaScriptCore/kjs/nodes.h


Ignore:
Timestamp:
Oct 18, 2003, 2:13:32 PM (22 years ago)
Author:
darin
Message:

Reviewed by Dave.

  • fixed 3367015 -- interdependent variable declarations in for loop don't work (they go backwards)
  • kjs/nodes.h: (KJS::ForNode::ForNode): Add a new overload of the constructor for when the first parameter is a variable declaration list. Call reverseList as we do in other constructors that take lists that are built backwards.
  • kjs/nodes.cpp: (ForNode::reverseList): Added. New helper function.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/kjs/nodes.h

    r4363 r5209  
    640640    virtual void streamTo(SourceStream &s) const;
    641641  private:
     642    friend class ForNode;
    642643    friend class VarStatementNode;
    643644    VarDeclListNode *list;
     
    733734    ForNode(Node *e1, Node *e2, Node *e3, StatementNode *s) :
    734735      expr1(e1), expr2(e2), expr3(e3), statement(s) {}
    735     virtual void ref();
    736     virtual bool deref();
    737     virtual Completion execute(ExecState *exec);
    738     virtual void processVarDecls(ExecState *exec);
    739     virtual void streamTo(SourceStream &s) const;
    740   private:
     736    ForNode(VarDeclListNode *e1, Node *e2, Node *e3, StatementNode *s) :
     737      expr1(reverseList(e1)), expr2(e2), expr3(e3), statement(s) {}
     738    virtual void ref();
     739    virtual bool deref();
     740    virtual Completion execute(ExecState *exec);
     741    virtual void processVarDecls(ExecState *exec);
     742    virtual void streamTo(SourceStream &s) const;
     743  private:
     744    static VarDeclListNode *reverseList(VarDeclListNode *);
    741745    Node *expr1, *expr2, *expr3;
    742746    StatementNode *statement;
Note: See TracChangeset for help on using the changeset viewer.