| OLD | NEW |
| 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 // Patch file for dart:core classes. | 5 // Patch file for dart:core classes. |
| 6 import "dart:_internal" as _symbol_dev; | 6 import "dart:_internal" as _symbol_dev; |
| 7 import 'dart:_interceptors'; | 7 import 'dart:_interceptors'; |
| 8 import 'dart:_js_helper' show patch, | 8 import 'dart:_js_helper' show patch, |
| 9 checkInt, | 9 checkInt, |
| 10 getRuntimeType, | 10 getRuntimeType, |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 110 static const String _EXPANDO_PROPERTY_NAME = 'expando\$values'; | 110 static const String _EXPANDO_PROPERTY_NAME = 'expando\$values'; |
| 111 static int _keyCount = 0; | 111 static int _keyCount = 0; |
| 112 } | 112 } |
| 113 | 113 |
| 114 @patch | 114 @patch |
| 115 class int { | 115 class int { |
| 116 @patch | 116 @patch |
| 117 static int parse(String source, | 117 static int parse(String source, |
| 118 { int radix, | 118 { int radix, |
| 119 int onError(String source) }) { | 119 int onError(String source) }) { |
| 120 // TODO(jmesserly): fix this | 120 return Primitives.parseInt(source, radix, onError); |
| 121 return JS('int', 'Number(#)', source); | |
| 122 //return Primitives.parseInt(source, radix, onError); | |
| 123 } | 121 } |
| 124 | 122 |
| 125 @patch | 123 @patch |
| 126 factory int.fromEnvironment(String name, {int defaultValue}) { | 124 factory int.fromEnvironment(String name, {int defaultValue}) { |
| 127 throw new UnsupportedError( | 125 throw new UnsupportedError( |
| 128 'int.fromEnvironment can only be used as a const constructor'); | 126 'int.fromEnvironment can only be used as a const constructor'); |
| 129 } | 127 } |
| 130 } | 128 } |
| 131 | 129 |
| 132 @patch | 130 @patch |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 if (length != 0 && fill != null) { | 255 if (length != 0 && fill != null) { |
| 258 for (int i = 0; i < result.length; i++) { | 256 for (int i = 0; i < result.length; i++) { |
| 259 result[i] = fill; | 257 result[i] = fill; |
| 260 } | 258 } |
| 261 } | 259 } |
| 262 return result; | 260 return result; |
| 263 } | 261 } |
| 264 | 262 |
| 265 @patch | 263 @patch |
| 266 factory List.from(Iterable elements, { bool growable: true }) { | 264 factory List.from(Iterable elements, { bool growable: true }) { |
| 267 // TODO(jmesserly): fix this. This is just to unblock initial SDK check in. | |
| 268 return null; | |
| 269 /* | |
| 270 List<E> list = new List<E>(); | 265 List<E> list = new List<E>(); |
| 271 for (E e in elements) { | 266 for (E e in elements) { |
| 272 list.add(e); | 267 list.add(e); |
| 273 } | 268 } |
| 274 if (growable) return list; | 269 if (growable) return list; |
| 275 return makeListFixedLength(list); | 270 return makeListFixedLength(list); |
| 276 */ | |
| 277 } | 271 } |
| 278 } | 272 } |
| 279 | 273 |
| 280 | 274 |
| 281 @patch | 275 @patch |
| 282 class String { | 276 class String { |
| 283 @patch | 277 @patch |
| 284 factory String.fromCharCodes(Iterable<int> charCodes, | 278 factory String.fromCharCodes(Iterable<int> charCodes, |
| 285 [int start = 0, int end]) { | 279 [int start = 0, int end]) { |
| 286 // If possible, recognize typed lists too. | 280 // If possible, recognize typed lists too. |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 455 @patch | 449 @patch |
| 456 static bool get _isWindows => false; | 450 static bool get _isWindows => false; |
| 457 | 451 |
| 458 @patch | 452 @patch |
| 459 static Uri get base { | 453 static Uri get base { |
| 460 String uri = Primitives.currentUri(); | 454 String uri = Primitives.currentUri(); |
| 461 if (uri != null) return Uri.parse(uri); | 455 if (uri != null) return Uri.parse(uri); |
| 462 throw new UnsupportedError("'Uri.base' is not supported"); | 456 throw new UnsupportedError("'Uri.base' is not supported"); |
| 463 } | 457 } |
| 464 } | 458 } |
| OLD | NEW |