Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ assert(
"`compareArray(Object.keys(C), [])` returns `true`"
);
assert(
compareArray(Object.getOwnPropertyNames(C), ['1', '2', 'length', 'prototype', 'a', 'c', 'name']),
"`compareArray(Object.getOwnPropertyNames(C), ['1', '2', 'length', 'prototype', 'a', 'c', 'name'])` returns `true`"
compareArray(Object.getOwnPropertyNames(C), ['1', '2', 'length', 'prototype', 'name', 'a', 'c']),
"`compareArray(Object.getOwnPropertyNames(C), ['1', '2', 'length', 'prototype', 'name', 'a', 'c'])` returns `true`"
);
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ assert(
"`compareArray(Object.keys(C), [])` returns `true`"
);
assert(
compareArray(Object.getOwnPropertyNames(C), ['length', 'prototype', 'a', 'b', 'c', 'd', 'name']),
"`compareArray(Object.getOwnPropertyNames(C), ['length', 'prototype', 'a', 'b', 'c', 'd', 'name'])` returns `true`"
compareArray(Object.getOwnPropertyNames(C), ['length', 'prototype', 'name', 'a', 'b', 'c', 'd']),
"`compareArray(Object.getOwnPropertyNames(C), ['length', 'prototype', 'name', 'a', 'b', 'c', 'd'])` returns `true`"
);
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ assert(
"`compareArray(Object.keys(C), [])` returns `true`"
);
assert(
compareArray(Object.getOwnPropertyNames(C), ['length', 'prototype', 'a', 'c', 'name']),
"`compareArray(Object.getOwnPropertyNames(C), ['length', 'prototype', 'a', 'c', 'name'])` returns `true`"
compareArray(Object.getOwnPropertyNames(C), ['length', 'prototype', 'name', 'a', 'c']),
"`compareArray(Object.getOwnPropertyNames(C), ['length', 'prototype', 'name', 'a', 'c'])` returns `true`"
);
assert(
compareArray(Object.getOwnPropertySymbols(C), [sym1, sym2]),
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2019 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-runtime-semantics-classdefinitionevaluation
description: >
The inferred class-name is present when executing static field initializers of anonymous class expressions.
info: |
14.6.13 Runtime Semantics: ClassDefinitionEvaluation

[...]
17. Perform MakeClassConstructor(F).
18. If className is not undefined, then
a. Perform SetFunctionName(F, className).
[...]

features: [class-static-fields-public]
---*/

var className;

var C = class {
static f = (className = this.name);
}

assert.sameValue(className, "C");
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2019 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-runtime-semantics-classdefinitionevaluation
description: >
The class-name is present when executing static field initializers of class declarations.
info: |
14.6.13 Runtime Semantics: ClassDefinitionEvaluation

[...]
17. Perform MakeClassConstructor(F).
18. If className is not undefined, then
a. Perform SetFunctionName(F, className).
[...]

features: [class-static-fields-public]
---*/

var className;

class C {
static f = (className = this.name);
}

assert.sameValue(className, "C");
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Copyright 2019 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-runtime-semantics-classdefinitionevaluation
description: >
The class-name is present when executing static field initializers of default-exported classes.
info: |
14.6.13 Runtime Semantics: ClassDefinitionEvaluation

[...]
17. Perform MakeClassConstructor(F).
18. If className is not undefined, then
a. Perform SetFunctionName(F, className).
[...]

flags: [module]
features: [class-static-fields-public]
---*/

var className;

export default class {
static f = (className = this.name);
}

assert.sameValue(className, "default");
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
// Copyright 2019 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.

/*---
esid: sec-runtime-semantics-classdefinitionevaluation
description: >
The class-name is present when executing static field initializers of named class expressions.
info: |
14.6.13 Runtime Semantics: ClassDefinitionEvaluation

[...]
17. Perform MakeClassConstructor(F).
18. If className is not undefined, then
a. Perform SetFunctionName(F, className).
[...]

features: [class-static-fields-public]
---*/

var className;

var expr = class C {
static f = (className = this.name);
}

assert.sameValue(className, "C");