| Index: src/variables.h
|
| diff --git a/src/variables.h b/src/variables.h
|
| index 545c3bd1f5bfae92e9adbe9c013e4dd65f2331fa..8ff38b0fadd655135c0c8ec92a8f36067cf5c576 100644
|
| --- a/src/variables.h
|
| +++ b/src/variables.h
|
| @@ -11,6 +11,13 @@
|
| namespace v8 {
|
| namespace internal {
|
|
|
| +enum ParameterKind {
|
| + NotAParameter = -1,
|
| + NormalParameter,
|
| + RestParameter,
|
| + OptionalParameter
|
| +};
|
| +
|
| // The AST refers to variables via VariableProxies - placeholders for the actual
|
| // variables. Variables themselves are never directly referred to from the AST,
|
| // they are maintained by scopes, and referred to from VariableProxies and Slots
|
| @@ -147,6 +154,24 @@ class Variable: public ZoneObject {
|
| return strong_mode_reference_end_position_;
|
| }
|
|
|
| + inline void set_parameter_kind(ParameterKind kind) {
|
| + // Don't specify ParameterKind multiple times
|
| + DCHECK(kind != NotAParameter && !isParameter());
|
| + parameter_kind_ = kind;
|
| + }
|
| +
|
| + inline const ParameterKind& parameter_kind() const {
|
| + // Only access for function parameters
|
| + DCHECK(isParameter());
|
| + return parameter_kind_;
|
| + }
|
| +
|
| + bool isParameter() const { return parameter_kind_ != NotAParameter; }
|
| + bool isRestParameter() const { return parameter_kind_ == RestParameter; }
|
| + bool isOptionalParameter() const {
|
| + return parameter_kind_ == OptionalParameter;
|
| + }
|
| +
|
| private:
|
| Scope* scope_;
|
| const AstRawString* name_;
|
| @@ -172,6 +197,7 @@ class Variable: public ZoneObject {
|
| bool is_used_;
|
| InitializationFlag initialization_flag_;
|
| MaybeAssignedFlag maybe_assigned_;
|
| + ParameterKind parameter_kind_;
|
| };
|
|
|
|
|
|
|