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

native_BoolImplementation_EQ treats Boolean objects in a wrong way #79

Closed
DartBot opened this issue Oct 12, 2011 · 6 comments
Closed

native_BoolImplementation_EQ treats Boolean objects in a wrong way #79

DartBot opened this issue Oct 12, 2011 · 6 comments

Comments

@DartBot
Copy link

@DartBot DartBot commented Oct 12, 2011

This issue was originally filed by v.e.egor...@gmail.com


http://code.google.com/p/dart/source/browse/trunk/dart/compiler/lib/implementation/bool.js#­19

Boolean(new Boolean(true)) === Boolean(new Boolean(false)) === true.

It is not clear whether this code is really needed.

Pointed out by Andrea Giammarchi.

@DartBot
Copy link
Author

@DartBot DartBot commented Oct 12, 2011

This comment was originally written by andrea.giamm...@gmail.com


function EQ(other) {
  return typeof other == "boolean" || other instanceof Boolean ?
    this == other.valueOf() :
    false
  ;
}

@DartBot
Copy link
Author

@DartBot DartBot commented Oct 12, 2011

This comment was originally written by andrea.giamma...@gmail.com


... and that should be called native_BoolImplementation_EQ I guess ...

@DartBot
Copy link
Author

@DartBot DartBot commented Oct 12, 2011

This comment was originally written by drfibonacci@google.com


Set owner to mmendez@google.com.
Added Area-Compiler, Triaged labels.

@floitschG
Copy link
Contributor

@floitschG floitschG commented Oct 12, 2011

We should not need to look at "Boolean". The whole runtime only works with the primitive type.

Furhermore, we might want to shortcut the equality test in EQ$Operator.(http://code.google.com/p/dart/source/browse/trunk/dart/compiler/lib/implementation/core.js)
Currently we only test for numbers, but testing for booleans would avoid creating the wrapper object.

@DartBot
Copy link
Author

@DartBot DartBot commented Oct 13, 2011

This comment was originally written by mmendez@google.com


Set owner to johnle...@google.com.

@DartBot
Copy link
Author

@DartBot DartBot commented Oct 15, 2011

This comment was originally written by johnle...@google.com


r456, I had been meaning clean this up for quite a while.


Added Fixed label.

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants