1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
const assert = require('assert'); exports.MyType = class { static foo(y) { assert.equal(y, 'x'); return y + 'y'; } constructor(x) { assert.equal(x, 2); this._a = 1; } bar(x) { assert.equal(x, true); return 3.2; } get a() { return this._a; } set a(v) { this._a = v; } };