| // Copyright (C) 2018 Leo Balter. All rights reserved. | |
| // This code is governed by the BSD license found in the LICENSE file. | |
| /*--- | |
| desc: Private Method | |
| template: private-methods | |
| ---*/ | |
| //- element | |
| #m() { return 42; } | |
| //- constructor | |
| assert.sameValue(this.#m(), 42, 'already defined in the ctor'); | |
| assert.sameValue(this.#m.name, '#m', 'function name inside constructor'); | |
| //- assertions | |
| // gets the returned value from #m | |
| assert.sameValue(c.ref(), 42, 'function return'); | |
| assert.sameValue(c.ref.name, '#m', 'function name is preserved external reference'); |