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

Unified Diff: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart

Issue 11826049: Fix crash due to wrong position of an optional parameter in a stub method of an interceptor class. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 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 | « no previous file | tests/corelib/corelib.status » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart
===================================================================
--- sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart (revision 16911)
+++ sdk/lib/_internal/compiler/implementation/js_backend/emitter.dart (working copy)
@@ -505,7 +505,8 @@
parameters.orderedForEachParameter((Element element) {
String jsName = JsNames.getValid(element.name.slowToString());
assert(jsName != receiverArgumentName);
- if (count < positionalArgumentCount + extraArgumentCount) {
+ int optionalParameterStart = positionalArgumentCount + extraArgumentCount;
+ if (count < optionalParameterStart) {
parametersBuffer[count] = new js.Parameter(jsName);
argumentsBuffer[count] = new js.VariableUse(jsName);
} else {
@@ -515,7 +516,7 @@
// The order of the named arguments is not the same as the
// one in the real method (which is in Dart source order).
argumentsBuffer[count] = new js.VariableUse(jsName);
- parametersBuffer[selector.positionalArgumentCount + index] =
+ parametersBuffer[optionalParameterStart + index] =
new js.Parameter(jsName);
// Note that [elements] may be null for a synthesized [member].
} else if (elements != null && elements.isParameterChecked(element)) {
« no previous file with comments | « no previous file | tests/corelib/corelib.status » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698