Chromium Code Reviews| Index: compiler/lib/implementation/bool.js |
| =================================================================== |
| --- compiler/lib/implementation/bool.js (revision 400) |
| +++ compiler/lib/implementation/bool.js (working copy) |
| @@ -2,19 +2,14 @@ |
| // for details. All rights reserved. Use of this source code is governed by a |
| // BSD-style license that can be found in the LICENSE file. |
| - |
| - |
| function native_BoolImplementation_EQ(other) { |
|
floitsch
2011/10/14 20:20:44
maybe for another CL, but ideally we should never
John Lenz
2011/10/14 21:26:40
yes. I leave that for another CL. After we have go
|
| - if (typeof other == 'boolean') { |
| - return this == other; |
| - } else if (other instanceof Boolean) { |
| - // Must convert other to a primitive for value equality to work |
| - return this == Boolean(other); |
| - } else { |
| - return false; |
| - } |
| + return typeof other == 'boolean' && this == other; |
| } |
| function native_BoolImplementation_toString() { |
|
floitsch
2011/10/14 20:20:44
Same is true here. Since we already need to interc
John Lenz
2011/10/14 21:26:40
true, there is less need for this to be special ca
|
| - return (this == true) ? "true" : "false"; |
| + return this.toString(); |
| } |
| + |
| +function native_BoolImplementation_toBool() { |
| + return this == true; |
| +} |