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

Side by Side Diff: src/scopes.h

Issue 1411093008: Properly handle direct evals referencing super in arrow functions (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 1 month 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/es6/regress/regress-4522.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_SCOPES_H_ 5 #ifndef V8_SCOPES_H_
6 #define V8_SCOPES_H_ 6 #define V8_SCOPES_H_
7 7
8 #include "src/ast.h" 8 #include "src/ast.h"
9 #include "src/pending-compilation-error-handler.h" 9 #include "src/pending-compilation-error-handler.h"
10 #include "src/zone.h" 10 #include "src/zone.h"
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
350 // Whether this needs to be represented by a runtime context. 350 // Whether this needs to be represented by a runtime context.
351 bool NeedsContext() const { 351 bool NeedsContext() const {
352 // Catch and module scopes always have heap slots. 352 // Catch and module scopes always have heap slots.
353 DCHECK(!is_catch_scope() || num_heap_slots() > 0); 353 DCHECK(!is_catch_scope() || num_heap_slots() > 0);
354 DCHECK(!is_module_scope() || num_heap_slots() > 0); 354 DCHECK(!is_module_scope() || num_heap_slots() > 0);
355 return is_with_scope() || num_heap_slots() > 0; 355 return is_with_scope() || num_heap_slots() > 0;
356 } 356 }
357 357
358 bool NeedsHomeObject() const { 358 bool NeedsHomeObject() const {
359 return scope_uses_super_property_ || 359 return scope_uses_super_property_ ||
360 (scope_calls_eval_ && (IsConciseMethod(function_kind()) || 360 ((scope_calls_eval_ || inner_scope_calls_eval_) &&
361 IsAccessorFunction(function_kind()) || 361 (IsConciseMethod(function_kind()) ||
362 IsClassConstructor(function_kind()))); 362 IsAccessorFunction(function_kind()) ||
363 IsClassConstructor(function_kind())));
363 } 364 }
364 365
365 const Scope* NearestOuterEvalScope() const { 366 const Scope* NearestOuterEvalScope() const {
366 if (is_eval_scope()) return this; 367 if (is_eval_scope()) return this;
367 if (outer_scope() == nullptr) return nullptr; 368 if (outer_scope() == nullptr) return nullptr;
368 return outer_scope()->NearestOuterEvalScope(); 369 return outer_scope()->NearestOuterEvalScope();
369 } 370 }
370 371
371 // --------------------------------------------------------------------------- 372 // ---------------------------------------------------------------------------
372 // Accessors. 373 // Accessors.
(...skipping 467 matching lines...) Expand 10 before | Expand all | Expand 10 after
840 841
841 // For tracking which classes are declared consecutively. Needed for strong 842 // For tracking which classes are declared consecutively. Needed for strong
842 // mode. 843 // mode.
843 int class_declaration_group_start_; 844 int class_declaration_group_start_;
844 }; 845 };
845 846
846 } // namespace internal 847 } // namespace internal
847 } // namespace v8 848 } // namespace v8
848 849
849 #endif // V8_SCOPES_H_ 850 #endif // V8_SCOPES_H_
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/es6/regress/regress-4522.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698