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 part of js_helper; | |
6 | |
7 String typeNameInChrome(obj) { | 5 String typeNameInChrome(obj) { |
8 String name = JS('String', "#.constructor.name", obj); | 6 String name = JS('String', "#.constructor.name", obj); |
9 if (name == 'Window') return 'DOMWindow'; | 7 if (name == 'Window') return 'DOMWindow'; |
10 if (name == 'CanvasPixelArray') return 'Uint8ClampedArray'; | 8 if (name == 'CanvasPixelArray') return 'Uint8ClampedArray'; |
11 if (name == 'WebKitMutationObserver') return 'MutationObserver'; | 9 if (name == 'WebKitMutationObserver') return 'MutationObserver'; |
12 return name; | 10 return name; |
13 } | 11 } |
14 | 12 |
15 String typeNameInSafari(obj) { | 13 String typeNameInSafari(obj) { |
16 String name = JS('String', '#', constructorNameFallback(obj)); | 14 String name = JS('String', '#', constructorNameFallback(obj)); |
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
338 } | 336 } |
339 return result; | 337 return result; |
340 } | 338 } |
341 | 339 |
342 /** | 340 /** |
343 * Called by the compiler to setup [_dynamicMetadata]. | 341 * Called by the compiler to setup [_dynamicMetadata]. |
344 */ | 342 */ |
345 void dynamicSetMetadata(List<List<String>> inputTable) { | 343 void dynamicSetMetadata(List<List<String>> inputTable) { |
346 _dynamicMetadata = buildDynamicMetadata(inputTable); | 344 _dynamicMetadata = buildDynamicMetadata(inputTable); |
347 } | 345 } |
OLD | NEW |