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 { ...@@ -171,10 +171,9 @@ class PreParserExpression {
IsUseAsmField::encode(true)); IsUseAsmField::encode(true));
} }
static PreParserExpression This(VariableZoneThreadedListType* variables) { static PreParserExpression This() {
return PreParserExpression(TypeField::encode(kExpression) | return PreParserExpression(TypeField::encode(kExpression) |
ExpressionTypeField::encode(kThisExpression), ExpressionTypeField::encode(kThisExpression));
variables);
} }
static PreParserExpression ThisPropertyWithPrivateFieldKey() { static PreParserExpression ThisPropertyWithPrivateFieldKey() {
...@@ -1612,17 +1611,12 @@ class PreParser : public ParserBase<PreParser> { ...@@ -1612,17 +1611,12 @@ class PreParser : public ParserBase<PreParser> {
} }
V8_INLINE PreParserExpression ThisExpression(int pos = kNoSourcePosition) { V8_INLINE PreParserExpression ThisExpression(int pos = kNoSourcePosition) {
PreParserExpression::VariableZoneThreadedListType* variables = nullptr;
if (track_unresolved_variables_) { if (track_unresolved_variables_) {
VariableProxy* proxy = scope()->NewUnresolved( scope()->NewUnresolved(factory()->ast_node_factory(),
factory()->ast_node_factory(), ast_value_factory()->this_string(), ast_value_factory()->this_string(), pos,
pos, THIS_VARIABLE); THIS_VARIABLE);
variables =
new (zone()) PreParserExpression::VariableZoneThreadedListType();
variables->Add(proxy);
} }
return PreParserExpression::This(variables); return PreParserExpression::This();
} }
V8_INLINE PreParserExpression NewSuperPropertyReference(int pos) { 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