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

instanceOf: infinite loop #2780

Open
olgierd23 opened this issue Feb 13, 2017 · 5 comments
Open

instanceOf: infinite loop #2780

olgierd23 opened this issue Feb 13, 2017 · 5 comments

Comments

@olgierd23
Copy link

olgierd23 commented Feb 13, 2017

In some (rare) cases function instanceOf may fall into an infinite loop, which - in my case - was possible to eliminate by adding additional conditional break.

while (constructor){
	if (constructor === object) return true;
	if (constructor === constructor.parent) break;       // this line should be added
	constructor = constructor.parent;
}

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@SergioCrisostomo
Copy link
Member

@olgierd23 could you provide a jsFiddle reproducing this?

@olgierd23
Copy link
Author

Unfortunately, I am afraid I could not. It have happened in my system (which is quite big and complicated) some time ago, and I found this issue during debbuging. I fixed it in the above mentiond way and did not make any notes concerning the situation. So now I only know that there was the issue, but can not recover that situation again. :-(

@DimitarChristoff
Copy link
Member

I am not sure how this matters, you wouldn't cause recursion unless your class somehow extends itself...

https://jsfiddle.net/f7qr6zfh/1/

this checks all subclassing examples under mootools and ES6 classes and works correctly.

@stefanklokgieters
Copy link

How actively it MooTools still being maintained/ developed?

@SergioCrisostomo
Copy link
Member

@stefanklokgieters since ES6 landed, much of what MooTools brought to JavaScript is now Native. Afaik MooTools 1.6.x is stable. If we find important bugs we should fix them. By "we" I mean devs and community :)

Discussing this is off-topic here, we had a thread in the Google mailinglist about this.
Feel free to contact me, check the Gitter channel, #IRC or write in the mailing list if you have more questions.

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

4 participants