Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(3)

Side by Side Diff: src/parsing/preparser.cc

Issue 2654423004: [async-functions] support await expressions in finally statements (Closed)
Patch Set: I'd like to build with -Wunused-variables locally, but how!? Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « src/parsing/preparser.h ('k') | src/utils.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 213 matching lines...) Expand 10 before | Expand all | Expand 10 after
224 Expect(Token::RPAREN, CHECK_OK); 224 Expect(Token::RPAREN, CHECK_OK);
225 int formals_end_position = scanner()->location().end_pos; 225 int formals_end_position = scanner()->location().end_pos;
226 226
227 CheckArityRestrictions(formals.arity, kind, formals.has_rest, start_position, 227 CheckArityRestrictions(formals.arity, kind, formals.has_rest, start_position,
228 formals_end_position, CHECK_OK); 228 formals_end_position, CHECK_OK);
229 229
230 Expect(Token::LBRACE, CHECK_OK); 230 Expect(Token::LBRACE, CHECK_OK);
231 231
232 // Parse function body. 232 // Parse function body.
233 PreParserStatementList body; 233 PreParserStatementList body;
234 BlockT parameter_init_block = NullBlock();
234 int pos = function_token_pos == kNoSourcePosition ? peek_position() 235 int pos = function_token_pos == kNoSourcePosition ? peek_position()
235 : function_token_pos; 236 : function_token_pos;
236 ParseFunctionBody(body, function_name, pos, formals, kind, function_type, 237 ParseFunctionBody(body, &parameter_init_block, function_name, pos, formals,
237 CHECK_OK); 238 kind, function_type, CHECK_OK);
238 239
239 // Parsing the body may change the language mode in our scope. 240 // Parsing the body may change the language mode in our scope.
240 language_mode = function_scope->language_mode(); 241 language_mode = function_scope->language_mode();
241 242
242 if (is_sloppy(language_mode)) { 243 if (is_sloppy(language_mode)) {
243 function_scope->HoistSloppyBlockFunctions(nullptr); 244 function_scope->HoistSloppyBlockFunctions(nullptr);
244 } 245 }
245 246
246 // Validate name and parameter names. We can do this only after parsing the 247 // Validate name and parameter names. We can do this only after parsing the
247 // function, since the function can declare itself strict. 248 // function, since the function can declare itself strict.
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
318 } 319 }
319 } 320 }
320 } 321 }
321 322
322 #undef CHECK_OK 323 #undef CHECK_OK
323 #undef CHECK_OK_CUSTOM 324 #undef CHECK_OK_CUSTOM
324 325
325 326
326 } // namespace internal 327 } // namespace internal
327 } // namespace v8 328 } // namespace v8
OLDNEW
« no previous file with comments | « src/parsing/preparser.h ('k') | src/utils.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698