Changeset 9551 in webkit for trunk/JavaScriptCore/kjs/nodes.cpp
- Timestamp:
- Jun 30, 2005, 5:45:50 PM (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/kjs/nodes.cpp
r9518 r9551 1894 1894 KJS_CHECKEXCEPTION 1895 1895 1896 exec->context().imp()->seenLabels()->pushIteration(); 1896 1897 c = statement->execute(exec); 1898 exec->context().imp()->seenLabels()->popIteration(); 1897 1899 if (!((c.complType() == Continue) && ls.contains(c.target()))) { 1898 1900 if ((c.complType() == Break) && ls.contains(c.target())) … … 1954 1956 return Completion(Normal, value); 1955 1957 1958 exec->context().imp()->seenLabels()->pushIteration(); 1956 1959 c = statement->execute(exec); 1960 exec->context().imp()->seenLabels()->popIteration(); 1957 1961 if (c.isValueCompletion()) 1958 1962 value = c.value(); … … 2021 2025 KJS_CHECKEXCEPTION 2022 2026 2027 exec->context().imp()->seenLabels()->pushIteration(); 2023 2028 Completion c = statement->execute(exec); 2029 exec->context().imp()->seenLabels()->popIteration(); 2024 2030 if (c.isValueCompletion()) 2025 2031 cval = c.value(); … … 2132 2138 ref.putValue(exec, String(name.ustring())); 2133 2139 2140 exec->context().imp()->seenLabels()->pushIteration(); 2134 2141 c = statement->execute(exec); 2142 exec->context().imp()->seenLabels()->popIteration(); 2135 2143 if (c.isValueCompletion()) 2136 2144 retval = c.value(); … … 2166 2174 2167 2175 Value dummy; 2168 return exec->context().imp()->seenLabels()->contains(ident) ? 2169 Completion(Continue, dummy, ident) : 2170 Completion(Throw, 2171 throwError(exec, SyntaxError, "Label %s not found in containing block. Can't continue.", ident)); 2176 2177 if (ident.isEmpty() && !exec->context().imp()->seenLabels()->inIteration()) 2178 return Completion(Throw, 2179 throwError(exec, SyntaxError, "Invalid continue statement.")); 2180 else if (!ident.isEmpty() && !exec->context().imp()->seenLabels()->contains(ident)) 2181 return Completion(Throw, 2182 throwError(exec, SyntaxError, "Label %s not found.", ident)); 2183 else 2184 return Completion(Continue, dummy, ident); 2172 2185 } 2173 2186 … … 2180 2193 2181 2194 Value dummy; 2182 return exec->context().imp()->seenLabels()->contains(ident) ? 2183 Completion(Break, dummy, ident) : 2184 Completion(Throw, 2185 throwError(exec, SyntaxError, "Label %s not found in containing block. Can't break.", ident)); 2195 2196 if (ident.isEmpty() && !exec->context().imp()->seenLabels()->inIteration() && 2197 !exec->context().imp()->seenLabels()->inSwitch()) 2198 return Completion(Throw, 2199 throwError(exec, SyntaxError, "Invalid break statement.")); 2200 else if (!ident.isEmpty() && !exec->context().imp()->seenLabels()->contains(ident)) 2201 return Completion(Throw, 2202 throwError(exec, SyntaxError, "Label %s not found.", ident)); 2203 else 2204 return Completion(Break, dummy, ident); 2186 2205 } 2187 2206 … … 2490 2509 Value v = expr->evaluate(exec); 2491 2510 KJS_CHECKEXCEPTION 2511 2512 exec->context().imp()->seenLabels()->pushSwitch(); 2492 2513 Completion res = block->evalBlock(exec,v); 2514 exec->context().imp()->seenLabels()->popSwitch(); 2493 2515 2494 2516 if ((res.complType() == Break) && ls.contains(res.target()))
Note:
See TracChangeset
for help on using the changeset viewer.