OLD | NEW |
---|---|
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 <cmath> | 5 #include <cmath> |
6 | 6 |
7 #include "src/allocation.h" | 7 #include "src/allocation.h" |
8 #include "src/base/logging.h" | 8 #include "src/base/logging.h" |
9 #include "src/conversions-inl.h" | 9 #include "src/conversions-inl.h" |
10 #include "src/conversions.h" | 10 #include "src/conversions.h" |
(...skipping 1221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1232 Scanner::Location spread_pos; | 1232 Scanner::Location spread_pos; |
1233 ExpressionClassifier classifier; | 1233 ExpressionClassifier classifier; |
1234 ParseArguments(&spread_pos, &classifier, ok); | 1234 ParseArguments(&spread_pos, &classifier, ok); |
1235 ValidateExpression(&classifier, CHECK_OK); | 1235 ValidateExpression(&classifier, CHECK_OK); |
1236 | 1236 |
1237 DCHECK(!spread_pos.IsValid()); | 1237 DCHECK(!spread_pos.IsValid()); |
1238 | 1238 |
1239 return Expression::Default(); | 1239 return Expression::Default(); |
1240 } | 1240 } |
1241 | 1241 |
1242 | |
1243 PreParserExpression PreParser::ParseDoExpression(bool* ok) { | |
1244 // AssignmentExpression :: | |
1245 // do '{' StatementList '}' | |
1246 Expect(Token::DO, CHECK_OK); | |
1247 Expect(Token::LBRACE, CHECK_OK); | |
1248 Scope* block_scope = NewScope(scope_, BLOCK_SCOPE); | |
adamk
2015/10/15 10:59:33
Why does this need a Scope when we don't use a Sco
caitp (gmail)
2015/10/15 11:24:17
Allocating the temporary result, but it lives in t
adamk
2015/10/15 12:01:25
I'd remove it (and maybe just delegate to ParseBlo
caitp (gmail)
2015/10/15 12:34:07
Wait, I had actually gotten rid of this in an earl
| |
1249 { | |
1250 BlockState block_state(&scope_, block_scope); | |
1251 while (peek() != Token::RBRACE) { | |
1252 ParseStatementListItem(CHECK_OK); | |
1253 } | |
1254 Expect(Token::RBRACE, CHECK_OK); | |
1255 return PreParserExpression::Default(); | |
1256 } | |
1257 } | |
1258 | |
1242 #undef CHECK_OK | 1259 #undef CHECK_OK |
1243 | 1260 |
1244 | 1261 |
1245 } // namespace internal | 1262 } // namespace internal |
1246 } // namespace v8 | 1263 } // namespace v8 |
OLD | NEW |