OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "src/v8.h" | 5 #include "src/v8.h" |
6 | 6 |
7 #include "src/api.h" | 7 #include "src/api.h" |
8 #include "src/ast.h" | 8 #include "src/ast.h" |
9 #include "src/bootstrapper.h" | 9 #include "src/bootstrapper.h" |
10 #include "src/char-predicates-inl.h" | 10 #include "src/char-predicates-inl.h" |
(...skipping 2269 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2280 if (nvars == 1 && !is_const) { | 2280 if (nvars == 1 && !is_const) { |
2281 *out = name; | 2281 *out = name; |
2282 } | 2282 } |
2283 | 2283 |
2284 return block; | 2284 return block; |
2285 } | 2285 } |
2286 | 2286 |
2287 | 2287 |
2288 static bool ContainsLabel(ZoneStringList* labels, Handle<String> label) { | 2288 static bool ContainsLabel(ZoneStringList* labels, Handle<String> label) { |
2289 ASSERT(!label.is_null()); | 2289 ASSERT(!label.is_null()); |
2290 if (labels != NULL) | 2290 if (labels != NULL) { |
2291 for (int i = labels->length(); i-- > 0; ) | 2291 for (int i = labels->length(); i-- > 0; ) { |
2292 if (labels->at(i).is_identical_to(label)) | 2292 if (labels->at(i).is_identical_to(label)) { |
2293 return true; | 2293 return true; |
2294 | 2294 } |
| 2295 } |
| 2296 } |
2295 return false; | 2297 return false; |
2296 } | 2298 } |
2297 | 2299 |
2298 | 2300 |
2299 Statement* Parser::ParseExpressionOrLabelledStatement(ZoneStringList* labels, | 2301 Statement* Parser::ParseExpressionOrLabelledStatement(ZoneStringList* labels, |
2300 bool* ok) { | 2302 bool* ok) { |
2301 // ExpressionStatement | LabelledStatement :: | 2303 // ExpressionStatement | LabelledStatement :: |
2302 // Expression ';' | 2304 // Expression ';' |
2303 // Identifier ':' Statement | 2305 // Identifier ':' Statement |
2304 int pos = peek_position(); | 2306 int pos = peek_position(); |
(...skipping 2476 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4781 ASSERT(info()->isolate()->has_pending_exception()); | 4783 ASSERT(info()->isolate()->has_pending_exception()); |
4782 } else { | 4784 } else { |
4783 result = ParseProgram(); | 4785 result = ParseProgram(); |
4784 } | 4786 } |
4785 } | 4787 } |
4786 info()->SetFunction(result); | 4788 info()->SetFunction(result); |
4787 return (result != NULL); | 4789 return (result != NULL); |
4788 } | 4790 } |
4789 | 4791 |
4790 } } // namespace v8::internal | 4792 } } // namespace v8::internal |
OLD | NEW |