| 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 | |
| 34 @patch | 30 @patch |
| 35 int identityHashCode(Object object) => objectHashCode(object); | 31 int identityHashCode(Object object) => objectHashCode(object); |
| 36 | 32 |
| 37 // Patch for Object implementation. | 33 // Patch for Object implementation. |
| 38 @patch | 34 @patch |
| 39 class Object { | 35 class Object { |
| 40 @patch | 36 @patch |
| 41 int get hashCode => Primitives.objectHashCode(this); | 37 int get hashCode => Primitives.objectHashCode(this); |
| 42 | 38 |
| 43 | 39 |
| (...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 466 @patch | 462 @patch |
| 467 static bool get _isWindows => false; | 463 static bool get _isWindows => false; |
| 468 | 464 |
| 469 @patch | 465 @patch |
| 470 static Uri get base { | 466 static Uri get base { |
| 471 String uri = Primitives.currentUri(); | 467 String uri = Primitives.currentUri(); |
| 472 if (uri != null) return Uri.parse(uri); | 468 if (uri != null) return Uri.parse(uri); |
| 473 throw new UnsupportedError("'Uri.base' is not supported"); | 469 throw new UnsupportedError("'Uri.base' is not supported"); |
| 474 } | 470 } |
| 475 } | 471 } |
| OLD | NEW |