| 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 | 6 |
| 7 // Path for Object implementation. | 7 // Patch for 'print' function. |
| 8 patch class PrintImplementation { |
| 9 patch static void print(var obj) { |
| 10 if (obj is String) { |
| 11 Primitives.printString(obj); |
| 12 } else { |
| 13 Primitives.printString(obj.toString()); |
| 14 } |
| 15 } |
| 16 } |
| 17 |
| 18 |
| 19 // Patch for Object implementation. |
| 8 // TODO(ager): Split out into object_patch.dart and allow #source | 20 // TODO(ager): Split out into object_patch.dart and allow #source |
| 9 // in patch files? | 21 // in patch files? |
| 10 patch class ObjectImplementation { | 22 patch class ObjectImplementation { |
| 11 patch static String toStringImpl(Object object) { | 23 patch static String toStringImpl(Object object) { |
| 12 return Primitives.objectToString(object); | 24 return Primitives.objectToString(object); |
| 13 } | 25 } |
| 14 | 26 |
| 15 patch static void noSuchMethodImpl(Object object, String name, List args) { | 27 patch static void noSuchMethodImpl(Object object, String name, List args) { |
| 16 throw new NoSuchMethodException(object, name, args); | 28 throw new NoSuchMethodException(object, name, args); |
| 17 } | 29 } |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 304 key = "expando\$key\$${_keyCount++}"; | 316 key = "expando\$key\$${_keyCount++}"; |
| 305 Primitives.setProperty(this, _KEY_PROPERTY_NAME, key); | 317 Primitives.setProperty(this, _KEY_PROPERTY_NAME, key); |
| 306 } | 318 } |
| 307 return key; | 319 return key; |
| 308 } | 320 } |
| 309 | 321 |
| 310 static const String _KEY_PROPERTY_NAME = 'expando\$key'; | 322 static const String _KEY_PROPERTY_NAME = 'expando\$key'; |
| 311 static const String _EXPANDO_PROPERTY_NAME = 'expando\$values'; | 323 static const String _EXPANDO_PROPERTY_NAME = 'expando\$values'; |
| 312 static int _keyCount = 0; | 324 static int _keyCount = 0; |
| 313 } | 325 } |
| OLD | NEW |