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

Side by Side Diff: pkg/front_end/lib/src/fasta/kernel/body_builder.dart

Issue 2890933002: Use LibraryIndex in CoreTypes instead of extending it. (Closed)
Patch Set: Make everything lazy in CoreTypes. Created 3 years, 7 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/front_end/lib/src/fasta/kernel/kernel_outline_shaker.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) 2016, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2016, 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 fasta.body_builder; 5 library fasta.body_builder;
6 6
7 import '../fasta_codes.dart' 7 import '../fasta_codes.dart'
8 show FastaMessage, codeExpectedButGot, codeExpectedFunctionBody; 8 show FastaMessage, codeExpectedButGot, codeExpectedFunctionBody;
9 9
10 import '../parser/parser.dart' show FormalParameterType, MemberKind, optional; 10 import '../parser/parser.dart' show FormalParameterType, MemberKind, optional;
(...skipping 594 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 push(receiver); 605 push(receiver);
606 } else { 606 } else {
607 push(finishSend(receiver, arguments, beginToken.charOffset)); 607 push(finishSend(receiver, arguments, beginToken.charOffset));
608 } 608 }
609 } 609 }
610 610
611 @override 611 @override
612 finishSend(Object receiver, Arguments arguments, int charOffset) { 612 finishSend(Object receiver, Arguments arguments, int charOffset) {
613 bool isIdentical(Object receiver) { 613 bool isIdentical(Object receiver) {
614 return receiver is StaticAccessor && 614 return receiver is StaticAccessor &&
615 receiver.readTarget == 615 receiver.readTarget == coreTypes.identicalProcedure;
616 coreTypes.tryGetTopLevelMember("dart:core", null, "identical");
617 } 616 }
618 617
619 if (receiver is FastaAccessor) { 618 if (receiver is FastaAccessor) {
620 if (constantExpressionRequired && 619 if (constantExpressionRequired &&
621 !isIdentical(receiver) && 620 !isIdentical(receiver) &&
622 !receiver.isInitializer) { 621 !receiver.isInitializer) {
623 addCompileTimeError(charOffset, "Not a constant expression."); 622 addCompileTimeError(charOffset, "Not a constant expression.");
624 } 623 }
625 return receiver.doInvocation(charOffset, arguments); 624 return receiver.doInvocation(charOffset, arguments);
626 } else { 625 } else {
(...skipping 150 matching lines...) Expand 10 before | Expand all | Expand 10 after
777 } else if (isSetter) { 776 } else if (isSetter) {
778 message = "Setter not found: '$errorName'."; 777 message = "Setter not found: '$errorName'.";
779 } else { 778 } else {
780 message = "Method not found: '$errorName'."; 779 message = "Method not found: '$errorName'.";
781 } 780 }
782 if (constantExpressionRequired) { 781 if (constantExpressionRequired) {
783 return buildCompileTimeError(message, charOffset); 782 return buildCompileTimeError(message, charOffset);
784 } 783 }
785 warning(message, charOffset); 784 warning(message, charOffset);
786 Constructor constructor = 785 Constructor constructor =
787 coreTypes.getClass("dart:core", "NoSuchMethodError").constructors.first; 786 coreTypes.noSuchMethodErrorClass.constructors.first;
788 return new Throw(new ConstructorInvocation( 787 return new Throw(new ConstructorInvocation(
789 constructor, 788 constructor,
790 astFactory.arguments(<Expression>[ 789 astFactory.arguments(<Expression>[
791 astFactory.nullLiteral(null), 790 astFactory.nullLiteral(null),
792 new SymbolLiteral(name), 791 new SymbolLiteral(name),
793 new ListLiteral(arguments.positional), 792 new ListLiteral(arguments.positional),
794 new MapLiteral(arguments.named.map((arg) { 793 new MapLiteral(arguments.named.map((arg) {
795 return new MapEntry(new SymbolLiteral(arg.name), arg.value); 794 return new MapEntry(new SymbolLiteral(arg.name), arg.value);
796 }).toList()), 795 }).toList()),
797 astFactory.nullLiteral(null) 796 astFactory.nullLiteral(null)
(...skipping 2369 matching lines...) Expand 10 before | Expand all | Expand 10 after
3167 if (starToken == null) { 3166 if (starToken == null) {
3168 return AsyncMarker.Async; 3167 return AsyncMarker.Async;
3169 } else { 3168 } else {
3170 assert(identical(starToken.stringValue, "*")); 3169 assert(identical(starToken.stringValue, "*"));
3171 return AsyncMarker.AsyncStar; 3170 return AsyncMarker.AsyncStar;
3172 } 3171 }
3173 } else { 3172 } else {
3174 return internalError("Unknown async modifier: $asyncToken"); 3173 return internalError("Unknown async modifier: $asyncToken");
3175 } 3174 }
3176 } 3175 }
OLDNEW
« no previous file with comments | « no previous file | pkg/front_end/lib/src/fasta/kernel/kernel_outline_shaker.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698