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

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

Issue 1931003003: Fix 'eval' in class extends clauses to be always-strict (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Remove unrelated test case Created 4 years, 7 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/interpreter/bytecode-generator.cc ('k') | test/mjsunit/regress/regress-4970.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/hashmap.h" 10 #include "src/hashmap.h"
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 bool IsValidPattern(ExpressionT expression) { 906 bool IsValidPattern(ExpressionT expression) {
907 return expression->IsObjectLiteral() || expression->IsArrayLiteral(); 907 return expression->IsObjectLiteral() || expression->IsArrayLiteral();
908 } 908 }
909 909
910 // Keep track of eval() calls since they disable all local variable 910 // Keep track of eval() calls since they disable all local variable
911 // optimizations. This checks if expression is an eval call, and if yes, 911 // optimizations. This checks if expression is an eval call, and if yes,
912 // forwards the information to scope. 912 // forwards the information to scope.
913 void CheckPossibleEvalCall(ExpressionT expression, Scope* scope) { 913 void CheckPossibleEvalCall(ExpressionT expression, Scope* scope) {
914 if (Traits::IsIdentifier(expression) && 914 if (Traits::IsIdentifier(expression) &&
915 Traits::IsEval(Traits::AsIdentifier(expression))) { 915 Traits::IsEval(Traits::AsIdentifier(expression))) {
916 scope->DeclarationScope()->RecordEvalCall();
917 scope->RecordEvalCall(); 916 scope->RecordEvalCall();
917 if (is_sloppy(scope->language_mode())) {
918 // For sloppy scopes we also have to record the call at function level,
919 // in case it includes declarations that will be hoisted.
920 scope->DeclarationScope()->RecordEvalCall();
921 }
918 } 922 }
919 } 923 }
920 924
921 // Used to validate property names in object literals and class literals 925 // Used to validate property names in object literals and class literals
922 enum PropertyKind { 926 enum PropertyKind {
923 kAccessorProperty, 927 kAccessorProperty,
924 kValueProperty, 928 kValueProperty,
925 kMethodProperty 929 kMethodProperty
926 }; 930 };
927 931
(...skipping 2283 matching lines...) Expand 10 before | Expand all | Expand 10 after
3211 has_seen_constructor_ = true; 3215 has_seen_constructor_ = true;
3212 return; 3216 return;
3213 } 3217 }
3214 } 3218 }
3215 3219
3216 3220
3217 } // namespace internal 3221 } // namespace internal
3218 } // namespace v8 3222 } // namespace v8
3219 3223
3220 #endif // V8_PARSING_PARSER_BASE_H 3224 #endif // V8_PARSING_PARSER_BASE_H
OLDNEW
« no previous file with comments | « src/interpreter/bytecode-generator.cc ('k') | test/mjsunit/regress/regress-4970.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698