| 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 String typeNameInChrome(obj) { | 5 String typeNameInChrome(obj) { |
| 6 String name = JS('String', "#.constructor.name", obj); | 6 String name = JS('String', "#.constructor.name", obj); |
| 7 if (name == 'Window') return 'DOMWindow'; | 7 if (name == 'Window') return 'DOMWindow'; |
| 8 if (name == 'CanvasPixelArray') return 'Uint8ClampedArray'; | 8 if (name == 'CanvasPixelArray') return 'Uint8ClampedArray'; |
| 9 return name; | 9 return name; |
| 10 } | 10 } |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 | 94 |
| 95 String toStringForNativeObject(var obj) { | 95 String toStringForNativeObject(var obj) { |
| 96 return 'Instance of ${getTypeNameOf(obj)}'; | 96 return 'Instance of ${getTypeNameOf(obj)}'; |
| 97 } | 97 } |
| 98 | 98 |
| 99 /** | 99 /** |
| 100 * Sets a JavaScript property on an object. | 100 * Sets a JavaScript property on an object. |
| 101 */ | 101 */ |
| 102 void defineProperty(var obj, String property, var value) { | 102 void defineProperty(var obj, String property, var value) { |
| 103 JS('void', """Object.defineProperty(#, #, | 103 JS('void', """Object.defineProperty(#, #, |
| 104 {value: #, enumerable: false, writable: true, configurable: true});""", | 104 {value: #, enumerable: false, writable: true, configurable: true})""", |
| 105 obj, | 105 obj, |
| 106 property, | 106 property, |
| 107 value); | 107 value); |
| 108 } | 108 } |
| 109 | 109 |
| 110 /** | 110 /** |
| 111 * Helper method to throw a [NoSuchMethodException] for a invalid call | 111 * Helper method to throw a [NoSuchMethodException] for a invalid call |
| 112 * on a native object. | 112 * on a native object. |
| 113 */ | 113 */ |
| 114 void throwNoSuchMethod(obj, name, arguments) { | 114 void throwNoSuchMethod(obj, name, arguments) { |
| (...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 277 } | 277 } |
| 278 return result; | 278 return result; |
| 279 } | 279 } |
| 280 | 280 |
| 281 /** | 281 /** |
| 282 * Called by the compiler to setup [_dynamicMetadata]. | 282 * Called by the compiler to setup [_dynamicMetadata]. |
| 283 */ | 283 */ |
| 284 void dynamicSetMetadata(List<List<String>> inputTable) { | 284 void dynamicSetMetadata(List<List<String>> inputTable) { |
| 285 _dynamicMetadata = buildDynamicMetadata(inputTable); | 285 _dynamicMetadata = buildDynamicMetadata(inputTable); |
| 286 } | 286 } |
| OLD | NEW |