| Index: src/scopes.h
|
| diff --git a/src/scopes.h b/src/scopes.h
|
| index c58d124939676e876a848d5741c94552bab76fa8..15ee267a8771fd84a471ddecefa42c410177d668 100644
|
| --- a/src/scopes.h
|
| +++ b/src/scopes.h
|
| @@ -22,8 +22,7 @@ class VariableMap: public ZoneHashMap {
|
| virtual ~VariableMap();
|
|
|
| Variable* Declare(Scope* scope, const AstRawString* name, VariableMode mode,
|
| - bool is_valid_lhs, Variable::Kind kind,
|
| - InitializationFlag initialization_flag,
|
| + Variable::Kind kind, InitializationFlag initialization_flag,
|
| MaybeAssignedFlag maybe_assigned_flag = kNotAssigned);
|
|
|
| Variable* Lookup(const AstRawString* name);
|
| @@ -142,12 +141,14 @@ class Scope: public ZoneObject {
|
| // Create a new unresolved variable.
|
| VariableProxy* NewUnresolved(AstNodeFactory* factory,
|
| const AstRawString* name,
|
| + Variable::Kind variable_kind,
|
| int position = RelocInfo::kNoPosition) {
|
| // Note that we must not share the unresolved variables with
|
| // the same name because they may be removed selectively via
|
| // RemoveUnresolved().
|
| DCHECK(!already_resolved());
|
| - VariableProxy* proxy = factory->NewVariableProxy(name, false, position);
|
| + VariableProxy* proxy =
|
| + factory->NewVariableProxy(name, variable_kind, position);
|
| unresolved_.Add(proxy, zone_);
|
| return proxy;
|
| }
|
| @@ -327,7 +328,15 @@ class Scope: public ZoneObject {
|
| LanguageMode language_mode() const { return language_mode_; }
|
|
|
| // The variable corresponding to the 'this' value.
|
| - Variable* receiver() { return receiver_; }
|
| + Variable* receiver() {
|
| + DCHECK(has_this_declaration());
|
| + DCHECK_NOT_NULL(receiver_);
|
| + return receiver_;
|
| + }
|
| +
|
| + bool has_this_declaration() const {
|
| + return !is_arrow_scope() && is_declaration_scope();
|
| + }
|
|
|
| // The variable corresponding to the 'new.target' value.
|
| Variable* new_target_var() { return new_target_; }
|
| @@ -662,6 +671,8 @@ class Scope: public ZoneObject {
|
| void AllocateNonParameterLocals(Isolate* isolate);
|
| void AllocateVariablesRecursively(Isolate* isolate);
|
| void AllocateModulesRecursively(Scope* host_scope);
|
| + void AllocateParameter(Variable* var, int index);
|
| + void AllocateReceiver();
|
|
|
| // Resolve and fill in the allocation information for all variables
|
| // in this scopes. Must be called *after* all scopes have been
|
|
|