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

Unified Diff: pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart

Issue 1040623002: Clean up naming scheme for reflection names. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Exclude methods that are not reflectable Created 5 years, 9 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 | « no previous file | pkg/compiler/lib/src/js_emitter/old_emitter/setup_program_builder.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
diff --git a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
index 0a8e2d16bc80d56c82e553a0a6753184b9f4ddaf..4f3f9a903a8a30713a205d78a2a82518365b06dc 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
@@ -361,14 +361,12 @@ class OldEmitter implements Emitter {
if (elementOrSelector is Selector
|| elementOrSelector.isFunction
|| elementOrSelector.isConstructor) {
- int requiredParameterCount;
- int optionalParameterCount;
+ int positionalParameterCount;
String namedArguments = '';
bool isConstructor = false;
if (elementOrSelector is Selector) {
Selector selector = elementOrSelector;
- requiredParameterCount = selector.argumentCount;
- optionalParameterCount = 0;
+ positionalParameterCount = selector.positionalArgumentCount;
namedArguments = namedParametersAsReflectionNames(selector);
} else {
FunctionElement function = elementOrSelector;
@@ -377,8 +375,7 @@ class OldEmitter implements Emitter {
name = Elements.reconstructConstructorName(function);
}
FunctionSignature signature = function.functionSignature;
- requiredParameterCount = signature.requiredParameterCount;
- optionalParameterCount = signature.optionalParameterCount;
+ positionalParameterCount = signature.requiredParameterCount;
if (signature.optionalParametersAreNamed) {
var names = [];
for (Element e in signature.optionalParameters) {
@@ -387,24 +384,19 @@ class OldEmitter implements Emitter {
Selector selector = new Selector.call(
function.name,
function.library,
- requiredParameterCount,
+ positionalParameterCount,
names);
namedArguments = namedParametersAsReflectionNames(selector);
} else {
- // Named parameters are handled differently by mirrors. For unnamed
+ // Named parameters are handled differently by mirrors. For unnamed
// parameters, they are actually required if invoked
// reflectively. Also, if you have a method c(x) and c([x]) they both
// get the same mangled name, so they must have the same reflection
// name.
- requiredParameterCount += optionalParameterCount;
- optionalParameterCount = 0;
+ positionalParameterCount += signature.optionalParameterCount;
}
}
- String suffix =
- // TODO(ahe): We probably don't need optionalParameterCount in the
- // reflection name.
- '$name:$requiredParameterCount:$optionalParameterCount'
- '$namedArguments';
+ String suffix = '$name:$positionalParameterCount$namedArguments';
return (isConstructor) ? 'new $suffix' : suffix;
}
Element element = elementOrSelector;
« no previous file with comments | « no previous file | pkg/compiler/lib/src/js_emitter/old_emitter/setup_program_builder.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698