You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, yea, definitely a useless feature 😀 . I'd be happy to accept a fix; app.settings.hasOwnProperty() should still be there for back compact, but using the .get and helpers probably shouldn't return them since it is quite a useless value. Ultimately it is not surprising this happens, as it is no different from just writing app.settings.hasOwnProperty.
We could also make settings a null prototype object in the 5.0 branch.
Activity
dougwilson commentedon Feb 3, 2022
Hi, yea, definitely a useless feature 😀 . I'd be happy to accept a fix;
app.settings.hasOwnProperty()
should still be there for back compact, but using the.get
and helpers probably shouldn't return them since it is quite a useless value. Ultimately it is not surprising this happens, as it is no different from just writingapp.settings.hasOwnProperty
.We could also make settings a null prototype object in the 5.0 branch.
EvanHahn commentedon Feb 3, 2022
I'll make two changes:
app.disabled
,app.enabled
,app.get
, andapp.set(oneArgument)
ignore inherited properties onapp.settings
.{}
toObject.create(null)
.Does that sound reasonable? If so, I can submit a patch.
dougwilson commentedon Feb 3, 2022
It sounds good, though I don't think you can just ignore any inherited value -- that is how the settings are inherited from parent apps to sub apps.
dougwilson commentedon Feb 3, 2022
Likely good enough to just filter out if it in
Object.prototype
.EvanHahn commentedon Feb 3, 2022
Opened #4803. If that looks good, I'll make a similar PR for 5.0.
Ignore Object.prototype values in settings through app.set/app.get
EvanHahn commentedon Feb 21, 2022
Now that #4803 is merged, I'll plan to make a similar PR for the
5.x
branch.I hope to get to that in the next few days.
EvanHahn commentedon Feb 21, 2022
Opened #4835.
Ignore Object.prototype values in settings through app.set/app.get
2 remaining items