Chromium Code Reviews| 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 ConstantMap, | |
| 10 getRuntimeType, | 11 getRuntimeType, |
| 11 jsonEncodeNative, | 12 jsonEncodeNative, |
| 13 JsLinkedHashMap, | |
| 12 JSSyntaxRegExp, | 14 JSSyntaxRegExp, |
| 13 Primitives, | 15 Primitives, |
| 14 stringJoinUnchecked, | 16 stringJoinUnchecked, |
| 15 objectHashCode, | 17 objectHashCode, |
| 16 getTraceFromException; | 18 getTraceFromException; |
| 17 | 19 |
| 18 import 'dart:_foreign_helper' show JS; | 20 import 'dart:_foreign_helper' show JS; |
| 19 | 21 |
| 20 import 'dart:_native_typed_data' show NativeUint8List; | 22 import 'dart:_native_typed_data' show NativeUint8List; |
| 21 | 23 |
| (...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 324 @patch | 326 @patch |
| 325 factory List.unmodifiable(Iterable elements) { | 327 factory List.unmodifiable(Iterable elements) { |
| 326 var result = new List<E>.from(elements, growable: false); | 328 var result = new List<E>.from(elements, growable: false); |
| 327 return makeFixedListUnmodifiable/*<E>*/(result); | 329 return makeFixedListUnmodifiable/*<E>*/(result); |
| 328 } | 330 } |
| 329 } | 331 } |
| 330 | 332 |
| 331 @patch | 333 @patch |
| 332 class Map<K, V> { | 334 class Map<K, V> { |
| 333 @patch | 335 @patch |
| 334 factory Map.unmodifiable(Map other) { | 336 factory Map.unmodifiable(Map other) = ConstantMap<K, V>.from; |
| 335 return new UnmodifiableMapView<K, V>(new Map<K, V>.from(other)); | |
|
sra1
2016/05/09 23:16:40
I think it is OK to leave this as-is.
The various
Harry Terkelsen
2016/05/10 00:59:27
Done.
| |
| 336 } | |
| 337 | 337 |
| 338 @patch | 338 @patch |
| 339 factory Map() = JsLinkedHashMap<K, V>.es6; | 339 factory Map() = JsLinkedHashMap<K, V>.es6; |
| 340 } | 340 } |
| 341 | 341 |
| 342 @patch | 342 @patch |
| 343 class String { | 343 class String { |
| 344 @patch | 344 @patch |
| 345 factory String.fromCharCodes(Iterable<int> charCodes, | 345 factory String.fromCharCodes(Iterable<int> charCodes, |
| 346 [int start = 0, int end]) { | 346 [int start = 0, int end]) { |
| (...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 569 return getTraceFromException(error); | 569 return getTraceFromException(error); |
| 570 } | 570 } |
| 571 // Fallback if Error.captureStackTrace does not exist. | 571 // Fallback if Error.captureStackTrace does not exist. |
| 572 try { | 572 try { |
| 573 throw ''; | 573 throw ''; |
| 574 } catch (_, stackTrace) { | 574 } catch (_, stackTrace) { |
| 575 return stackTrace; | 575 return stackTrace; |
| 576 } | 576 } |
| 577 } | 577 } |
| 578 } | 578 } |
| OLD | NEW |