Changeset 35027 in webkit for trunk/JavaScriptCore/kjs/LabelStack.cpp
- Timestamp:
- Jul 6, 2008, 7:49:29 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/LabelStack.cpp
r34893 r35027 26 26 namespace KJS { 27 27 28 bool LabelStack::push(const Identifier &id)28 bool LabelStack::push(const Identifier& id) 29 29 { 30 if (contains(id))31 return false;30 if (contains(id)) 31 return false; 32 32 33 StackElem *newtos= new StackElem;34 newtos->id = id;35 newtos->prev = tos;36 tos = newtos;37 return true;33 StackElem* newTopOfStack = new StackElem; 34 newTopOfStack->id = id; 35 newTopOfStack->prev = m_topOfStack; 36 m_topOfStack = newTopOfStack; 37 return true; 38 38 } 39 39 40 40 bool LabelStack::contains(const Identifier &id) const 41 41 { 42 if (id.isEmpty())43 return true;42 if (id.isEmpty()) 43 return true; 44 44 45 for (StackElem *curr = tos; curr; curr = curr->prev) 46 if (curr->id == id) 47 return true; 45 for (StackElem* curr = m_topOfStack; curr; curr = curr->prev) { 46 if (curr->id == id) 47 return true; 48 } 48 49 49 return false;50 return false; 50 51 } 51 52
Note:
See TracChangeset
for help on using the changeset viewer.