-
-
Notifications
You must be signed in to change notification settings - Fork 894
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
[Fix] avoid sinking into endless loop cause by getPrototypeOf
#458
Conversation
When we traverse the prototype chain of `obj`, as follows ``` var obj = {}; while (obj) { obj = Object.getPrototypeOf(obj); } ``` The method `getPrototypeOf` always return a `prototypeOfObject` that cause the endless loop
I'm not sure what you mean - the language itself prohibits cyclic prototype chains. What code are you running that hits this error? |
The
Under normal conditions, the loop will end when |
Can you provide a regression test that would have failed without your fix? |
Specifically, What browser are you seeing this in? |
Oh, I suddenly realized that |
IE8 |
Could you add a test for this? |
Yes, i see that. I’m looking for an automated test that will prevent this from happening in the future. |
@ambit-tsai would you mind checking "allow edits" on the RHS of this PR? |
ping @ambit-tsai |
Sorry, I can't find "allow edits". Is it because I have deleted the fork repo? |
:-( yes, that would do it; deleting a fork when there's open PRs is an unrecoverable destructive action. |
When we traverse the prototype chain of
obj
, as followsThe method
getPrototypeOf
always return aprototypeOfObject
that cause the endless loop