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

Side by Side Diff: pkg/compiler/lib/src/js_backend/checked_mode_helpers.dart

Issue 2598983002: Introduce DartType super hierarchy based on Entity (Closed)
Patch Set: Updated cf. comments. Created 3 years, 11 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 | « pkg/compiler/lib/src/elements/types.dart ('k') | pkg/compiler/lib/src/ssa/codegen.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 import '../compiler.dart' show Compiler; 5 import '../compiler.dart' show Compiler;
6 import '../dart_types.dart'; 6 import '../dart_types.dart';
7 import '../elements/elements.dart'; 7 import '../elements/elements.dart';
8 import '../js/js.dart' as jsAst; 8 import '../js/js.dart' as jsAst;
9 import '../js/js.dart' show js; 9 import '../js/js.dart' show js;
10 import '../ssa/codegen.dart' show SsaCodeGenerator; 10 import '../ssa/codegen.dart' show SsaCodeGenerator;
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 ]; 82 ];
83 } 83 }
84 84
85 class MalformedCheckedModeHelper extends CheckedModeHelper { 85 class MalformedCheckedModeHelper extends CheckedModeHelper {
86 const MalformedCheckedModeHelper(String name) : super(name); 86 const MalformedCheckedModeHelper(String name) : super(name);
87 87
88 CallStructure get callStructure => CallStructure.TWO_ARGS; 88 CallStructure get callStructure => CallStructure.TWO_ARGS;
89 89
90 void generateAdditionalArguments(SsaCodeGenerator codegen, 90 void generateAdditionalArguments(SsaCodeGenerator codegen,
91 HTypeConversion node, List<jsAst.Expression> arguments) { 91 HTypeConversion node, List<jsAst.Expression> arguments) {
92 ErroneousElement element = node.typeExpression.element; 92 MalformedType type = node.typeExpression;
93 ErroneousElement element = type.element;
93 arguments.add(js.escapedString(element.message)); 94 arguments.add(js.escapedString(element.message));
94 } 95 }
95 } 96 }
96 97
97 class PropertyCheckedModeHelper extends CheckedModeHelper { 98 class PropertyCheckedModeHelper extends CheckedModeHelper {
98 const PropertyCheckedModeHelper(String name) : super(name); 99 const PropertyCheckedModeHelper(String name) : super(name);
99 100
100 CallStructure get callStructure => CallStructure.TWO_ARGS; 101 CallStructure get callStructure => CallStructure.TWO_ARGS;
101 102
102 void generateAdditionalArguments(SsaCodeGenerator codegen, 103 void generateAdditionalArguments(SsaCodeGenerator codegen,
(...skipping 27 matching lines...) Expand all
130 DartType type = node.typeExpression; 131 DartType type = node.typeExpression;
131 Element element = type.element; 132 Element element = type.element;
132 jsAst.Name isField = codegen.backend.namer.operatorIs(element); 133 jsAst.Name isField = codegen.backend.namer.operatorIs(element);
133 arguments.add(js.quoteName(isField)); 134 arguments.add(js.quoteName(isField));
134 codegen.use(node.typeRepresentation); 135 codegen.use(node.typeRepresentation);
135 arguments.add(codegen.pop()); 136 arguments.add(codegen.pop());
136 jsAst.Name asField = codegen.backend.namer.substitutionName(element); 137 jsAst.Name asField = codegen.backend.namer.substitutionName(element);
137 arguments.add(js.quoteName(asField)); 138 arguments.add(js.quoteName(asField));
138 } 139 }
139 } 140 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/elements/types.dart ('k') | pkg/compiler/lib/src/ssa/codegen.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698