Changeset 27097 in webkit for trunk/JavaScriptCore/kjs/internal.h
- Timestamp:
- Oct 26, 2007, 1:32:40 AM (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/internal.h
r27095 r27097 91 91 92 92 93 /**94 * @short The "label set" in Ecma-262 spec95 */96 class LabelStack : Noncopyable {97 public:98 LabelStack()99 : tos(0)100 {101 }102 ~LabelStack();103 104 /**105 * If id is not empty and is not in the stack already, puts it on top of106 * the stack and returns true, otherwise returns false107 */108 bool push(const Identifier &id);109 /**110 * Is the id in the stack?111 */112 bool contains(const Identifier &id) const;113 /**114 * Removes from the stack the last pushed id (what else?)115 */116 void pop();117 118 private:119 struct StackElem {120 Identifier id;121 StackElem *prev;122 };123 124 StackElem *tos;125 };126 127 128 93 // --------------------------------------------------------------------------- 129 94 // Evaluation … … 150 115 #endif 151 116 152 inline LabelStack::~LabelStack()153 {154 StackElem *prev;155 for (StackElem *e = tos; e; e = prev) {156 prev = e->prev;157 delete e;158 }159 }160 161 inline void LabelStack::pop()162 {163 if (StackElem *e = tos) {164 tos = e->prev;165 delete e;166 }167 }168 169 117 } // namespace 170 118
Note:
See TracChangeset
for help on using the changeset viewer.