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

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

Issue 11193032: Use JavaScript's Array.sort. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge
Patch Set: Minor tweak to sort$0 Created 8 years, 2 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
Index: dart/lib/compiler/implementation/lib/js_helper.dart
diff --git a/dart/lib/compiler/implementation/lib/js_helper.dart b/dart/lib/compiler/implementation/lib/js_helper.dart
index 80d93d3d4b016b31f0727a0c8f4f33e1d654d32c..da13b346aa1d231e8d1a6747b389059e5fb17811 100644
--- a/dart/lib/compiler/implementation/lib/js_helper.dart
+++ b/dart/lib/compiler/implementation/lib/js_helper.dart
@@ -1412,3 +1412,19 @@ String getRuntimeTypeString(var object) {
var typeInfo = JS('Object', r'#.builtin$typeInfo', object);
return JS('String', r'#.runtimeType', typeInfo);
}
+
+compareHelperNull(compare, a, b) {
+ if (const NullSentinel() == a) {
+ a = null;
+ }
+ if (const NullSentinel() == b) {
+ b = null;
+ }
+ compare(a, b);
Lasse Reichstein Nielsen 2012/10/18 11:54:50 return result? (I.e., is this tested? :)
+}
+
+compareHelper(compare, a, b) => compare(a, b);
+
+class NullSentinel {
+ const NullSentinel();
+}

Powered by Google App Engine
This is Rietveld 408576698