Closed Bug 1820951 Opened 2 years ago Closed 1 year ago

Revisit DevToolsUtils.hasSafeGetter condition

Categories

(DevTools :: General, task)

task

Tracking

(firefox115 fixed)

RESOLVED FIXED
115 Branch
Tracking Status
firefox115 --- fixed

People

(Reporter: arai, Assigned: arai)

References

Details

Attachments

(2 files)

DevToolsUtils.hasSafeGetter seems to assume that the getter with native function is "safe"

https://searchfox.org/mozilla-central/rev/3002762e41363de8ee9ca80196d55e79651bcb6b/devtools/shared/DevToolsUtils.js#269-277,282

/**
 * Determines if a descriptor has a getter which doesn't call into JavaScript.
 *
 * @param Object desc
 *        The descriptor to check for a safe getter.
 * @return Boolean
 *         Whether a safe getter was found.
 */
exports.hasSafeGetter = function(desc) {
...
  return fn?.callable && fn?.class == "Function" && fn?.script === undefined;

bug 1806598 changed the other place not to assume native getter is safe,
and also bug 1805288 is going to change XPCOMUtils.defineLazyGetter to use native function.

DevToolsUtils.hasSafeGetter should be updated to follow the changes.

Depends on: 1826696
Depends on: 1827310

Thanks a lot for taking care of this
It makes a lot of sense to share the same pattern between eager evaluation and "safe getters" in object preview

Assignee: nobody → arai.unmht
Attachment #9327862 - Attachment description: WIP: Bug 1820951 - Implement DevToolsUtils.hasSafeGetter based on explicit allowlist and DebuggerObject.prototype.isNativeGetterWithJitInfo. r?nchevobbe! → Bug 1820951 - Implement DevToolsUtils.hasSafeGetter based on explicit allowlist and DebuggerObject.prototype.isNativeGetterWithJitInfo. r?nchevobbe!
Status: NEW → ASSIGNED
Attachment #9327862 - Attachment description: Bug 1820951 - Implement DevToolsUtils.hasSafeGetter based on explicit allowlist and DebuggerObject.prototype.isNativeGetterWithJitInfo. r?nchevobbe! → Bug 1820951 - Part 1: Implement DevToolsUtils.hasSafeGetter based on explicit allowlist and DebuggerObject.prototype.isNativeGetterWithJitInfo. r?nchevobbe!

Depends on D175093

Pushed by arai_a@mac.com: https://hg.mozilla.org/integration/autoland/rev/f86da5e77878 Part 1: Implement DevToolsUtils.hasSafeGetter based on explicit allowlist and DebuggerObject.prototype.isNativeGetterWithJitInfo. r=nchevobbe,devtools-reviewers https://hg.mozilla.org/integration/autoland/rev/cb3f2eb3e0db Part 2: Add tests. r=nchevobbe,devtools-reviewers
Regressions: 1832766
Status: ASSIGNED → RESOLVED
Closed: 1 year ago
Resolution: --- → FIXED
Target Milestone: --- → 115 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: