-
Notifications
You must be signed in to change notification settings - Fork 52
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
Error on <non-js-value> == <js-value> #395
Comments
Oh, I did some work overwriting the equal operator for JS:Object. I overwrote the == operator so # Support self == true instead of self == JS:True
alias_method :orig_eq, :==
def ==(other)
if other.equal? true
return orig_eq(JS::True)
elsif other.equal? false
return orig_eq(JS::False)
elsif other.equal? nil
return orig_eq(JS::Null) || orig_eq(JS::Undefined)
end
orig_eq(other)
end |
Oh thank you. |
kateinoigakukun
added a commit
that referenced
this issue
Mar 16, 2024
kateinoigakukun
added a commit
that referenced
this issue
Mar 16, 2024
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Code:
Result:
Hmmm the equal operator causing errors is so inconvenient and unpredictable.
Can you return the value or at least improve it to a clear error message?
The text was updated successfully, but these errors were encountered: