Index: src/parsing/preparser.h |
diff --git a/src/parsing/preparser.h b/src/parsing/preparser.h |
index e3a4ece78dd9199097876f225e834681d961e0a7..72fa36d18352dc543c6f55efba2d6b62dc9f4d85 100644 |
--- a/src/parsing/preparser.h |
+++ b/src/parsing/preparser.h |
@@ -112,10 +112,12 @@ |
kAsyncIdentifier |
}; |
- explicit PreParserIdentifier(Type type) : type_(type) {} |
+ explicit PreParserIdentifier(Type type) : type_(type), string_(nullptr) {} |
Type type_; |
- |
+ // Only non-nullptr when PreParser.track_unresolved_variables_ is true. |
+ const AstRawString* string_; |
friend class PreParserExpression; |
+ friend class PreParser; |
}; |
@@ -774,7 +776,8 @@ |
ParserRecorder* log, uintptr_t stack_limit) |
: ParserBase<PreParser>(zone, scanner, stack_limit, NULL, |
ast_value_factory, log), |
- use_counts_(nullptr) {} |
+ use_counts_(nullptr), |
+ track_unresolved_variables_(false) {} |
// Pre-parse the program from the character stream; returns true on |
// success (even if parsing failed, the pre-parse data successfully |
@@ -820,10 +823,10 @@ |
// keyword and parameters, and have consumed the initial '{'. |
// At return, unless an error occurred, the scanner is positioned before the |
// the final '}'. |
- PreParseResult PreParseLazyFunction(LanguageMode language_mode, |
- FunctionKind kind, |
- bool has_simple_parameters, |
+ PreParseResult PreParseLazyFunction(FunctionKind kind, |
+ DeclarationScope* function_scope, |
bool parsing_module, ParserRecorder* log, |
+ bool track_unresolved_variables, |
bool may_abort, int* use_counts); |
private: |
@@ -850,9 +853,9 @@ |
const PreParserFormalParameters& parameters, FunctionKind kind, |
FunctionLiteral::FunctionType function_type, bool* ok); |
- V8_INLINE LazyParsingResult |
- SkipLazyFunctionBody(int* materialized_literal_count, |
- int* expected_property_count, bool may_abort, bool* ok) { |
+ V8_INLINE LazyParsingResult SkipLazyFunctionBody( |
+ int* materialized_literal_count, int* expected_property_count, |
+ bool track_unresolved_variables, bool may_abort, bool* ok) { |
UNREACHABLE(); |
return kLazyParsingComplete; |
} |
@@ -1304,11 +1307,9 @@ |
return PreParserExpression::Default(); |
} |
- V8_INLINE PreParserExpression ExpressionFromIdentifier( |
+ PreParserExpression ExpressionFromIdentifier( |
PreParserIdentifier name, int start_position, int end_position, |
- InferName infer = InferName::kYes) { |
- return PreParserExpression::FromIdentifier(name); |
- } |
+ InferName infer = InferName::kYes); |
V8_INLINE PreParserExpression ExpressionFromString(int pos) { |
if (scanner()->UnescapedLiteralMatches("use strict", 10)) { |
@@ -1417,6 +1418,7 @@ |
// Preparser's private field members. |
int* use_counts_; |
+ bool track_unresolved_variables_; |
}; |
PreParserExpression PreParser::SpreadCall(PreParserExpression function, |