зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1710516 - [devtools] Add privateIn babel plugin to parser worker. r=bomsy.
Since ergonomic brand check were enabled in Bug 1710510, babel needs support to parse script using this new syntax. A test case is added, and the test was failing without the new plugin. Differential Revision: https://phabricator.services.mozilla.com/D115381
This commit is contained in:
Родитель
1dab329297
Коммит
ae6d72720b
|
@ -2212,7 +2212,7 @@
|
|||
"byName": {},
|
||||
"byBlocks": {},
|
||||
"usedIds": {
|
||||
"0": 0
|
||||
"1": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2233,7 +2233,7 @@
|
|||
"byName": {},
|
||||
"byBlocks": {},
|
||||
"usedIds": {
|
||||
"0": 0
|
||||
"1": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -2254,7 +2254,7 @@
|
|||
"byName": {},
|
||||
"byBlocks": {},
|
||||
"usedIds": {
|
||||
"0": 0
|
||||
"1": 1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -8314,7 +8314,7 @@ const sourceOptions = {
|
|||
generated: {
|
||||
sourceType: "unambiguous",
|
||||
tokens: true,
|
||||
plugins: ["classPrivateProperties", "classPrivateMethods", "classProperties", "objectRestSpread", "optionalChaining", "nullishCoalescingOperator"]
|
||||
plugins: ["classPrivateProperties", "classPrivateMethods", "classProperties", "objectRestSpread", "optionalChaining", "privateIn", "nullishCoalescingOperator"]
|
||||
},
|
||||
original: {
|
||||
sourceType: "unambiguous",
|
||||
|
|
|
@ -27,6 +27,7 @@ const sourceOptions = {
|
|||
"classProperties",
|
||||
"objectRestSpread",
|
||||
"optionalChaining",
|
||||
"privateIn",
|
||||
"nullishCoalescingOperator",
|
||||
],
|
||||
},
|
||||
|
|
|
@ -50,6 +50,18 @@ add_task(async function() {
|
|||
["second", "b"],
|
||||
],
|
||||
},
|
||||
{
|
||||
line: 51,
|
||||
column: 26,
|
||||
expression: "this",
|
||||
fields: [
|
||||
["x", "1"],
|
||||
// TODO: The private properties are not shown in the object preview at the moment,
|
||||
// this should be fixed as part of Bug 1499679.
|
||||
// ["#privateVar", "2"],
|
||||
],
|
||||
},
|
||||
{ line: 51, column: 39, expression: "this.#privateVar", result: 2 },
|
||||
]);
|
||||
});
|
||||
|
||||
|
|
|
@ -48,6 +48,9 @@ function classPreview() {
|
|||
}
|
||||
breakFn() {
|
||||
let i = this.x * this.#privateVar + Foo.#privateStatic;
|
||||
if (#privateVar in this && this.#privateVar !== 0) {
|
||||
i = i * 2;
|
||||
}
|
||||
debugger;
|
||||
}
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче