Commit f4060f25 authored by Toon Verwaest's avatar Toon Verwaest Committed by Commit Bot

[preparser] Drop tracking this as possible declaration

|this| cannot be an ambiguous declaration. Actual declarations are inserted
upon function scope creation, so we can simply parse as reference and it will
resolve correctly.

Change-Id: I3aaa1a2666b4caffbf8524caec7068125e10240b
Reviewed-on: https://chromium-review.googlesource.com/1251162Reviewed-by: 's avatarMarja Hölttä <marja@chromium.org>
Commit-Queue: Toon Verwaest <verwaest@chromium.org>
Cr-Commit-Position: refs/heads/master@{#56283}
parent 989e2e31
......@@ -171,10 +171,9 @@ class PreParserExpression {
IsUseAsmField::encode(true));
}
static PreParserExpression This(VariableZoneThreadedListType* variables) {
static PreParserExpression This() {
return PreParserExpression(TypeField::encode(kExpression) |
ExpressionTypeField::encode(kThisExpression),
variables);
ExpressionTypeField::encode(kThisExpression));
}
static PreParserExpression ThisPropertyWithPrivateFieldKey() {
......@@ -1612,17 +1611,12 @@ class PreParser : public ParserBase<PreParser> {
}
V8_INLINE PreParserExpression ThisExpression(int pos = kNoSourcePosition) {
PreParserExpression::VariableZoneThreadedListType* variables = nullptr;
if (track_unresolved_variables_) {
VariableProxy* proxy = scope()->NewUnresolved(
factory()->ast_node_factory(), ast_value_factory()->this_string(),
pos, THIS_VARIABLE);
variables =
new (zone()) PreParserExpression::VariableZoneThreadedListType();
variables->Add(proxy);
scope()->NewUnresolved(factory()->ast_node_factory(),
ast_value_factory()->this_string(), pos,
THIS_VARIABLE);
}
return PreParserExpression::This(variables);
return PreParserExpression::This();
}
V8_INLINE PreParserExpression NewSuperPropertyReference(int pos) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment