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

Side by Side Diff: sdk/lib/_internal/compiler/implementation/resolution/members.dart

Issue 101823004: We inline List allocations in dart2js to get the right behavior when the passed length is null. Thi… (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 7 years 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | sdk/lib/_internal/lib/core_patch.dart » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, 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 part of resolution; 5 part of resolution;
6 6
7 abstract class TreeElements { 7 abstract class TreeElements {
8 Element get currentElement; 8 Element get currentElement;
9 Setlet<Node> get superUses; 9 Setlet<Node> get superUses;
10 10
(...skipping 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 redirection = resolver.visitor.resolveConstructorRedirection(redirection); 310 redirection = resolver.visitor.resolveConstructorRedirection(redirection);
311 } 311 }
312 } 312 }
313 313
314 void checkMatchingPatchParameters(FunctionElement origin, 314 void checkMatchingPatchParameters(FunctionElement origin,
315 Link<Element> originParameters, 315 Link<Element> originParameters,
316 Link<Element> patchParameters) { 316 Link<Element> patchParameters) {
317 while (!originParameters.isEmpty) { 317 while (!originParameters.isEmpty) {
318 Element originParameter = originParameters.head; 318 Element originParameter = originParameters.head;
319 Element patchParameter = patchParameters.head; 319 Element patchParameter = patchParameters.head;
320 // Hack: Use unparser to test parameter equality. This only works because 320 String originParameterName = originParameter.name;
321 // we are restricting patch uses and the approach cannot be used 321 String patchParameterName = patchParameter.name;
322 // elsewhere. 322 if (originParameterName != patchParameterName) {
Johnni Winther 2013/12/09 12:11:01 With this change, we allow different default value
ngeoffray 2013/12/09 15:24:17 OK, I have reverted this change and check that the
323 String originParameterText =
324 originParameter.parseNode(compiler).toString();
325 String patchParameterText =
326 patchParameter.parseNode(compiler).toString();
327 if (originParameterText != patchParameterText) {
328 compiler.reportError( 323 compiler.reportError(
329 originParameter.parseNode(compiler), 324 originParameter.parseNode(compiler),
330 MessageKind.PATCH_PARAMETER_MISMATCH, 325 MessageKind.PATCH_PARAMETER_MISMATCH,
331 {'methodName': origin.name, 326 {'methodName': origin.name,
332 'originParameter': originParameterText, 327 'originParameter': originParameterName,
333 'patchParameter': patchParameterText}); 328 'patchParameter': patchParameterName});
334 compiler.reportMessage( 329 compiler.reportMessage(
335 compiler.spanFromSpannable(patchParameter), 330 compiler.spanFromSpannable(patchParameter),
336 MessageKind.PATCH_POINT_TO_PARAMETER.error( 331 MessageKind.PATCH_POINT_TO_PARAMETER.error(
337 {'parameterName': patchParameter.name}), 332 {'parameterName': patchParameterName}),
338 Diagnostic.INFO); 333 Diagnostic.INFO);
339 } 334 }
340 DartType originParameterType = originParameter.computeType(compiler); 335 DartType originParameterType = originParameter.computeType(compiler);
341 DartType patchParameterType = patchParameter.computeType(compiler); 336 DartType patchParameterType = patchParameter.computeType(compiler);
342 if (originParameterType != patchParameterType) { 337 if (originParameterType != patchParameterType) {
343 compiler.reportError( 338 compiler.reportError(
344 originParameter.parseNode(compiler), 339 originParameter.parseNode(compiler),
345 MessageKind.PATCH_PARAMETER_TYPE_MISMATCH, 340 MessageKind.PATCH_PARAMETER_TYPE_MISMATCH,
346 {'methodName': origin.name, 341 {'methodName': origin.name,
347 'parameterName': originParameter.name, 342 'parameterName': originParameter.name,
(...skipping 4419 matching lines...) Expand 10 before | Expand all | Expand 10 after
4767 return finishConstructorReference(visit(expression), 4762 return finishConstructorReference(visit(expression),
4768 expression, expression); 4763 expression, expression);
4769 } 4764 }
4770 } 4765 }
4771 4766
4772 /// Looks up [name] in [scope] and unwraps the result. 4767 /// Looks up [name] in [scope] and unwraps the result.
4773 Element lookupInScope(Compiler compiler, Node node, 4768 Element lookupInScope(Compiler compiler, Node node,
4774 Scope scope, String name) { 4769 Scope scope, String name) {
4775 return Elements.unwrap(scope.lookup(name), compiler, node); 4770 return Elements.unwrap(scope.lookup(name), compiler, node);
4776 } 4771 }
OLDNEW
« no previous file with comments | « no previous file | sdk/lib/_internal/lib/core_patch.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698