Skip to content
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

Property values on platform objects are misreported as "forbidden" #176

Open
mootari opened this issue Oct 7, 2021 · 2 comments
Open

Property values on platform objects are misreported as "forbidden" #176

mootari opened this issue Oct 7, 2021 · 2 comments

Comments

@mootari
Copy link
Member

mootari commented Oct 7, 2021

When walking an object, valueof attempts to access properties on the object's prototype:

inspector/src/object.js

Lines 18 to 26 in fe14a1b

export function valueof(object, key) {
try {
const value = object[key];
if (value) value.constructor; // Test for SecurityError.
return value;
} catch (ignore) {
return FORBIDDEN;
}
}

Due to implementation details for getters on platform objects this throws TypeError: Illegal invocation, which then gets caught and misinterpreted as SecurityError. As a result the property value is rendered as [forbidden].

To reproduce:

  1. Create a cell that returns a native object (e.g. screen, performance)
  2. Expand the object

@mootari
Copy link
Member Author

mootari commented Dec 31, 2021

@jleedev
Copy link

jleedev commented Jan 25, 2023

Proof of concept illustrating two parts of a potential fix:

  • Change the proto argument from a boolean to track the root object we are inspecting, and invoke getters with descriptor.get.apply
  • Show the getter name in an italic font

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants