Revert "Revert "Upgrade to 5.0.71.48"" DO NOT MERGE
This reverts commit f2e3994fa5148cc3d9946666f0b0596290192b0e,
and updates the x64 makefile properly so it doesn't break that
build.
FPIIM-449
Change-Id: Ib83e35bfbae6af627451c926a9650ec57c045605
(cherry picked from commit 109988c7ccb6f3fd1a58574fa3dfb88beaef6632)
diff --git a/src/ast/scopes.h b/src/ast/scopes.h
index 6c261f6..76f761d 100644
--- a/src/ast/scopes.h
+++ b/src/ast/scopes.h
@@ -24,8 +24,7 @@
Variable* Declare(Scope* scope, const AstRawString* name, VariableMode mode,
Variable::Kind kind, InitializationFlag initialization_flag,
- MaybeAssignedFlag maybe_assigned_flag = kNotAssigned,
- int declaration_group_start = -1);
+ MaybeAssignedFlag maybe_assigned_flag = kNotAssigned);
Variable* Lookup(const AstRawString* name);
@@ -163,8 +162,7 @@
// declared before, the previously declared variable is returned.
Variable* DeclareLocal(const AstRawString* name, VariableMode mode,
InitializationFlag init_flag, Variable::Kind kind,
- MaybeAssignedFlag maybe_assigned_flag = kNotAssigned,
- int declaration_group_start = -1);
+ MaybeAssignedFlag maybe_assigned_flag = kNotAssigned);
// Declare an implicit global variable in this scope which must be a
// script scope. The variable was introduced (possibly from an inner
@@ -377,12 +375,6 @@
IsClassConstructor(function_kind())));
}
- const Scope* NearestOuterEvalScope() const {
- if (is_eval_scope()) return this;
- if (outer_scope() == nullptr) return nullptr;
- return outer_scope()->NearestOuterEvalScope();
- }
-
// ---------------------------------------------------------------------------
// Accessors.
@@ -428,7 +420,24 @@
// Returns the default function arity excluding default or rest parameters.
int default_function_length() const { return arity_; }
- int num_parameters() const { return params_.length(); }
+ // Returns the number of formal parameters, up to but not including the
+ // rest parameter index (if the function has rest parameters), i.e. it
+ // says 2 for
+ //
+ // function foo(a, b) { ... }
+ //
+ // and
+ //
+ // function foo(a, b, ...c) { ... }
+ //
+ // but for
+ //
+ // function foo(a, b, c = 1) { ... }
+ //
+ // we return 3 here.
+ int num_parameters() const {
+ return has_rest_parameter() ? params_.length() - 1 : params_.length();
+ }
// A function can have at most one rest parameter. Returns Variable* or NULL.
Variable* rest_parameter(int* index) const {
@@ -486,25 +495,15 @@
// The ModuleDescriptor for this scope; only for module scopes.
ModuleDescriptor* module() const { return module_descriptor_; }
-
- void set_class_declaration_group_start(int position) {
- class_declaration_group_start_ = position;
- }
-
- int class_declaration_group_start() const {
- return class_declaration_group_start_;
- }
-
// ---------------------------------------------------------------------------
// Variable allocation.
// Collect stack and context allocated local variables in this scope. Note
// that the function variable - if present - is not collected and should be
// handled separately.
- void CollectStackAndContextLocals(
- ZoneList<Variable*>* stack_locals, ZoneList<Variable*>* context_locals,
- ZoneList<Variable*>* context_globals,
- ZoneList<Variable*>* strong_mode_free_variables = nullptr);
+ void CollectStackAndContextLocals(ZoneList<Variable*>* stack_locals,
+ ZoneList<Variable*>* context_locals,
+ ZoneList<Variable*>* context_globals);
// Current number of var or const locals.
int num_var_or_const() { return num_var_or_const_; }
@@ -767,12 +766,6 @@
MUST_USE_RESULT
bool ResolveVariablesRecursively(ParseInfo* info, AstNodeFactory* factory);
- bool CheckStrongModeDeclaration(VariableProxy* proxy, Variable* var);
-
- // If this scope is a method scope of a class, return the corresponding
- // class variable, otherwise nullptr.
- ClassVariable* ClassVariableForMethod() const;
-
// Scope analysis.
void PropagateScopeInfo(bool outer_scope_calls_sloppy_eval);
bool HasTrivialContext() const;
@@ -837,10 +830,6 @@
Zone* zone_;
PendingCompilationErrorHandler pending_error_handler_;
-
- // For tracking which classes are declared consecutively. Needed for strong
- // mode.
- int class_declaration_group_start_;
};
} // namespace internal