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

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

Issue 1039223002: Revert "Clean up naming scheme for reflection names." (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: 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 4f3f9a903a8a30713a205d78a2a82518365b06dc..0a8e2d16bc80d56c82e553a0a6753184b9f4ddaf 100644
--- a/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
+++ b/pkg/compiler/lib/src/js_emitter/old_emitter/emitter.dart
@@ -361,12 +361,14 @@ class OldEmitter implements Emitter {
if (elementOrSelector is Selector
|| elementOrSelector.isFunction
|| elementOrSelector.isConstructor) {
- int positionalParameterCount;
+ int requiredParameterCount;
+ int optionalParameterCount;
String namedArguments = '';
bool isConstructor = false;
if (elementOrSelector is Selector) {
Selector selector = elementOrSelector;
- positionalParameterCount = selector.positionalArgumentCount;
+ requiredParameterCount = selector.argumentCount;
+ optionalParameterCount = 0;
namedArguments = namedParametersAsReflectionNames(selector);
} else {
FunctionElement function = elementOrSelector;
@@ -375,7 +377,8 @@ class OldEmitter implements Emitter {
name = Elements.reconstructConstructorName(function);
}
FunctionSignature signature = function.functionSignature;
- positionalParameterCount = signature.requiredParameterCount;
+ requiredParameterCount = signature.requiredParameterCount;
+ optionalParameterCount = signature.optionalParameterCount;
if (signature.optionalParametersAreNamed) {
var names = [];
for (Element e in signature.optionalParameters) {
@@ -384,19 +387,24 @@ class OldEmitter implements Emitter {
Selector selector = new Selector.call(
function.name,
function.library,
- positionalParameterCount,
+ requiredParameterCount,
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.
- positionalParameterCount += signature.optionalParameterCount;
+ requiredParameterCount += optionalParameterCount;
+ optionalParameterCount = 0;
}
}
- String suffix = '$name:$positionalParameterCount$namedArguments';
+ String suffix =
+ // TODO(ahe): We probably don't need optionalParameterCount in the
+ // reflection name.
+ '$name:$requiredParameterCount:$optionalParameterCount'
+ '$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