mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1146136 - Followup to condition tests using |super| syntax on class syntax being enabled. r=bustage
This commit is contained in:
parent
1c422f205e
commit
4666624678
@ -82,9 +82,26 @@ var repair = {}, demolition = {};
|
||||
Function("var a, b; [(repair.man), b] = [1, 2];")();
|
||||
Function("var a, b; [(demolition['man']) = 'motel', b] = [1, 2];")();
|
||||
Function("var a, b; [(demolition['man' + {}]) = 'motel', b] = [1, 2];")(); // evade constant-folding
|
||||
Function("var a, b; var obj = { x() { [(super.man), b] = [1, 2]; } };")();
|
||||
Function("var a, b; var obj = { x() { [(super[8]) = 'motel', b] = [1, 2]; } };")();
|
||||
Function("var a, b; var obj = { x() { [(super[8 + {}]) = 'motel', b] = [1, 2]; } };")(); // evade constant-folding
|
||||
|
||||
function classesEnabled()
|
||||
{
|
||||
try
|
||||
{
|
||||
new Function("class B { constructor() { } }; class D extends B { constructor() { super(); } }");
|
||||
return true;
|
||||
}
|
||||
catch (e if e instanceof SyntaxError)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
if (classesEnabled())
|
||||
{
|
||||
Function("var a, b; var obj = { x() { [(super.man), b] = [1, 2]; } };")();
|
||||
Function("var a, b; var obj = { x() { [(super[8]) = 'motel', b] = [1, 2]; } };")();
|
||||
Function("var a, b; var obj = { x() { [(super[8 + {}]) = 'motel', b] = [1, 2]; } };")(); // evade constant-folding
|
||||
}
|
||||
|
||||
// In strict mode, assignment to funcall *immediately* triggers ReferenceError
|
||||
// before we can recognize this doesn't even match the destructuring grammar to
|
||||
|
Loading…
Reference in New Issue
Block a user