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

Fix instanceof logic to comply with specification #884

Merged
merged 1 commit into from May 4, 2021

Conversation

lahma
Copy link
Collaborator

@lahma lahma commented May 4, 2021

Added tests cases, went trough logic and aligned with spec. The original test case didn't fail in dev either though...

fixes #874

@lahma lahma marked this pull request as draft May 4, 2021 16:35
@lahma lahma marked this pull request as ready for review May 4, 2021 16:44
@lahma lahma requested a review from sebastienros May 4, 2021 16:52
@@ -566,6 +590,43 @@ internal virtual JsValue DoClone()

internal virtual bool IsCallable => this is ICallable;

/// <summary>
/// https://tc39.es/ecma262/#sec-ordinaryhasinstance
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was wondering such a weird name ... well it's the specs

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed, I had trouble accepting it too 😄

@lahma lahma merged commit d47f552 into sebastienros:dev May 4, 2021
@lahma lahma deleted the fix-instanceof branch May 4, 2021 17:15
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

Successfully merging this pull request may close these issues.

"instanceof" operator doesn't work according to the latest spec
2 participants