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

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

Issue 10698079: Revert all the changes to equals operator. Causing buildbot trouble. (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') | no next file with comments »
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 42846fb65ba37e0ab112b58a151a02227311373c..4f45b395ec5451d57e4aebb0d1dc37cba7e34c12 100644
--- a/lib/compiler/implementation/lib/js_helper.dart
+++ b/lib/compiler/implementation/lib/js_helper.dart
@@ -171,11 +171,12 @@ tdiv(var a, var b) {
}
eq(var a, var b) {
- if (JS('bool', @'# == null', a)) return JS('bool', @'# == null', b);
- if (JS('bool', @'# == null', b)) return false;
+ if (JS('bool', @"# == null", a)) return JS('bool', @"# == null", b);
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 ?
@@ -183,11 +184,12 @@ 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', b)) return false;
+ if (JS('bool', @"# == null", a)) return JS('bool', @"# == null", b);
if (JS('bool', @'typeof # === "object"', a)) {
if (JS_HAS_EQUALS(a)) {
- return UNINTERCEPTED(a == b) == true;
+ return UNINTERCEPTED(a == b) === true;
+ } else {
+ return JS('bool', @'# === #', a, b);
}
}
// TODO(lrn): is NaN === NaN ? Is -0.0 === 0.0 ?
@@ -198,6 +200,26 @@ 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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698