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

Side by Side Diff: pkg/compiler/lib/src/js_emitter/parameter_stub_generator.dart

Issue 2941033002: Finish strong mode cleaning of dart2js. (Closed)
Patch Set: Add bug numbers and address comments. Created 3 years, 6 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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 dart2js.js_emitter.parameter_stub_generator; 5 library dart2js.js_emitter.parameter_stub_generator;
6 6
7 import '../closure.dart' show ClosureClassElement; 7 import '../closure.dart' show ClosureClassElement;
8 import '../common.dart'; 8 import '../common.dart';
9 import '../common_elements.dart'; 9 import '../common_elements.dart';
10 import '../constants/values.dart'; 10 import '../constants/values.dart';
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 if (isInterceptedMethod) { 114 if (isInterceptedMethod) {
115 count++; 115 count++;
116 parametersBuffer[0] = new jsAst.Parameter(receiverArgumentName); 116 parametersBuffer[0] = new jsAst.Parameter(receiverArgumentName);
117 argumentsBuffer[0] = js('#', receiverArgumentName); 117 argumentsBuffer[0] = js('#', receiverArgumentName);
118 } 118 }
119 119
120 int optionalParameterStart = positionalArgumentCount + extraArgumentCount; 120 int optionalParameterStart = positionalArgumentCount + extraArgumentCount;
121 // Includes extra receiver argument when using interceptor convention 121 // Includes extra receiver argument when using interceptor convention
122 int indexOfLastOptionalArgumentInParameters = optionalParameterStart - 1; 122 int indexOfLastOptionalArgumentInParameters = optionalParameterStart - 1;
123 123
124 parameters.orderedForEachParameter((ParameterElement element) { 124 parameters.orderedForEachParameter((_element) {
125 ParameterElement element = _element;
125 String jsName = _namer.safeVariableName(element.name); 126 String jsName = _namer.safeVariableName(element.name);
126 assert(jsName != receiverArgumentName); 127 assert(jsName != receiverArgumentName);
127 if (count < optionalParameterStart) { 128 if (count < optionalParameterStart) {
128 parametersBuffer[count] = new jsAst.Parameter(jsName); 129 parametersBuffer[count] = new jsAst.Parameter(jsName);
129 argumentsBuffer[count] = js('#', jsName); 130 argumentsBuffer[count] = js('#', jsName);
130 } else { 131 } else {
131 int index = names.indexOf(element.name); 132 int index = names.indexOf(element.name);
132 if (index != -1) { 133 if (index != -1) {
133 indexOfLastOptionalArgumentInParameters = count; 134 indexOfLastOptionalArgumentInParameters = count;
134 // The order of the named arguments is not the same as the 135 // The order of the named arguments is not the same as the
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 generateParameterStub(member, selector, null); 317 generateParameterStub(member, selector, null);
317 if (stub != null) { 318 if (stub != null) {
318 stubs.add(stub); 319 stubs.add(stub);
319 } 320 }
320 } 321 }
321 } 322 }
322 323
323 return stubs; 324 return stubs;
324 } 325 }
325 } 326 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698