OLD | NEW |
1 // Copyright 2015 the V8 project authors. All rights reserved. | 1 // Copyright 2015 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef V8_PARSING_PARAMETER_EXPRESSION_REWRITER_H_ | 5 #ifndef V8_PARSING_PARAMETER_EXPRESSION_REWRITER_H_ |
6 #define V8_PARSING_PARAMETER_EXPRESSION_REWRITER_H_ | 6 #define V8_PARSING_PARAMETER_EXPRESSION_REWRITER_H_ |
7 | 7 |
8 #include "src/ast/ast.h" | 8 #include "src/ast/ast.h" |
9 | 9 |
10 namespace v8 { | 10 namespace v8 { |
11 namespace internal { | 11 namespace internal { |
12 | 12 |
13 // When an extra declaration scope needs to be inserted to account for | 13 // When an extra declaration scope needs to be inserted to account for |
14 // a sloppy eval in a default parameter or function body, the expressions | 14 // a sloppy eval in a default parameter or function body, the expressions |
15 // needs to be in that new inner scope which was added after initial | 15 // needs to be in that new inner scope which was added after initial |
16 // parsing. | 16 // parsing. |
17 // | 17 // |
18 // param_scope is the new inner scope, and its outer_scope() is assumed | 18 // param_scope is the new inner scope, and its outer_scope() is assumed |
19 // to be the function scope which was used during the initial parse. | 19 // to be the function scope which was used during the initial parse. |
20 void ReparentParameterExpressionScope(uintptr_t stack_limit, Expression* expr, | 20 void ReparentParameterExpressionScope(uintptr_t stack_limit, Expression* expr, |
21 Scope* param_scope); | 21 Scope* old_scope, Scope* param_scope); |
22 | 22 |
23 } // namespace internal | 23 } // namespace internal |
24 } // namespace v8 | 24 } // namespace v8 |
25 | 25 |
26 #endif // V8_PARSING_PARAMETER_EXPRESSION_REWRITER_H_ | 26 #endif // V8_PARSING_PARAMETER_EXPRESSION_REWRITER_H_ |
OLD | NEW |