mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1204402 - Fix export-entries.js and module-environment.js to not fail when classes are disabled, r=jorendorff
This commit is contained in:
parent
3f7087fb33
commit
2b70848925
@ -1,3 +1,5 @@
|
||||
load(libdir + "class.js");
|
||||
|
||||
// Test localExportEntries property
|
||||
|
||||
function testArrayContents(actual, expected) {
|
||||
@ -30,9 +32,11 @@ testLocalExportEntries(
|
||||
'export const x = 1;',
|
||||
[{exportName: 'x', moduleRequest: null, importName: null, localName: 'x'}]);
|
||||
|
||||
testLocalExportEntries(
|
||||
'export class foo { constructor() {} };',
|
||||
[{exportName: 'foo', moduleRequest: null, importName: null, localName: 'foo'}]);
|
||||
if (classesEnabled()) {
|
||||
testLocalExportEntries(
|
||||
'export class foo { constructor() {} };',
|
||||
[{exportName: 'foo', moduleRequest: null, importName: null, localName: 'foo'}]);
|
||||
}
|
||||
|
||||
testLocalExportEntries(
|
||||
'export default function f() {};',
|
||||
|
@ -1,3 +1,5 @@
|
||||
load(libdir + "class.js");
|
||||
|
||||
// Test top-level module environment
|
||||
|
||||
function testInitialEnvironment(source, expected) {
|
||||
@ -17,11 +19,14 @@ testInitialEnvironment('let x = 1;', ['x']);
|
||||
testInitialEnvironment("if (true) { let x = 1; }", []);
|
||||
testInitialEnvironment("if (true) { var x = 1; }", ['x']);
|
||||
testInitialEnvironment('function x() {}', ['x']);
|
||||
testInitialEnvironment("class x { constructor() {} }", ['x']);
|
||||
testInitialEnvironment('export var x = 1;', ['x']);
|
||||
testInitialEnvironment('export let x = 1;', ['x']);
|
||||
testInitialEnvironment('export default class x { constructor() {} };', ['x']);
|
||||
testInitialEnvironment('export default function x() {};', ['x']);
|
||||
testInitialEnvironment('export default 1;', ['*default*']);
|
||||
testInitialEnvironment('export default class { constructor() {} };', ['*default*']);
|
||||
testInitialEnvironment('export default function() {};', ['*default*']);
|
||||
|
||||
if (classesEnabled()) {
|
||||
testInitialEnvironment("class x { constructor() {} }", ['x']);
|
||||
testInitialEnvironment('export default class x { constructor() {} };', ['x']);
|
||||
testInitialEnvironment('export default class { constructor() {} };', ['*default*']);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user