Changeset 26617 in webkit for trunk/JavaScriptCore/kjs
- Timestamp:
- Oct 15, 2007, 1:36:57 PM (18 years ago)
- Location:
- trunk/JavaScriptCore/kjs
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/completion.h
r20310 r26617 53 53 ComplType complType() const { return comp; } 54 54 JSValue *value() const { return val; } 55 void setValue(JSValue* v) { val = v; } 55 56 Identifier target() const { return tar; } 56 57 bool isValueCompletion() const { return !!val; } -
trunk/JavaScriptCore/kjs/nodes.cpp
r26582 r26617 1808 1808 JSValue *bv; 1809 1809 Completion c; 1810 JSValue* value = 0; 1810 1811 1811 1812 do { … … 1820 1821 return Completion(Interrupted); 1821 1822 1823 if (c.isValueCompletion()) 1824 value = c.value(); 1825 1822 1826 if (!((c.complType() == Continue) && ls.contains(c.target()))) { 1823 1827 if ((c.complType() == Break) && ls.contains(c.target())) 1824 return Completion(Normal, 0);1828 return Completion(Normal, value); 1825 1829 if (c.complType() != Normal) 1826 1830 return c; … … 1830 1834 } while (bv->toBoolean(exec)); 1831 1835 1832 return Completion(Normal, 0);1836 return Completion(Normal, value); 1833 1837 } 1834 1838 … … 2560 2564 { 2561 2565 KJS_CHECKEXCEPTION 2562 2563 Completion c1 = node->execute(exec); 2564 KJS_CHECKEXCEPTION; 2565 if (c1.complType() != Normal) 2566 return c1; 2567 2568 for (SourceElementsNode *n = next.get(); n; n = n->next.get()) { 2569 Completion c2 = n->node->execute(exec); 2570 if (c2.complType() != Normal) 2571 return c2; 2572 // The spec says to return c2 here, but it seems that mozilla returns c1 if 2573 // c2 doesn't have a value 2574 if (c2.value()) 2575 c1 = c2; 2576 } 2577 2578 return c1; 2566 JSValue* v = 0; 2567 SourceElementsNode* n = this; 2568 while (1) { 2569 Completion c = n->node->execute(exec); 2570 2571 if (JSValue* v2 = c.value()) 2572 v = v2; 2573 c.setValue(v); 2574 2575 if (c.complType() != Normal) 2576 return c; 2577 2578 n = n->next.get(); 2579 if (!n) 2580 return c; 2581 } 2579 2582 } 2580 2583
Note:
See TracChangeset
for help on using the changeset viewer.