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 #library('dart:_js_helper'); | 5 #library('dart:_js_helper'); |
6 | 6 |
7 #import('dart:coreimpl'); | 7 #import('dart:coreimpl'); |
8 | 8 |
9 #source('constant_map.dart'); | 9 #source('constant_map.dart'); |
10 #source('native_helper.dart'); | 10 #source('native_helper.dart'); |
(...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 if (positionalArguments != null) { | 625 if (positionalArguments != null) { |
626 argumentCount += positionalArguments.length; | 626 argumentCount += positionalArguments.length; |
627 arguments.addAll(positionalArguments); | 627 arguments.addAll(positionalArguments); |
628 } | 628 } |
629 | 629 |
630 // Sort the named arguments to get the right selector name and | 630 // Sort the named arguments to get the right selector name and |
631 // arguments order. | 631 // arguments order. |
632 if (namedArguments != null && !namedArguments.isEmpty) { | 632 if (namedArguments != null && !namedArguments.isEmpty) { |
633 // Call new List.from to make sure we get a JavaScript array. | 633 // Call new List.from to make sure we get a JavaScript array. |
634 List<String> listOfNamedArguments = | 634 List<String> listOfNamedArguments = |
635 new List<String>.from(namedArguments.getKeys()); | 635 new List<String>.from(namedArguments.keys); |
636 argumentCount += namedArguments.length; | 636 argumentCount += namedArguments.length; |
637 // We're sorting on strings, and the behavior is the same between | 637 // We're sorting on strings, and the behavior is the same between |
638 // Dart string sort and JS string sort. To avoid needing the Dart | 638 // Dart string sort and JS string sort. To avoid needing the Dart |
639 // sort implementation, we use the JavaScript one instead. | 639 // sort implementation, we use the JavaScript one instead. |
640 JS('void', '#.sort()', listOfNamedArguments); | 640 JS('void', '#.sort()', listOfNamedArguments); |
641 listOfNamedArguments.forEach((String name) { | 641 listOfNamedArguments.forEach((String name) { |
642 buffer.add('\$$name'); | 642 buffer.add('\$$name'); |
643 arguments.add(namedArguments[name]); | 643 arguments.add(namedArguments[name]); |
644 }); | 644 }); |
645 } | 645 } |
(...skipping 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1401 JS('void', r'#.runtimeTypeCache[#] = #', JS_CURRENT_ISOLATE(), key, | 1401 JS('void', r'#.runtimeTypeCache[#] = #', JS_CURRENT_ISOLATE(), key, |
1402 runtimeType); | 1402 runtimeType); |
1403 } | 1403 } |
1404 return runtimeType; | 1404 return runtimeType; |
1405 } | 1405 } |
1406 | 1406 |
1407 String getRuntimeTypeString(var object) { | 1407 String getRuntimeTypeString(var object) { |
1408 var typeInfo = JS('Object', r'#.builtin$typeInfo', object); | 1408 var typeInfo = JS('Object', r'#.builtin$typeInfo', object); |
1409 return JS('String', r'#.runtimeType', typeInfo); | 1409 return JS('String', r'#.runtimeType', typeInfo); |
1410 } | 1410 } |
OLD | NEW |