mirror of https://github.com/tc39/test262.git
@leobalter's comments
This commit is contained in:
parent
5a6bfb0e93
commit
057cd9935d
|
@ -26,17 +26,15 @@ class C {
|
||||||
callCount += 1;
|
callCount += 1;
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
}
|
}
|
||||||
gen() {
|
get gen() { return this.#gen; }
|
||||||
return this.#gen();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const c = new C();
|
const c = new C();
|
||||||
|
|
||||||
// Test the private fields do not appear as properties before set to value
|
// Test the private fields do not appear as properties before set to value
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, "test 1");
|
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, "test 2");
|
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, "test 3");
|
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")');
|
||||||
|
|
||||||
var iter = c.gen();
|
var iter = c.gen();
|
||||||
|
|
||||||
|
@ -45,6 +43,6 @@ var iter = c.gen();
|
||||||
assert.sameValue(callCount, 1);
|
assert.sameValue(callCount, 1);
|
||||||
|
|
||||||
// Test the private fields do not appear as properties after set to value
|
// Test the private fields do not appear as properties after set to value
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, "test 1");
|
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, "test 2");
|
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, "test 3");
|
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")');
|
||||||
|
|
|
@ -16,7 +16,7 @@ info: |
|
||||||
|
|
||||||
AsyncGeneratorMethod :
|
AsyncGeneratorMethod :
|
||||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||||
features: [async-iteration, class-methods-private]
|
features: [async-iteration, class-static-methods-private]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
|
@ -26,15 +26,12 @@ class C {
|
||||||
callCount += 1;
|
callCount += 1;
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
}
|
}
|
||||||
static gen() {
|
static get gen() { return this.#gen; }
|
||||||
return C.#gen();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test the private fields do not appear as properties before set to value
|
// Test the private fields do not appear as properties before set to value
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, "test 1");
|
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, "test 2");
|
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, "test 3");
|
|
||||||
|
|
||||||
var iter = C.gen();
|
var iter = C.gen();
|
||||||
|
|
||||||
|
@ -43,6 +40,5 @@ var iter = C.gen();
|
||||||
assert.sameValue(callCount, 1);
|
assert.sameValue(callCount, 1);
|
||||||
|
|
||||||
// Test the private fields do not appear as properties after set to value
|
// Test the private fields do not appear as properties after set to value
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, "test 1");
|
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, "test 2");
|
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, "test 3");
|
|
||||||
|
|
|
@ -26,17 +26,15 @@ var C = class {
|
||||||
callCount += 1;
|
callCount += 1;
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
}
|
}
|
||||||
gen() {
|
get gen() { return this.#gen; }
|
||||||
return this.#gen();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const c = new C();
|
const c = new C();
|
||||||
|
|
||||||
// Test the private fields do not appear as properties before set to value
|
// Test the private fields do not appear as properties before set to value
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, "test 1");
|
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, "test 2");
|
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, "test 3");
|
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")');
|
||||||
|
|
||||||
var iter = c.gen();
|
var iter = c.gen();
|
||||||
|
|
||||||
|
@ -45,6 +43,6 @@ var iter = c.gen();
|
||||||
assert.sameValue(callCount, 1);
|
assert.sameValue(callCount, 1);
|
||||||
|
|
||||||
// Test the private fields do not appear as properties after set to value
|
// Test the private fields do not appear as properties after set to value
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, "test 1");
|
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, "test 2");
|
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, "test 3");
|
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")');
|
||||||
|
|
|
@ -16,7 +16,7 @@ info: |
|
||||||
|
|
||||||
AsyncGeneratorMethod :
|
AsyncGeneratorMethod :
|
||||||
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
async [no LineTerminator here] * PropertyName ( UniqueFormalParameters ) { AsyncGeneratorBody }
|
||||||
features: [async-iteration, class-methods-private]
|
features: [async-iteration, class-static-methods-private]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
|
@ -26,15 +26,12 @@ var C = class {
|
||||||
callCount += 1;
|
callCount += 1;
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
}
|
}
|
||||||
static gen() {
|
static get gen() { return this.#gen; }
|
||||||
return C.#gen();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test the private fields do not appear as properties before set to value
|
// Test the private fields do not appear as properties before set to value
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, "test 1");
|
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, "test 2");
|
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, "test 3");
|
|
||||||
|
|
||||||
var iter = C.gen();
|
var iter = C.gen();
|
||||||
|
|
||||||
|
@ -43,6 +40,5 @@ var iter = C.gen();
|
||||||
assert.sameValue(callCount, 1);
|
assert.sameValue(callCount, 1);
|
||||||
|
|
||||||
// Test the private fields do not appear as properties after set to value
|
// Test the private fields do not appear as properties after set to value
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, "test 1");
|
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, "test 2");
|
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, "test 3");
|
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
/*---
|
/*---
|
||||||
path: language/statements/class/gen-method-
|
path: language/statements/class/gen-method-
|
||||||
name: Generator private method as a ClassDeclaration element
|
name: Generator private method as a ClassDeclaration element
|
||||||
features: [class-methods-private]
|
|
||||||
esid: prod-GeneratorPrivateMethod
|
esid: prod-GeneratorPrivateMethod
|
||||||
info: |
|
info: |
|
||||||
ClassElement :
|
ClassElement :
|
||||||
|
@ -16,7 +15,7 @@ info: |
|
||||||
|
|
||||||
GeneratorMethod :
|
GeneratorMethod :
|
||||||
* PropertyName ( UniqueFormalParameters ) { GeneratorBody }
|
* PropertyName ( UniqueFormalParameters ) { GeneratorBody }
|
||||||
features: [generators]
|
features: [generators, class-methods-private]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
|
@ -26,17 +25,15 @@ class C {
|
||||||
callCount += 1;
|
callCount += 1;
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
}
|
}
|
||||||
gen() {
|
get gen() { return this.#gen; }
|
||||||
return this.#gen();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const c = new C();
|
const c = new C();
|
||||||
|
|
||||||
// Test the private fields do not appear as properties before set to value
|
// Test the private fields do not appear as properties before set to value
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, "test 1");
|
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, "test 2");
|
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, "test 3");
|
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")');
|
||||||
|
|
||||||
var iter = c.gen();
|
var iter = c.gen();
|
||||||
|
|
||||||
|
@ -45,6 +42,6 @@ var iter = c.gen();
|
||||||
assert.sameValue(callCount, 1);
|
assert.sameValue(callCount, 1);
|
||||||
|
|
||||||
// Test the private fields do not appear as properties after set to value
|
// Test the private fields do not appear as properties after set to value
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, "test 1");
|
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, "test 2");
|
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, "test 3");
|
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")');
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
/*---
|
/*---
|
||||||
path: language/statements/class/gen-private-method-static-
|
path: language/statements/class/gen-private-method-static-
|
||||||
name: Static generator private method as a ClassDeclaration element
|
name: Static generator private method as a ClassDeclaration element
|
||||||
features: [class-methods-private]
|
|
||||||
esid: prod-GeneratorPrivateMethod
|
esid: prod-GeneratorPrivateMethod
|
||||||
info: |
|
info: |
|
||||||
ClassElement :
|
ClassElement :
|
||||||
|
@ -16,33 +15,29 @@ info: |
|
||||||
|
|
||||||
GeneratorMethod :
|
GeneratorMethod :
|
||||||
* PropertyName ( UniqueFormalParameters ) { GeneratorBody }
|
* PropertyName ( UniqueFormalParameters ) { GeneratorBody }
|
||||||
features: [generators]
|
features: [generators, class-static-methods-private]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
|
|
||||||
class C {
|
class C {
|
||||||
static #*gen() {
|
static *#gen() {
|
||||||
callCount += 1;
|
callCount += 1;
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
}
|
}
|
||||||
static gen() {
|
static get gen() { return this.#gen; }
|
||||||
return C.gen();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var gen = C.gen;
|
|
||||||
|
|
||||||
// Test the private fields do not appear as properties before set to value
|
// Test the private fields do not appear as properties before set to value
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, "test 1");
|
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, "test 2");
|
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||||
|
|
||||||
var iter = gen();
|
var iter = C.gen();
|
||||||
|
|
||||||
/*{ assertions }*/
|
/*{ assertions }*/
|
||||||
|
|
||||||
assert.sameValue(callCount, 1);
|
assert.sameValue(callCount, 1);
|
||||||
|
|
||||||
// Test the private fields do not appear as properties before set to value
|
// Test the private fields do not appear as properties before set to value
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, "test 1");
|
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, "test 2");
|
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
/*---
|
/*---
|
||||||
path: language/expressions/class/gen-private-method-
|
path: language/expressions/class/gen-private-method-
|
||||||
name: Generator private method as a ClassExpression element
|
name: Generator private method as a ClassExpression element
|
||||||
features: [class-methods-private]
|
|
||||||
esid: prod-GeneratorPrivateMethod
|
esid: prod-GeneratorPrivateMethod
|
||||||
info: |
|
info: |
|
||||||
ClassElement :
|
ClassElement :
|
||||||
|
@ -16,27 +15,25 @@ info: |
|
||||||
|
|
||||||
GeneratorMethod :
|
GeneratorMethod :
|
||||||
* PropertyName ( UniqueFormalParameters ) { GeneratorBody }
|
* PropertyName ( UniqueFormalParameters ) { GeneratorBody }
|
||||||
features: [generators]
|
features: [generators, class-methods-private]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
|
|
||||||
var C = class {
|
var C = class {
|
||||||
*gen() {
|
*#gen() {
|
||||||
callCount += 1;
|
callCount += 1;
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
}
|
}
|
||||||
gen() {
|
get gen() { return this.#gen; }
|
||||||
return this.#gen();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const c = new C();
|
const c = new C();
|
||||||
|
|
||||||
// Test the private fields do not appear as properties before set to value
|
// Test the private fields do not appear as properties before set to value
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, "test 1");
|
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, "test 2");
|
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, "test 3");
|
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")');
|
||||||
|
|
||||||
var iter = c.gen();
|
var iter = c.gen();
|
||||||
|
|
||||||
|
@ -45,6 +42,6 @@ var iter = c.gen();
|
||||||
assert.sameValue(callCount, 1);
|
assert.sameValue(callCount, 1);
|
||||||
|
|
||||||
// Test the private fields do not appear as properties after set to value
|
// Test the private fields do not appear as properties after set to value
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, "test 1");
|
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, "test 2");
|
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, "test 3");
|
assert.sameValue(Object.hasOwnProperty.call(c, "#gen"), false, 'Object.hasOwnProperty.call(c, "#gen")');
|
||||||
|
|
|
@ -3,7 +3,6 @@
|
||||||
/*---
|
/*---
|
||||||
path: language/expressions/class/gen-private-method-static-
|
path: language/expressions/class/gen-private-method-static-
|
||||||
name: Static generator private method as a ClassExpression element
|
name: Static generator private method as a ClassExpression element
|
||||||
features: [class-methods-private]
|
|
||||||
esid: prod-GeneratorPrivateMethod
|
esid: prod-GeneratorPrivateMethod
|
||||||
info: |
|
info: |
|
||||||
ClassElement :
|
ClassElement :
|
||||||
|
@ -16,33 +15,29 @@ info: |
|
||||||
|
|
||||||
GeneratorMethod :
|
GeneratorMethod :
|
||||||
* PropertyName ( UniqueFormalParameters ) { GeneratorBody }
|
* PropertyName ( UniqueFormalParameters ) { GeneratorBody }
|
||||||
features: [generators]
|
features: [generators, class-static-methods-private]
|
||||||
---*/
|
---*/
|
||||||
|
|
||||||
var callCount = 0;
|
var callCount = 0;
|
||||||
|
|
||||||
var C = class {
|
var C = class {
|
||||||
static *gen() {
|
static *#gen() {
|
||||||
callCount += 1;
|
callCount += 1;
|
||||||
/*{ body }*/
|
/*{ body }*/
|
||||||
}
|
}
|
||||||
static gen() {
|
static get gen() { return this.#gen; }
|
||||||
return C.gen();
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
var gen = C.gen;
|
|
||||||
|
|
||||||
// Test the private fields do not appear as properties before set to value
|
// Test the private fields do not appear as properties before set to value
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, "test 1");
|
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, "test 2");
|
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||||
|
|
||||||
var iter = gen();
|
var iter = C.gen();
|
||||||
|
|
||||||
/*{ assertions }*/
|
/*{ assertions }*/
|
||||||
|
|
||||||
assert.sameValue(callCount, 1);
|
assert.sameValue(callCount, 1);
|
||||||
|
|
||||||
// Test the private fields do not appear as properties before set to value
|
// Test the private fields do not appear as properties before set to value
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, "test 1");
|
assert.sameValue(Object.hasOwnProperty.call(C.prototype, "#gen"), false, 'Object.hasOwnProperty.call(C.prototype, "#gen")');
|
||||||
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, "test 2");
|
assert.sameValue(Object.hasOwnProperty.call(C, "#gen"), false, 'Object.hasOwnProperty.call(C, "#gen")');
|
||||||
|
|
Loading…
Reference in New Issue