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

Side by Side Diff: pkg/compiler/lib/src/cps_ir/cps_ir_builder_task.dart

Issue 1768143003: Use specific messages for const constructor with body. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Updated cf. comments. Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/diagnostics/generated/shared_messages.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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.ir_builder_task; 5 library dart2js.ir_builder_task;
6 6
7 import '../closure.dart' as closure; 7 import '../closure.dart' as closure;
8 import '../common.dart'; 8 import '../common.dart';
9 import '../common/names.dart' show 9 import '../common/names.dart' show
10 Identifiers, 10 Identifiers,
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 // TODO(asgerf): This is largely inherited from the SSA builder. 301 // TODO(asgerf): This is largely inherited from the SSA builder.
302 // The ConstructorBodyElement has an invalid function signature, but we 302 // The ConstructorBodyElement has an invalid function signature, but we
303 // cannot add a BoxLocal as parameter, because BoxLocal is not an element. 303 // cannot add a BoxLocal as parameter, because BoxLocal is not an element.
304 // Instead of forging ParameterElements to forge a FunctionSignature, we 304 // Instead of forging ParameterElements to forge a FunctionSignature, we
305 // need a way to create backend methods without creating more fake elements. 305 // need a way to create backend methods without creating more fake elements.
306 assert(constructor.isGenerativeConstructor); 306 assert(constructor.isGenerativeConstructor);
307 assert(constructor.isImplementation); 307 assert(constructor.isImplementation);
308 if (constructor.isSynthesized) return null; 308 if (constructor.isSynthesized) return null;
309 ast.FunctionExpression node = constructor.node; 309 ast.FunctionExpression node = constructor.node;
310 // If we know the body doesn't have any code, we don't generate it. 310 // If we know the body doesn't have any code, we don't generate it.
311 if (!node.hasBody()) return null; 311 if (!node.hasBody) return null;
312 if (node.hasEmptyBody()) return null; 312 if (node.hasEmptyBody) return null;
313 ClassElement classElement = constructor.enclosingClass; 313 ClassElement classElement = constructor.enclosingClass;
314 ConstructorBodyElement bodyElement; 314 ConstructorBodyElement bodyElement;
315 classElement.forEachBackendMember((Element backendMember) { 315 classElement.forEachBackendMember((Element backendMember) {
316 if (backendMember.isGenerativeConstructorBody) { 316 if (backendMember.isGenerativeConstructorBody) {
317 ConstructorBodyElement body = backendMember; 317 ConstructorBodyElement body = backendMember;
318 if (body.constructor == constructor) { 318 if (body.constructor == constructor) {
319 bodyElement = backendMember; 319 bodyElement = backendMember;
320 } 320 }
321 } 321 }
322 }); 322 });
(...skipping 3720 matching lines...) Expand 10 before | Expand all | Expand 10 after
4043 _backend.jsInteropAnalysis.hasAnonymousAnnotation(element.contextClass); 4043 _backend.jsInteropAnalysis.hasAnonymousAnnotation(element.contextClass);
4044 4044
4045 String getJsInteropTargetPath(FunctionElement element) { 4045 String getJsInteropTargetPath(FunctionElement element) {
4046 return '${_backend.namer.fixedBackendPath(element)}.' 4046 return '${_backend.namer.fixedBackendPath(element)}.'
4047 '${_backend.getFixedBackendName(element)}'; 4047 '${_backend.getFixedBackendName(element)}';
4048 } 4048 }
4049 4049
4050 DartType get jsJavascriptObjectType => 4050 DartType get jsJavascriptObjectType =>
4051 _backend.helpers.jsJavaScriptObjectClass.thisType; 4051 _backend.helpers.jsJavaScriptObjectClass.thisType;
4052 } 4052 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/diagnostics/generated/shared_messages.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698