Add memberexpression and call expression forms to access private names

This commit is contained in:
Leo Balter 2018-11-26 19:15:58 -05:00 committed by Rick Waldron
parent 7be4e99f80
commit af77d96453
2 changed files with 2 additions and 0 deletions

View File

@ -90,6 +90,7 @@ class C {
hasProp(this, '#m', false, 'private methods are defined in an special internal slot and cannot be found as own properties');
assert.sameValue(typeof this.#m, 'function');
assert.sameValue(this.ref, this.#m, 'returns the same value');
assert.sameValue(this.#m, (() => this)().#m, 'memberexpression and call expression forms');
/*{ constructor }*/
}

View File

@ -91,6 +91,7 @@ var C = class {
hasProp(this, '#m', false, 'private methods are defined in an special internal slot and cannot be found as own properties');
assert.sameValue(typeof this.#m, 'function');
assert.sameValue(this.ref, this.#m, 'returns the same value');
assert.sameValue(this.#m, (() => this)().#m, 'memberexpression and call expression forms');
/*{ constructor }*/
}