47 bytes, text/x-phabricator-request
|Details | Review|
When provided an input containing "unsafe" getters (i.e. which execution might have side-effects), jsPropertyProvider doesn't return anything. We could make it a bit smarter and: - return that it encountered an unsafe getter, and its name, so we can use this information at frontend level. - have a mode that will allow to invoke unsafe getters to retrieve properties of the value returned by such getter. --- This is preliminary work for Bug 1499289
6 months ago
This patch adds two things to JsPropertyProvider: - when provided an input which try to access an unsafe getter properties, the function will indicate that an unsafe getter should be invoked, with its name. - a new boolean argument that when set to true would invoke any unsafe getter that might be in the expression to be completed. For simplicity sake, the function only warns the user of the presence of an unsafe getter when it's the last property of the expression: `object.myGetter.` will return that `myGetter` should be invoked `object.myGetter.a.b.` will not (because then, a and b could also be getters, and it's getting complex to handle both in the function itself as in the UI). Tests are added to ensure this works as expected.
Pushed by email@example.com: https://hg.mozilla.org/integration/autoland/rev/c25f7e0a44fc Add better handling of unsafe getters in JsPropertyProvider; r=bgrins.
You need to log in before you can comment on or make changes to this bug.