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

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/cctest/test-parsing.cc » ('j') | test/cctest/test-parsing.cc » ('J')
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 1939 matching lines...) Expand 10 before | Expand all | Expand 10 after
1950 name, &is_get, &is_set, &is_await, is_computed_name, classifier, 1950 name, &is_get, &is_set, &is_await, is_computed_name, classifier,
1951 CHECK_OK_CUSTOM(EmptyObjectLiteralProperty)); 1951 CHECK_OK_CUSTOM(EmptyObjectLiteralProperty));
1952 1952
1953 if (fni_ != nullptr && !*is_computed_name) { 1953 if (fni_ != nullptr && !*is_computed_name) {
1954 this->PushLiteralName(fni_, *name); 1954 this->PushLiteralName(fni_, *name);
1955 } 1955 }
1956 1956
1957 if (!in_class && !is_generator) { 1957 if (!in_class && !is_generator) {
1958 DCHECK(!IsStaticMethod(method_kind)); 1958 DCHECK(!IsStaticMethod(method_kind));
1959 1959
1960 if (this->IsEval(*name) || this->IsArguments(*name)) {
1961 classifier->RecordStrictModeFormalParameterError(
1962 scanner()->location(), MessageTemplate::kStrictEvalArguments);
1963 if (is_strict(language_mode())) {
1964 classifier->RecordBindingPatternError(
1965 scanner()->location(), MessageTemplate::kStrictEvalArguments);
1966 }
1967 }
1968
1960 if (peek() == Token::COLON) { 1969 if (peek() == Token::COLON) {
1961 // PropertyDefinition 1970 // PropertyDefinition
1962 // PropertyName ':' AssignmentExpression 1971 // PropertyName ':' AssignmentExpression
1963 if (!*is_computed_name) { 1972 if (!*is_computed_name) {
1964 checker->CheckProperty(name_token, kValueProperty, MethodKind::Normal, 1973 checker->CheckProperty(name_token, kValueProperty, MethodKind::Normal,
1965 CHECK_OK_CUSTOM(EmptyObjectLiteralProperty)); 1974 CHECK_OK_CUSTOM(EmptyObjectLiteralProperty));
1966 } 1975 }
1967 Consume(Token::COLON); 1976 Consume(Token::COLON);
1968 int beg_pos = peek_position(); 1977 int beg_pos = peek_position();
1969 ExpressionT value = this->ParseAssignmentExpression( 1978 ExpressionT value = this->ParseAssignmentExpression(
(...skipping 1723 matching lines...) Expand 10 before | Expand all | Expand 10 after
3693 has_seen_constructor_ = true; 3702 has_seen_constructor_ = true;
3694 return; 3703 return;
3695 } 3704 }
3696 } 3705 }
3697 3706
3698 3707
3699 } // namespace internal 3708 } // namespace internal
3700 } // namespace v8 3709 } // namespace v8
3701 3710
3702 #endif // V8_PARSING_PARSER_BASE_H 3711 #endif // V8_PARSING_PARSER_BASE_H
OLDNEW
« no previous file with comments | « no previous file | test/cctest/test-parsing.cc » ('j') | test/cctest/test-parsing.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698