| 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, |
| 11 jsonEncodeNative, | 11 jsonEncodeNative, |
| 12 JSSyntaxRegExp, | 12 JSSyntaxRegExp, |
| 13 Primitives, | 13 Primitives, |
| 14 stringJoinUnchecked, | 14 stringJoinUnchecked, |
| 15 objectHashCode; | 15 objectHashCode; |
| 16 | 16 |
| 17 import 'dart:_foreign_helper' show JS; | 17 import 'dart:_foreign_helper' show JS; |
| 18 | 18 |
| 19 String _symbolToString(Symbol symbol) => _symbol_dev.Symbol.getName(symbol); | 19 String _symbolToString(Symbol symbol) => _symbol_dev.Symbol.getName(symbol); |
| 20 | 20 |
| 21 _symbolMapToStringMap(Map<Symbol, dynamic> map) { | 21 _symbolMapToStringMap(Map<Symbol, dynamic> map) { |
| 22 if (map == null) return null; | 22 if (map == null) return null; |
| 23 var result = new Map<String, dynamic>(); | 23 var result = new Map<String, dynamic>(); |
| 24 map.forEach((Symbol key, value) { | 24 map.forEach((Symbol key, value) { |
| 25 result[_symbolToString(key)] = value; | 25 result[_symbolToString(key)] = value; |
| 26 }); | 26 }); |
| 27 return result; | 27 return result; |
| 28 } | 28 } |
| 29 | 29 |
| 30 class SupportJsExtensionMethods { |
| 31 const SupportJsExtensionMethods(); |
| 32 } |
| 33 |
| 30 @patch | 34 @patch |
| 31 int identityHashCode(Object object) => objectHashCode(object); | 35 int identityHashCode(Object object) => objectHashCode(object); |
| 32 | 36 |
| 33 // Patch for Object implementation. | 37 // Patch for Object implementation. |
| 34 @patch | 38 @patch |
| 35 class Object { | 39 class Object { |
| 36 @patch | 40 @patch |
| 37 int get hashCode => Primitives.objectHashCode(this); | 41 int get hashCode => Primitives.objectHashCode(this); |
| 38 | 42 |
| 39 | 43 |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 462 @patch | 466 @patch |
| 463 static bool get _isWindows => false; | 467 static bool get _isWindows => false; |
| 464 | 468 |
| 465 @patch | 469 @patch |
| 466 static Uri get base { | 470 static Uri get base { |
| 467 String uri = Primitives.currentUri(); | 471 String uri = Primitives.currentUri(); |
| 468 if (uri != null) return Uri.parse(uri); | 472 if (uri != null) return Uri.parse(uri); |
| 469 throw new UnsupportedError("'Uri.base' is not supported"); | 473 throw new UnsupportedError("'Uri.base' is not supported"); |
| 470 } | 474 } |
| 471 } | 475 } |
| OLD | NEW |