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

Unified Diff: frog/leg/ssa/codegen.dart

Issue 9316026: Support named arguments for dynamic calls. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: '' Created 8 years, 11 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « frog/leg/ssa/builder.dart ('k') | frog/leg/ssa/js_names.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: frog/leg/ssa/codegen.dart
===================================================================
--- frog/leg/ssa/codegen.dart (revision 3781)
+++ frog/leg/ssa/codegen.dart (working copy)
@@ -407,13 +407,17 @@
visitInvokeDynamicMethod(HInvokeDynamicMethod node) {
use(node.receiver);
buffer.add('.');
- // Remove 'this' from the number of arguments.
- int argumentCount = node.inputs.length - 1;
- buffer.add(compiler.namer.instanceMethodName(node.name, argumentCount));
- visitArguments(node.inputs);
// Avoid adding the generative constructor name to the list of
// seen selectors.
- if (node.inputs[0] is !HForeignNew) {
+ if (node.inputs[0] is HForeignNew) {
+ // Remove 'this' from the number of arguments.
+ int argumentCount = node.inputs.length - 1;
+ buffer.add(compiler.namer.instanceMethodName(node.name, argumentCount));
+ visitArguments(node.inputs);
+ } else {
+ buffer.add(compiler.namer.instanceMethodInvocationName(
+ node.name, node.selector));
+ visitArguments(node.inputs);
compiler.registerDynamicInvocation(node.name, node.selector);
}
}
@@ -437,7 +441,7 @@
visitInvokeClosure(HInvokeClosure node) {
use(node.receiver);
buffer.add('.');
- buffer.add(compiler.namer.closureInvocationName(node.inputs.length - 1));
+ buffer.add(compiler.namer.closureInvocationName(node.selector));
visitArguments(node.inputs);
}
« no previous file with comments | « frog/leg/ssa/builder.dart ('k') | frog/leg/ssa/js_names.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698