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

Unified Diff: src/scopes.h

Issue 1386253002: Use Scope::function_kind_ to distinguish arrow function scopes (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 2 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 side-by-side diff with in-line comments
Download patch
Index: src/scopes.h
diff --git a/src/scopes.h b/src/scopes.h
index 3054f30e2b86d343feb48845915c98220c019d15..723509a78e0048ba422082c3dfc579cc0b8ff15b 100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -302,15 +302,15 @@ class Scope: public ZoneObject {
// Specific scope types.
bool is_eval_scope() const { return scope_type_ == EVAL_SCOPE; }
- bool is_function_scope() const {
- return scope_type_ == FUNCTION_SCOPE || scope_type_ == ARROW_SCOPE;
- }
+ bool is_function_scope() const { return scope_type_ == FUNCTION_SCOPE; }
bool is_module_scope() const { return scope_type_ == MODULE_SCOPE; }
bool is_script_scope() const { return scope_type_ == SCRIPT_SCOPE; }
bool is_catch_scope() const { return scope_type_ == CATCH_SCOPE; }
bool is_block_scope() const { return scope_type_ == BLOCK_SCOPE; }
bool is_with_scope() const { return scope_type_ == WITH_SCOPE; }
- bool is_arrow_scope() const { return scope_type_ == ARROW_SCOPE; }
+ bool is_arrow_scope() const {
+ return is_function_scope() && IsArrowFunction(function_kind_);
+ }
bool is_declaration_scope() const { return is_declaration_scope_; }
void set_is_declaration_scope() { is_declaration_scope_ = true; }
« no previous file with comments | « src/scopeinfo.cc ('k') | src/scopes.cc » ('j') | test/mjsunit/es6/regress/regress-4466.js » ('J')

Powered by Google App Engine
This is Rietveld 408576698