-
Notifications
You must be signed in to change notification settings - Fork 11.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Prototype is missing #7935
Comments
We made that change due to a reported security issue. During the config merge process, it the user supplied a specific object, they could overwrite I believe there is a workaround through const obj = Object.create(null);
obj.a = true;
// Causes an error
obj.hasOwnProperty('a')
// Works and returns the correct response
Object.prototype.hasOwnProperty.call(obj, 'a') |
@etimberg Unfortunately that is easy in javascript... But I'm not using it, I'm using java... Nevertheless I can do it as you described, even if a bit more complex that what I have done. I'm gonna test it and give you a feedback. Thank you very much !!! |
@etimberg I have implemented your code and it works perfectly (I did't have any doubt about that!). The good thing sounds it's better (in terms of performance) than my workarounds! THANK A LOT! |
Glad it worked @stockiNail 😄 |
Using the CHART.JS from master and probably related to PR #7920, I got the following exception:
I got this issue because I'm using prototypes methods to interact with/on the object.
Going more in details, I discovered I was using only
hasOwnProperty
, as prototype method.As workaround I changed the calls that method to the static one
Object.getOwnPropertyDescriptor
, checking the result equals tonull
.Now I'm testing it but I have another workaround if I see other issues, to use
Object.keys
andindexOf
of the array to check the the key is part of the object or not (I think it's less performances).What do you think about the workarounds? Do you think there is anything better?
The text was updated successfully, but these errors were encountered: