OLD | NEW |
1 // Copyright 2006-2009 the V8 project authors. All rights reserved. | 1 // Copyright 2006-2009 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_FUNC_NAME_INFERRER_H_ | 5 #ifndef V8_PARSING_FUNC_NAME_INFERRER_H_ |
6 #define V8_PARSING_FUNC_NAME_INFERRER_H_ | 6 #define V8_PARSING_FUNC_NAME_INFERRER_H_ |
7 | 7 |
8 #include "src/handles.h" | 8 #include "src/handles.h" |
9 #include "src/zone.h" | 9 #include "src/zone.h" |
10 | 10 |
11 namespace v8 { | 11 namespace v8 { |
12 namespace internal { | 12 namespace internal { |
13 | 13 |
14 class AstRawString; | 14 class AstRawString; |
15 class AstString; | 15 class AstString; |
16 class AstValueFactory; | 16 class AstValueFactory; |
17 class FunctionLiteral; | 17 class FunctionLiteral; |
18 | 18 |
19 enum class InferName { Yes, No }; | 19 enum class InferName { kYes, kNo }; |
20 | 20 |
21 // FuncNameInferrer is a stateful class that is used to perform name | 21 // FuncNameInferrer is a stateful class that is used to perform name |
22 // inference for anonymous functions during static analysis of source code. | 22 // inference for anonymous functions during static analysis of source code. |
23 // Inference is performed in cases when an anonymous function is assigned | 23 // Inference is performed in cases when an anonymous function is assigned |
24 // to a variable or a property (see test-func-name-inference.cc for examples.) | 24 // to a variable or a property (see test-func-name-inference.cc for examples.) |
25 // | 25 // |
26 // The basic idea is that during parsing of LHSs of certain expressions | 26 // The basic idea is that during parsing of LHSs of certain expressions |
27 // (assignments, declarations, object literals) we collect name strings, | 27 // (assignments, declarations, object literals) we collect name strings, |
28 // and during parsing of the RHS, a function literal can be collected. After | 28 // and during parsing of the RHS, a function literal can be collected. After |
29 // parsing the RHS we can infer a name for function literals that do not have | 29 // parsing the RHS we can infer a name for function literals that do not have |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 Zone* zone_; | 122 Zone* zone_; |
123 | 123 |
124 DISALLOW_COPY_AND_ASSIGN(FuncNameInferrer); | 124 DISALLOW_COPY_AND_ASSIGN(FuncNameInferrer); |
125 }; | 125 }; |
126 | 126 |
127 | 127 |
128 } // namespace internal | 128 } // namespace internal |
129 } // namespace v8 | 129 } // namespace v8 |
130 | 130 |
131 #endif // V8_PARSING_FUNC_NAME_INFERRER_H_ | 131 #endif // V8_PARSING_FUNC_NAME_INFERRER_H_ |
OLD | NEW |