Hi!
We are using "@ember-decorators/argument": "0.8.21", and noticed that if we have a default value for an argument annotated with @argument keyword, that property becomes non-enumerable.
We need all own properties to be enumerable to support converting ember object to simple javascript object for storing in localstorage. For this we do Object.keys on an ember object and recursively serialize object to a plain JS object.
So if we do:
/**
* @type {number}
*/
@argument('number')
amount = 0;
we see that this property is not part of Object.keys. If we log this object in chrome console this property is greyed out. If we simply remove default value like this:
/**
* @type {number}
*/
@argument('number')
amount;
all starts to work fine.
Same with optional value, this code also leads to property not being enumerable:
/**
* @type {number}
*/
@argument(optional('number'))
amount = 0;
Hi!
We are using
"@ember-decorators/argument": "0.8.21",and noticed that if we have a default value for an argument annotated with@argumentkeyword, that property becomes non-enumerable.We need all own properties to be enumerable to support converting ember object to simple javascript object for storing in localstorage. For this we do
Object.keyson an ember object and recursively serialize object to a plain JS object.So if we do:
we see that this property is not part of
Object.keys. If we log this object in chrome console this property is greyed out. If we simply remove default value like this:all starts to work fine.
Same with optional value, this code also leads to property not being enumerable: