Commit c8561b1a authored by Joyee Cheung's avatar Joyee Cheung Committed by Commit Bot

[parser] add source posisionts to private field synthetic variables

Bug: v8:8354
Change-Id: I20bb169695d7ecca739f14f9a3ddfafed0dcb964
Reviewed-on: https://chromium-review.googlesource.com/c/1393284Reviewed-by: 's avatarSathya Gunasekaran <gsathya@chromium.org>
Commit-Queue: Joyee Cheung <joyee@igalia.com>
Cr-Commit-Position: refs/heads/master@{#58652}
parent 41a64967
......@@ -3038,6 +3038,7 @@ void Parser::DeclareClassField(ClassLiteralProperty* property,
class_info->properties->Add(property, zone());
} else if (is_private) {
Variable* private_name_var = CreateSyntheticContextVariable(property_name);
private_name_var->set_initializer_position(property->value()->position());
property->set_private_name_var(private_name_var);
class_info->properties->Add(property, zone());
}
......
// Copyright 2019 the V8 project authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
// Flags: --harmony-private-fields
var o = {};
class C {
#a = 0;
[o.#a](){}
}
*%(basename)s:11: TypeError: Read of private field #a from an object which did not contain the field
[o.#a](){}
^
TypeError: Read of private field #a from an object which did not contain the field
at *%(basename)s:11:8
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