From af77d96453e20be1db0587bc690f388df4bfeb33 Mon Sep 17 00:00:00 2001 From: Leo Balter Date: Mon, 26 Nov 2018 19:15:58 -0500 Subject: [PATCH] Add memberexpression and call expression forms to access private names --- src/class-elements/private-methods/cls-decl.template | 1 + src/class-elements/private-methods/cls-expr.template | 1 + 2 files changed, 2 insertions(+) diff --git a/src/class-elements/private-methods/cls-decl.template b/src/class-elements/private-methods/cls-decl.template index 8ef950e3cd..3bc828c84c 100644 --- a/src/class-elements/private-methods/cls-decl.template +++ b/src/class-elements/private-methods/cls-decl.template @@ -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 }*/ } diff --git a/src/class-elements/private-methods/cls-expr.template b/src/class-elements/private-methods/cls-expr.template index dd301c9065..564e50acb3 100644 --- a/src/class-elements/private-methods/cls-expr.template +++ b/src/class-elements/private-methods/cls-expr.template @@ -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 }*/ }