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

Unified Diff: tool/input_sdk/patch/core_patch.dart

Issue 1153003003: fixes #40, extension methods for primitive types (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Created 5 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
Index: tool/input_sdk/patch/core_patch.dart
diff --git a/tool/input_sdk/patch/core_patch.dart b/tool/input_sdk/patch/core_patch.dart
index 855a3831b339497b266b651756aaa6e655ba0da7..50440933add127dc1e6eb83ce17378764a8bf8ff 100644
--- a/tool/input_sdk/patch/core_patch.dart
+++ b/tool/input_sdk/patch/core_patch.dart
@@ -18,19 +18,6 @@ import 'dart:_foreign_helper' show JS;
String _symbolToString(Symbol symbol) => _symbol_dev.Symbol.getName(symbol);
-_symbolMapToStringMap(Map<Symbol, dynamic> map) {
- if (map == null) return null;
- var result = new Map<String, dynamic>();
- map.forEach((Symbol key, value) {
- result[_symbolToString(key)] = value;
- });
- return result;
-}
-
-class SupportJsExtensionMethods {
- const SupportJsExtensionMethods();
-}
-
@patch
int identityHashCode(Object object) => objectHashCode(object);
@@ -238,10 +225,6 @@ class Stopwatch {
static int _now() => Primitives.timerTicks();
}
-class _ListConstructorSentinel {
- const _ListConstructorSentinel();
-}
-
// Patch for List implementation.
@patch
class List<E> {
@@ -256,14 +239,9 @@ class List<E> {
if ((length is !int) || (length < 0)) {
throw new ArgumentError("Length must be a non-negative integer: $length");
}
- list = JS('', 'new Array(#)', length);
- // TODO(jmesserly): consider a fixed array subclass instead.
- JS('void', r'#.fixed$length = Array', list);
+ list = JSArray.markFixedList(JS('', 'new Array(#)', length));
}
- // TODO(jmesserly): skip this when E is dynamic and Object.
- JS('void', 'dart.setType(#, List\$(#))', list, E);
- // TODO(jmesserly): compiler creates a bogus type check here.
- return list;
+ return new JSArray<E>.typed(list);
}
@patch

Powered by Google App Engine
This is Rietveld 408576698