Fix duplicate definition error in private class methods (#9453)

This commit is contained in:
gverni
2019-02-04 15:19:04 +00:00
committed by Brian Ng
parent d37c958637
commit 65cbbc1ef8
3 changed files with 31 additions and 4 deletions

View File

@@ -0,0 +1,17 @@
class Foo {
#privateMethodA() {
const i = 40;
return i;
}
#privateMethodB() {
const i = 2;
return i;
}
publicMethod() {
return this.#privateMethodA() + this.#privateMethodB();
}
}
expect((new Foo).publicMethod()).toEqual(42);