Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(156)

Side by Side Diff: lib/compiler/implementation/lib/js_helper.dart

Issue 11267018: Make getKeys, getValues getters (keys, values). (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update status files with co19 issue number. Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « lib/compiler/implementation/lib/isolate_patch.dart ('k') | lib/compiler/implementation/library_loader.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698