Fix value.hasOwnProperty is not a function error#2673
Open
gitKrystan wants to merge 2 commits intoemberjs:mainfrom
Open
Fix value.hasOwnProperty is not a function error#2673gitKrystan wants to merge 2 commits intoemberjs:mainfrom
gitKrystan wants to merge 2 commits intoemberjs:mainfrom
Conversation
I keep running into this when `value` is a proxy
Author
|
should maybe guard against null too, IDK. Don't think I've run into null here yet |
Collaborator
|
This part of code is used to display object information in inspector object side panel. Basically a subset of key/value pairs gets shown for pure objects |
Collaborator
|
I do not see any issues with this. |
Collaborator
|
Should also check when looking at component args |
Author
|
I don't actually have the repo cloned or the time to write a test ATM but this appears to be the minimal repro: |
Collaborator
|
@gitKrystan I do not have access to push something, test('inspect | works with proxy', async function (assert) {
let inspected = new Proxy(
{},
{
get() {
return null;
},
},
);
let obj = inspect(inspected);
assert.deepEqual(obj, '{ }', 'object is in expected shape');
});
test('inspect | works with Object.create null proto', async function (assert) {
let inspected = Object.create(null);
let obj = inspect(inspected);
assert.deepEqual(obj, '{ }', 'object is in expected shape');
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
I keep running into this error when
valueis a proxy. With this change, it works even w/ proxies.TBH I didn't really look at what the point of this code is so IDK if this fix is correct. I just want it to stop borking my debug sessions. 😂
Screenshots