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


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.cpp

    r5115 r5209  
    19881988// ------------------------------ ForNode --------------------------------------
    19891989
     1990VarDeclListNode *ForNode::reverseList(VarDeclListNode *list)
     1991{
     1992  VarDeclListNode *head = 0;
     1993  VarDeclListNode *next;
     1994  for (VarDeclListNode *n = list; n; n = next) {
     1995    next = n->list;
     1996    n->list = head;
     1997    head = n;
     1998  }
     1999  return head;
     2000}
     2001
    19902002void ForNode::ref()
    19912003{
Note: See TracChangeset for help on using the changeset viewer.