diff options
author | wolfbeast <mcwerewolf@gmail.com> | 2018-03-20 10:08:54 +0100 |
---|---|---|
committer | wolfbeast <mcwerewolf@gmail.com> | 2018-03-20 10:10:12 +0100 |
commit | 893a886ea38853a1a3e97bcf135ea3cb616cd69a (patch) | |
tree | 5188f8895ce513381917d37115b50f72fb4e64a9 /js/src/tests/ecma_6/Class | |
parent | 7197b308fb97cd8ab7a972df6a3a17a7a265b594 (diff) | |
parent | 6085bfdcecc2529c1037f813e70583c2a776677d (diff) | |
download | UXP-893a886ea38853a1a3e97bcf135ea3cb616cd69a.tar UXP-893a886ea38853a1a3e97bcf135ea3cb616cd69a.tar.gz UXP-893a886ea38853a1a3e97bcf135ea3cb616cd69a.tar.lz UXP-893a886ea38853a1a3e97bcf135ea3cb616cd69a.tar.xz UXP-893a886ea38853a1a3e97bcf135ea3cb616cd69a.zip |
Add support for the function `name` property.
This resolves #78.
Merged remote-tracking branch 'janek/js_function_name_1'
Diffstat (limited to 'js/src/tests/ecma_6/Class')
-rw-r--r-- | js/src/tests/ecma_6/Class/className.js | 20 |
1 files changed, 11 insertions, 9 deletions
diff --git a/js/src/tests/ecma_6/Class/className.js b/js/src/tests/ecma_6/Class/className.js index a33397a8a..ad3920c15 100644 --- a/js/src/tests/ecma_6/Class/className.js +++ b/js/src/tests/ecma_6/Class/className.js @@ -174,27 +174,29 @@ testName(ExtendedExpr3, "base", false, false, false); // Anonymous class expressions don't get name properties unless specified in a // static manner. -let Anon = class { +// Use property assignment to avoid setting name property. +let tmp = {}; +let Anon = tmp.value = class { constructor() {} }; testName(Anon, "", false, false, false); -let AnonDefault = class { }; +let AnonDefault = tmp.value = class { }; testName(AnonDefault, "", false, false, false); -let AnonWithGetter = class { +let AnonWithGetter = tmp.value = class { constructor() {} static get name() { return "base"; } }; testName(AnonWithGetter, "base", false, true, false); -let AnonWithSetter = class { +let AnonWithSetter = tmp.value = class { constructor() {} static set name(v) {} }; testName(AnonWithSetter, undefined, false, false, true); -let AnonWithGetterSetter = class { +let AnonWithGetterSetter = tmp.value = class { constructor() {} static get name() { return "base"; } static set name(v) {} @@ -202,15 +204,15 @@ let AnonWithGetterSetter = class { testName(AnonWithGetterSetter, "base", false, true, true); -let ExtendedAnon1 = class extends Anon { +let ExtendedAnon1 = tmp.value = class extends Anon { constructor() {} }; testName(ExtendedAnon1, "", false, false, false); -let ExtendedAnonDefault = class extends Anon { }; +let ExtendedAnonDefault = tmp.value = class extends Anon { }; testName(ExtendedAnonDefault, "", false, false, false); -let ExtendedAnon2 = class extends AnonWithGetterSetter { +let ExtendedAnon2 = tmp.value = class extends AnonWithGetterSetter { constructor() {} static get name() { return "extend"; } }; @@ -218,7 +220,7 @@ testName(ExtendedAnon2, "extend", false, true, false); delete ExtendedAnon2.name; testName(ExtendedAnon2, "base", false, false, false); -let ExtendedAnon3 = class extends AnonWithGetterSetter { +let ExtendedAnon3 = tmp.value = class extends AnonWithGetterSetter { constructor() {} static set name(v) {} }; |