Open bcowgill opened 9 years ago
Consider this constructor:
'Thing': klass( function (name, fixed) { Object.defineProperty(this, 'CONST', { value: fixed, writable: false, enumerable: false, configurable: false }); this.gname = name; }).methods({ 'instMethod': function (param) { return this.CONST + ' ' + this.gname + ' ' + param; } }),
Would be cool if you could .constants({ 'CONST': fixed })
Either within the constructor ( to set the constant differently per instance ) or in the same place as the .methods() call to set constant values across all instances.
this would be tough to implement since all values in JavaScript are not typed. :/
Consider this constructor:
'Thing': klass( function (name, fixed) { Object.defineProperty(this, 'CONST', { value: fixed, writable: false, enumerable: false, configurable: false }); this.gname = name; }).methods({ 'instMethod': function (param) { return this.CONST + ' ' + this.gname + ' ' + param; } }),
Would be cool if you could .constants({ 'CONST': fixed })
Either within the constructor ( to set the constant differently per instance ) or in the same place as the .methods() call to set constant values across all instances.