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

Side by Side Diff: pkg/compiler/lib/src/closure.dart

Issue 1325843003: Add optional message to assert in Dart2js. (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Reintroduce assertHelper for asserts without messages. Created 5 years, 3 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) 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 library closureToClassMapper; 5 library closureToClassMapper;
6 6
7 import 'common/names.dart' show 7 import 'common/names.dart' show
8 Identifiers; 8 Identifiers;
9 import 'common/tasks.dart' show 9 import 'common/tasks.dart' show
10 CompilerTask; 10 CompilerTask;
(...skipping 768 matching lines...) Expand 10 before | Expand all | Expand 10 after
779 } else if (node.isTypeTest || node.isTypeCast) { 779 } else if (node.isTypeTest || node.isTypeCast) {
780 TypeAnnotation annotation = node.typeAnnotationFromIsCheckOrCast; 780 TypeAnnotation annotation = node.typeAnnotationFromIsCheckOrCast;
781 DartType type = elements.getType(annotation); 781 DartType type = elements.getType(annotation);
782 analyzeType(type); 782 analyzeType(type);
783 } else if (node.isTypeTest) { 783 } else if (node.isTypeTest) {
784 DartType type = elements.getType(node.typeAnnotationFromIsCheckOrCast); 784 DartType type = elements.getType(node.typeAnnotationFromIsCheckOrCast);
785 analyzeType(type); 785 analyzeType(type);
786 } else if (node.isTypeCast) { 786 } else if (node.isTypeCast) {
787 DartType type = elements.getType(node.arguments.head); 787 DartType type = elements.getType(node.arguments.head);
788 analyzeType(type); 788 analyzeType(type);
789 } else if (elements.isAssert(node) && !compiler.enableUserAssertions) {
790 return;
791 } 789 }
792 node.visitChildren(this); 790 node.visitChildren(this);
793 } 791 }
794 792
795 visitSendSet(SendSet node) { 793 visitSendSet(SendSet node) {
796 Element element = elements[node]; 794 Element element = elements[node];
797 if (Elements.isLocal(element)) { 795 if (Elements.isLocal(element)) {
798 mutatedVariables.add(element); 796 mutatedVariables.add(element);
799 if (compiler.enableTypeAssertions) { 797 if (compiler.enableTypeAssertions) {
800 TypedElement typedElement = element; 798 TypedElement typedElement = element;
(...skipping 321 matching lines...) Expand 10 before | Expand all | Expand 10 after
1122 1120
1123 String get name => typeVariable.name; 1121 String get name => typeVariable.name;
1124 1122
1125 int get hashCode => typeVariable.hashCode; 1123 int get hashCode => typeVariable.hashCode;
1126 1124
1127 bool operator ==(other) { 1125 bool operator ==(other) {
1128 if (other is! TypeVariableLocal) return false; 1126 if (other is! TypeVariableLocal) return false;
1129 return typeVariable == other.typeVariable; 1127 return typeVariable == other.typeVariable;
1130 } 1128 }
1131 } 1129 }
OLDNEW
« no previous file with comments | « no previous file | pkg/compiler/lib/src/common/backend_api.dart » ('j') | sdk/lib/_internal/js_runtime/lib/js_helper.dart » ('J')

Powered by Google App Engine
This is Rietveld 408576698