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

Side by Side Diff: src/parsing/parser-base.h

Issue 2185223002: Fix not throwing error when redefine eval or arguments in strict mode. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: update Created 4 years, 4 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 | « no previous file | test/mjsunit/strict-mode-eval.js » ('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_PARSING_PARSER_BASE_H 5 #ifndef V8_PARSING_PARSER_BASE_H
6 #define V8_PARSING_PARSER_BASE_H 6 #define V8_PARSING_PARSER_BASE_H
7 7
8 #include "src/ast/scopes.h" 8 #include "src/ast/scopes.h"
9 #include "src/bailout-reason.h" 9 #include "src/bailout-reason.h"
10 #include "src/base/hashmap.h" 10 #include "src/base/hashmap.h"
(...skipping 1889 matching lines...) Expand 10 before | Expand all | Expand 10 after
1900 Traits::RewriteNonPattern(&computed_name_classifier, CHECK_OK); 1900 Traits::RewriteNonPattern(&computed_name_classifier, CHECK_OK);
1901 classifier->Accumulate(&computed_name_classifier, 1901 classifier->Accumulate(&computed_name_classifier,
1902 ExpressionClassifier::ExpressionProductions); 1902 ExpressionClassifier::ExpressionProductions);
1903 Expect(Token::RBRACK, CHECK_OK); 1903 Expect(Token::RBRACK, CHECK_OK);
1904 return expression; 1904 return expression;
1905 } 1905 }
1906 1906
1907 default: 1907 default:
1908 *name = ParseIdentifierName(CHECK_OK); 1908 *name = ParseIdentifierName(CHECK_OK);
1909 scanner()->IsGetOrSet(is_get, is_set); 1909 scanner()->IsGetOrSet(is_get, is_set);
1910 if (this->IsAwait(*name)) { 1910 if (this->IsAwait(*name)) {
adamk 2016/08/05 22:29:29 I actually don't know why we handle this here inst
lpy 2016/08/09 01:01:47 Done.
1911 *is_await = true; 1911 *is_await = true;
1912 } else if (this->IsEval(*name)) {
adamk 2016/08/05 22:29:29 What about "arguments"? Is there a reason check h
lpy 2016/08/09 01:01:47 My understanding is when parsing the property name
1913 classifier->RecordStrictModeFormalParameterError(
adamk 2016/08/05 22:29:29 Not clear on why this is an error in sloppy mode.
1914 scanner()->location(), MessageTemplate::kStrictEvalArguments);
1915 if (is_strict(language_mode())) {
1916 classifier->RecordBindingPatternError(
1917 scanner()->location(), MessageTemplate::kStrictEvalArguments);
1918 }
1912 } 1919 }
1913 break; 1920 break;
1914 } 1921 }
1915 1922
1916 uint32_t index; 1923 uint32_t index;
1917 return this->IsArrayIndex(*name, &index) 1924 return this->IsArrayIndex(*name, &index)
1918 ? factory()->NewNumberLiteral(index, pos) 1925 ? factory()->NewNumberLiteral(index, pos)
1919 : factory()->NewStringLiteral(*name, pos); 1926 : factory()->NewStringLiteral(*name, pos);
1920 } 1927 }
1921 1928
(...skipping 1771 matching lines...) Expand 10 before | Expand all | Expand 10 after
3693 has_seen_constructor_ = true; 3700 has_seen_constructor_ = true;
3694 return; 3701 return;
3695 } 3702 }
3696 } 3703 }
3697 3704
3698 3705
3699 } // namespace internal 3706 } // namespace internal
3700 } // namespace v8 3707 } // namespace v8
3701 3708
3702 #endif // V8_PARSING_PARSER_BASE_H 3709 #endif // V8_PARSING_PARSER_BASE_H
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/strict-mode-eval.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698