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 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
262 List<E> list = new List<E>(); | 262 List<E> list = new List<E>(); |
263 for (var e in elements) { | 263 for (var e in elements) { |
264 list.add(e); | 264 list.add(e); |
265 } | 265 } |
266 if (growable) return list; | 266 if (growable) return list; |
267 return makeListFixedLength/*<E>*/(list); | 267 return makeListFixedLength/*<E>*/(list); |
268 } | 268 } |
269 | 269 |
270 @patch | 270 @patch |
271 factory List.unmodifiable(Iterable elements) { | 271 factory List.unmodifiable(Iterable elements) { |
272 List result = new List<E>.from(elements, growable: false); | 272 var result = new List<E>.from(elements, growable: false); |
273 return makeFixedListUnmodifiable/*<E>*/(result); | 273 return makeFixedListUnmodifiable/*<E>*/(result); |
274 } | 274 } |
275 } | 275 } |
276 | 276 |
277 | 277 |
278 @patch | 278 @patch |
279 class String { | 279 class String { |
280 @patch | 280 @patch |
281 factory String.fromCharCodes(Iterable<int> charCodes, | 281 factory String.fromCharCodes(Iterable<int> charCodes, |
282 [int start = 0, int end]) { | 282 [int start = 0, int end]) { |
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 return getTraceFromException(error); | 471 return getTraceFromException(error); |
472 } | 472 } |
473 // Fallback if Error.captureStackTrace does not exist. | 473 // Fallback if Error.captureStackTrace does not exist. |
474 try { | 474 try { |
475 throw ''; | 475 throw ''; |
476 } catch (_, stackTrace) { | 476 } catch (_, stackTrace) { |
477 return stackTrace; | 477 return stackTrace; |
478 } | 478 } |
479 } | 479 } |
480 } | 480 } |
OLD | NEW |