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

Side by Side Diff: src/preparser.h

Issue 885243002: Implement parsing of ES6 Rest Parameters (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: [parsing]: eval/arguments parameter names are ok in sloppy mode Created 5 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/parser.cc ('k') | src/scopes.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 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 #ifndef V8_PREPARSER_H 5 #ifndef V8_PREPARSER_H
6 #define V8_PREPARSER_H 6 #define V8_PREPARSER_H
7 7
8 #include "src/v8.h" 8 #include "src/v8.h"
9 9
10 #include "src/bailout-reason.h" 10 #include "src/bailout-reason.h"
(...skipping 457 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 // Checking the parameter names of a function literal. This has to be done 468 // Checking the parameter names of a function literal. This has to be done
469 // after parsing the function, since the function can declare itself strict. 469 // after parsing the function, since the function can declare itself strict.
470 void CheckFunctionParameterNames(LanguageMode language_mode, 470 void CheckFunctionParameterNames(LanguageMode language_mode,
471 bool strict_params, 471 bool strict_params,
472 const Scanner::Location& eval_args_error_loc, 472 const Scanner::Location& eval_args_error_loc,
473 const Scanner::Location& dupe_error_loc, 473 const Scanner::Location& dupe_error_loc,
474 const Scanner::Location& reserved_loc, 474 const Scanner::Location& reserved_loc,
475 bool* ok) { 475 bool* ok) {
476 if (is_sloppy(language_mode) && !strict_params) return; 476 if (is_sloppy(language_mode) && !strict_params) return;
477 477
478 if (eval_args_error_loc.IsValid()) { 478 if (is_strict(language_mode) && eval_args_error_loc.IsValid()) {
479 Traits::ReportMessageAt(eval_args_error_loc, "strict_eval_arguments"); 479 Traits::ReportMessageAt(eval_args_error_loc, "strict_eval_arguments");
480 *ok = false; 480 *ok = false;
481 return; 481 return;
482 } 482 }
483 // TODO(arv): When we add support for destructuring in setters we also need 483 // TODO(arv): When we add support for destructuring in setters we also need
484 // to check for duplicate names. 484 // to check for duplicate names.
485 if (dupe_error_loc.IsValid()) { 485 if (dupe_error_loc.IsValid()) {
486 Traits::ReportMessageAt(dupe_error_loc, "strict_param_dupe"); 486 Traits::ReportMessageAt(dupe_error_loc, "strict_param_dupe");
487 *ok = false; 487 *ok = false;
488 return; 488 return;
(...skipping 2587 matching lines...) Expand 10 before | Expand all | Expand 10 after
3076 *ok = false; 3076 *ok = false;
3077 return; 3077 return;
3078 } 3078 }
3079 has_seen_constructor_ = true; 3079 has_seen_constructor_ = true;
3080 return; 3080 return;
3081 } 3081 }
3082 } 3082 }
3083 } } // v8::internal 3083 } } // v8::internal
3084 3084
3085 #endif // V8_PREPARSER_H 3085 #endif // V8_PREPARSER_H
OLDNEW
« no previous file with comments | « src/parser.cc ('k') | src/scopes.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698