Add # to the private name in "write-only" errors (#12713)
This commit is contained in:
parent
0138553403
commit
3d69dc9471
@ -228,7 +228,7 @@ const privateNameHandlerSpec = {
|
||||
if (!getId && setId) {
|
||||
if (file.availableHelper("writeOnlyError")) {
|
||||
return t.callExpression(file.addHelper("writeOnlyError"), [
|
||||
t.stringLiteral(name),
|
||||
t.stringLiteral(`#${name}`),
|
||||
]);
|
||||
}
|
||||
console.warn(
|
||||
|
||||
@ -14,7 +14,7 @@ class Cl {
|
||||
value: 0
|
||||
});
|
||||
|
||||
this.publicField = babelHelpers.writeOnlyError("privateFieldValue");
|
||||
this.publicField = babelHelpers.writeOnlyError("#privateFieldValue");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user