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

Side by Side Diff: pkg/compiler/lib/src/dart_backend/backend_ast_to_frontend_ast.dart

Issue 2000223002: Revert "Adjusts dart2js backend to handle method type arguments." (Closed) Base URL: https://github.com/dart-lang/sdk.git@master
Patch Set: Created 4 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 | « pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart ('k') | pkg/compiler/lib/src/dart_types.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) 2014, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2014, 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 dart_tree_printer; 5 library dart_tree_printer;
6 6
7 import '../common.dart'; 7 import '../common.dart';
8 import '../constants/values.dart' as values; 8 import '../constants/values.dart' as values;
9 import '../dart_types.dart' as types; 9 import '../dart_types.dart' as types;
10 import '../elements/elements.dart' as elements; 10 import '../elements/elements.dart' as elements;
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
488 tree.NodeList parameters = makeParameters(exp.parameters); 488 tree.NodeList parameters = makeParameters(exp.parameters);
489 tree.NodeList initializers = 489 tree.NodeList initializers =
490 exp.initializers == null || exp.initializers.isEmpty 490 exp.initializers == null || exp.initializers.isEmpty
491 ? null 491 ? null
492 : makeList(",", exp.initializers.map(makeExpression).toList()); 492 : makeList(",", exp.initializers.map(makeExpression).toList());
493 tree.Node body = exp.isConst || exp.body == null 493 tree.Node body = exp.isConst || exp.body == null
494 ? new tree.EmptyStatement(semicolon) 494 ? new tree.EmptyStatement(semicolon)
495 : makeFunctionBody(exp.body); 495 : makeFunctionBody(exp.body);
496 result = new tree.FunctionExpression( 496 result = new tree.FunctionExpression(
497 constructorName(exp), 497 constructorName(exp),
498 // GENERIC_METHODS: In order to support generic methods fully, 498 // TODO(eernst): retrieve and pass the actual type variables.
499 // we must retrieve and pass the actual type variables here.
500 null, // typeVariables 499 null, // typeVariables
501 parameters, 500 parameters,
502 body, 501 body,
503 null, // return type 502 null, // return type
504 makeFunctionModifiers(exp), 503 makeFunctionModifiers(exp),
505 initializers, 504 initializers,
506 null, // get/set 505 null, // get/set
507 null); // async modifier 506 null); // async modifier
508 setElement(result, exp.element, exp); 507 setElement(result, exp.element, exp);
509 } else if (exp is FunctionExpression) { 508 } else if (exp is FunctionExpression) {
510 precedence = PRIMARY; 509 precedence = PRIMARY;
511 if (beginStmt && exp.name != null) { 510 if (beginStmt && exp.name != null) {
512 needParen = true; // Do not mistake for function declaration. 511 needParen = true; // Do not mistake for function declaration.
513 } 512 }
514 Token getOrSet = exp.isGetter ? getToken : exp.isSetter ? setToken : null; 513 Token getOrSet = exp.isGetter ? getToken : exp.isSetter ? setToken : null;
515 tree.NodeList parameters = 514 tree.NodeList parameters =
516 exp.isGetter ? makeList("", []) : makeParameters(exp.parameters); 515 exp.isGetter ? makeList("", []) : makeParameters(exp.parameters);
517 tree.Node body = makeFunctionBody(exp.body); 516 tree.Node body = makeFunctionBody(exp.body);
518 result = new tree.FunctionExpression( 517 result = new tree.FunctionExpression(
519 functionName(exp), 518 functionName(exp),
520 // GENERIC_METHODS: In order to support generic methods fully, 519 // TODO(eernst): retrieve and pass the actual type variables.
521 // we must retrieve and pass the actual type variables here.
522 null, // typeVariables 520 null, // typeVariables
523 parameters, 521 parameters,
524 body, 522 body,
525 exp.returnType == null || exp.element.isConstructor 523 exp.returnType == null || exp.element.isConstructor
526 ? null 524 ? null
527 : makeType(exp.returnType), 525 : makeType(exp.returnType),
528 makeFunctionModifiers(exp), 526 makeFunctionModifiers(exp),
529 null, // initializers 527 null, // initializers
530 getOrSet, // get/set 528 getOrSet, // get/set
531 null); // async modifier 529 null); // async modifier
(...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
797 if (stmt.leftHandValue is Identifier) { 795 if (stmt.leftHandValue is Identifier) {
798 left = makeExpression(stmt.leftHandValue); 796 left = makeExpression(stmt.leftHandValue);
799 } else { 797 } else {
800 left = makeVariableDeclarations(stmt.leftHandValue); 798 left = makeVariableDeclarations(stmt.leftHandValue);
801 } 799 }
802 return new tree.SyncForIn(left, makeExpression(stmt.expression), 800 return new tree.SyncForIn(left, makeExpression(stmt.expression),
803 makeStatement(stmt.body, shortIf: shortIf), forToken, inToken); 801 makeStatement(stmt.body, shortIf: shortIf), forToken, inToken);
804 } else if (stmt is FunctionDeclaration) { 802 } else if (stmt is FunctionDeclaration) {
805 tree.FunctionExpression function = new tree.FunctionExpression( 803 tree.FunctionExpression function = new tree.FunctionExpression(
806 stmt.name != null ? makeIdentifier(stmt.name) : null, 804 stmt.name != null ? makeIdentifier(stmt.name) : null,
807 // GENERIC_METHODS: In order to support generic methods fully, 805 // TODO(eernst): retrieve and pass the actual type variables.
808 // we must retrieve and pass the actual type variables here.
809 null, // typeVariables 806 null, // typeVariables
810 makeParameters(stmt.parameters), 807 makeParameters(stmt.parameters),
811 makeFunctionBody(stmt.body), 808 makeFunctionBody(stmt.body),
812 stmt.returnType != null ? makeType(stmt.returnType) : null, 809 stmt.returnType != null ? makeType(stmt.returnType) : null,
813 makeEmptyModifiers(), 810 makeEmptyModifiers(),
814 null, // initializers 811 null, // initializers
815 null, // get/set 812 null, // get/set
816 null); // async modifier 813 null); // async modifier
817 setElement(function, stmt.function.element, stmt); 814 setElement(function, stmt.function.element, stmt);
818 return new tree.FunctionDeclaration(function); 815 return new tree.FunctionDeclaration(function);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
967 nodes.add(new tree.NodeList(open, makeLink(opt), close, ',')); 964 nodes.add(new tree.NodeList(open, makeLink(opt), close, ','));
968 } 965 }
969 return argList(nodes); 966 return argList(nodes);
970 } 967 }
971 968
972 /// [assignOperator] is used for writing the default value. 969 /// [assignOperator] is used for writing the default value.
973 tree.Node makeParameter(Parameter param, [Token assignOperator]) { 970 tree.Node makeParameter(Parameter param, [Token assignOperator]) {
974 if (param.isFunction) { 971 if (param.isFunction) {
975 tree.Node definition = new tree.FunctionExpression( 972 tree.Node definition = new tree.FunctionExpression(
976 makeIdentifier(param.name), 973 makeIdentifier(param.name),
977 // GENERIC_METHODS: In order to support generic methods fully, 974 // TODO(eernst): retrieve and pass the actual type variables.
978 // we must retrieve and pass the actual type variables here.
979 null, // typeVariables 975 null, // typeVariables
980 makeParameters(param.parameters), 976 makeParameters(param.parameters),
981 null, // body 977 null, // body
982 param.type == null ? null : makeType(param.type), 978 param.type == null ? null : makeType(param.type),
983 makeEmptyModifiers(), // TODO: Function parameter modifiers? 979 makeEmptyModifiers(), // TODO: Function parameter modifiers?
984 null, // initializers 980 null, // initializers
985 null, // get/set 981 null, // get/set
986 null); // async modifier 982 null); // async modifier
987 if (param.element != null) { 983 if (param.element != null) {
988 setElement(definition, param.element, param); 984 setElement(definition, param.element, param);
(...skipping 355 matching lines...) Expand 10 before | Expand all | Expand 10 after
1344 if (chunk.previous != null) { 1340 if (chunk.previous != null) {
1345 return new tree.StringJuxtaposition( 1341 return new tree.StringJuxtaposition(
1346 printStringChunk(chunk.previous), node); 1342 printStringChunk(chunk.previous), node);
1347 } else { 1343 } else {
1348 return node; 1344 return node;
1349 } 1345 }
1350 } 1346 }
1351 return printStringChunk(output.chunk); 1347 return printStringChunk(output.chunk);
1352 } 1348 }
1353 } 1349 }
OLDNEW
« no previous file with comments | « pkg/compiler/lib/src/cps_ir/cps_ir_builder.dart ('k') | pkg/compiler/lib/src/dart_types.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698