Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(596)

Unified Diff: lib/compiler/implementation/lib/js_helper.dart

Issue 10697068: Change dart2js to follow the new spec on the equality operator. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/builder.dart » ('j') | tests/language/operator5_test.dart » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/compiler/implementation/lib/js_helper.dart
diff --git a/lib/compiler/implementation/lib/js_helper.dart b/lib/compiler/implementation/lib/js_helper.dart
index 4f45b395ec5451d57e4aebb0d1dc37cba7e34c12..42846fb65ba37e0ab112b58a151a02227311373c 100644
--- a/lib/compiler/implementation/lib/js_helper.dart
+++ b/lib/compiler/implementation/lib/js_helper.dart
@@ -171,12 +171,11 @@ tdiv(var a, var b) {
}
eq(var a, var b) {
- if (JS('bool', @"# == null", a)) return JS('bool', @"# == null", b);
+ if (JS('bool', @'# == null', a)) return JS('bool', @'# == null', b);
+ if (JS('bool', @'# == null', b)) return false;
if (JS('bool', @'typeof # === "object"', a)) {
if (JS_HAS_EQUALS(a)) {
return UNINTERCEPTED(a == b);
- } else {
- return JS('bool', @'# === #', a, b);
}
}
// TODO(lrn): is NaN === NaN ? Is -0.0 === 0.0 ?
@@ -184,12 +183,11 @@ eq(var a, var b) {
}
bool eqB(var a, var b) {
- if (JS('bool', @"# == null", a)) return JS('bool', @"# == null", b);
+ if (JS('bool', @'# == null', a)) return JS('bool', @'# == null', b);
+ if (JS('bool', @'# == null', b)) return false;
if (JS('bool', @'typeof # === "object"', a)) {
if (JS_HAS_EQUALS(a)) {
- return UNINTERCEPTED(a == b) === true;
- } else {
- return JS('bool', @'# === #', a, b);
+ return UNINTERCEPTED(a == b) == true;
}
}
// TODO(lrn): is NaN === NaN ? Is -0.0 === 0.0 ?
@@ -200,26 +198,6 @@ eqq(var a, var b) {
return JS('bool', @'# === #', a, b);
}
-eqNull(var a) {
- if (JS('bool', @'# == null', a)) return true;
- if (JS('bool', @'typeof # === "object"', a)) {
- if (JS_HAS_EQUALS(a)) {
- return UNINTERCEPTED(a == null);
- }
- }
- return false;
-}
-
-eqNullB(var a) {
- if (JS('bool', @'# == null', a)) return true;
- if (JS('bool', @'typeof # === "object"', a)) {
- if (JS_HAS_EQUALS(a)) {
- return UNINTERCEPTED(a == null) === true;
- }
- }
- return false;
-}
-
gt$slow(var a, var b) {
if (checkNumbers(a, b)) {
return JS('bool', @'# > #', a, b);
« no previous file with comments | « no previous file | lib/compiler/implementation/ssa/builder.dart » ('j') | tests/language/operator5_test.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698