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

Unified Diff: src/scopes.h

Issue 1104223002: [es6] implement optional parameters via desugaring (with scoping) (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Make scoping sort-of work-ish, still no hole-checking Created 5 years, 8 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 5e3dc1f0654bf65c3ee738665fcb7bf2107be63b..3b42ed11b275d4a491f37987ef201e0c728ba7ad 100644
--- a/src/scopes.h
+++ b/src/scopes.h
@@ -101,7 +101,7 @@ class Scope: public ZoneObject {
// Declarations
// Lookup a variable in this scope. Returns the variable or NULL if not found.
- Variable* LookupLocal(const AstRawString* name);
+ Variable* LookupLocal(const AstRawString* name, bool parameters_only = false);
// This lookup corresponds to a lookup in the "intermediate" scope sitting
// between this scope and the outer scope. (ECMA-262, 3rd., requires that
@@ -282,6 +282,7 @@ class Scope: public ZoneObject {
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_parameter_scope() const { return scope_type_ == PARAMETER_SCOPE; }
void tag_as_class_scope() {
DCHECK(is_block_scope());
block_scope_is_class_scope_ = true;
@@ -677,7 +678,8 @@ class Scope: public ZoneObject {
// scope. If the code is executed because of a call to 'eval', the context
// parameter should be set to the calling context of 'eval'.
Variable* LookupRecursive(VariableProxy* proxy, BindingKind* binding_kind,
- AstNodeFactory* factory);
+ AstNodeFactory* factory,
+ bool parameters_only = false);
MUST_USE_RESULT
bool ResolveVariable(ParseInfo* info, VariableProxy* proxy,
AstNodeFactory* factory);
« src/globals.h ('K') | « src/runtime/runtime-debug.cc ('k') | src/scopes.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698