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

Side by Side Diff: pkg/compiler/lib/src/universe/call_structure.dart

Issue 1414913002: Introduce .isMalformed (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Address review Created 5 years, 2 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/typechecker.dart ('k') | tests/compiler/dart2js/patch_test.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) 2015, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2015, 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.call_structure; 5 library dart2js.call_structure;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../common/names.dart' show 8 import '../common/names.dart' show
9 Identifiers, 9 Identifiers,
10 Names, 10 Names,
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after
179 * 179 *
180 * Returns [:true:] if the signature of the [caller] matches the 180 * Returns [:true:] if the signature of the [caller] matches the
181 * signature of the [callee], [:false:] otherwise. 181 * signature of the [callee], [:false:] otherwise.
182 */ 182 */
183 static /*<T>*/ bool addForwardingElementArgumentsToList( 183 static /*<T>*/ bool addForwardingElementArgumentsToList(
184 ConstructorElement caller, 184 ConstructorElement caller,
185 List/*<T>*/ list, 185 List/*<T>*/ list,
186 ConstructorElement callee, 186 ConstructorElement callee,
187 /*T*/ compileArgument(ParameterElement element), 187 /*T*/ compileArgument(ParameterElement element),
188 /*T*/ compileConstant(ParameterElement element)) { 188 /*T*/ compileConstant(ParameterElement element)) {
189 assert(invariant(caller, !callee.isErroneous, 189 assert(invariant(caller, !callee.isMalformed,
190 message: "Cannot compute arguments to erroneous constructor: " 190 message: "Cannot compute arguments to malformed constructor: "
191 "$caller calling $callee.")); 191 "$caller calling $callee."));
192 192
193 FunctionSignature signature = caller.functionSignature; 193 FunctionSignature signature = caller.functionSignature;
194 Map<Node, ParameterElement> mapping = <Node, ParameterElement>{}; 194 Map<Node, ParameterElement> mapping = <Node, ParameterElement>{};
195 195
196 // TODO(ngeoffray): This is a hack that fakes up AST nodes, so 196 // TODO(ngeoffray): This is a hack that fakes up AST nodes, so
197 // that we can call [addArgumentsToList]. 197 // that we can call [addArgumentsToList].
198 Link<Node> computeCallNodesFromParameters() { 198 Link<Node> computeCallNodesFromParameters() {
199 LinkBuilder<Node> builder = new LinkBuilder<Node>(); 199 LinkBuilder<Node> builder = new LinkBuilder<Node>();
200 signature.forEachRequiredParameter((ParameterElement element) { 200 signature.forEachRequiredParameter((ParameterElement element) {
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
283 return first.compareTo(second); 283 return first.compareTo(second);
284 }); 284 });
285 return _orderedNamedArguments; 285 return _orderedNamedArguments;
286 } 286 }
287 287
288 @override 288 @override
289 String structureToString() { 289 String structureToString() {
290 return 'arity=$argumentCount, named=[${namedArguments.join(', ')}]'; 290 return 'arity=$argumentCount, named=[${namedArguments.join(', ')}]';
291 } 291 }
292 } 292 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/typechecker.dart ('k') | tests/compiler/dart2js/patch_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698