Changeset 14502 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp
- Timestamp:
- May 20, 2006, 1:19:22 PM (19 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/nodes.cpp
r14429 r14502 1509 1509 } 1510 1510 1511 // ------------------------------ StatListNode ---------------------------------1512 1513 StatListNode::StatListNode(StatementNode *s)1514 : statement(s), next(this)1515 {1516 Parser::noteNodeCycle(this);1517 setLoc(s->firstLine(), s->lastLine());1518 }1519 1520 StatListNode::StatListNode(StatListNode *l, StatementNode *s)1521 : statement(s), next(l->next)1522 {1523 l->next = this;1524 setLoc(l->firstLine(), s->lastLine());1525 }1526 1527 // ECMA 12.11528 Completion StatListNode::execute(ExecState *exec)1529 {1530 Completion c = statement->execute(exec);1531 KJS_ABORTPOINT1532 if (c.complType() != Normal)1533 return c;1534 1535 JSValue *v = c.value();1536 1537 for (StatListNode *n = next.get(); n; n = n->next.get()) {1538 Completion c2 = n->statement->execute(exec);1539 KJS_ABORTPOINT1540 if (c2.complType() != Normal)1541 return c2;1542 1543 if (c2.isValueCompletion())1544 v = c2.value();1545 c = c2;1546 }1547 1548 return Completion(c.complType(), v, c.target());1549 }1550 1551 void StatListNode::processVarDecls(ExecState *exec)1552 {1553 for (StatListNode *n = this; n; n = n->next.get())1554 n->statement->processVarDecls(exec);1555 }1556 1557 void StatListNode::breakCycle()1558 {1559 next = 0;1560 }1561 1562 1511 // ------------------------------ AssignExprNode ------------------------------- 1563 1512 … … 2095 2044 Completion CaseClauseNode::evalStatements(ExecState *exec) 2096 2045 { 2097 if ( next)2098 return next->execute(exec);2046 if (source) 2047 return source->execute(exec); 2099 2048 else 2100 2049 return Completion(Normal, jsUndefined()); … … 2103 2052 void CaseClauseNode::processVarDecls(ExecState *exec) 2104 2053 { 2105 if (next) 2106 next->processVarDecls(exec); 2054 if (source) 2055 source->processVarDecls(exec); 2056 } 2057 2058 void CaseClauseNode::processFuncDecl(ExecState* exec) 2059 { 2060 if (source) 2061 source->processFuncDecl(exec); 2107 2062 } 2108 2063 … … 2122 2077 if (n->clause) 2123 2078 n->clause->processVarDecls(exec); 2079 } 2080 2081 void ClauseListNode::processFuncDecl(ExecState* exec) 2082 { 2083 for (ClauseListNode* n = this; n; n = n->next.get()) 2084 if (n->clause) 2085 n->clause->processFuncDecl(exec); 2124 2086 } 2125 2087 … … 2231 2193 } 2232 2194 2195 void CaseBlockNode::processFuncDecl(ExecState* exec) 2196 { 2197 if (list1) 2198 list1->processFuncDecl(exec); 2199 if (def) 2200 def->processFuncDecl(exec); 2201 if (list2) 2202 list2->processFuncDecl(exec); 2203 } 2204 2233 2205 // ------------------------------ SwitchNode ----------------------------------- 2234 2206 … … 2253 2225 { 2254 2226 block->processVarDecls(exec); 2227 } 2228 2229 void SwitchNode::processFuncDecl(ExecState* exec) 2230 { 2231 block->processFuncDecl(exec); 2255 2232 } 2256 2233
Note:
See TracChangeset
for help on using the changeset viewer.