OLD | NEW |
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 part of dart2js; | 5 part of dart2js; |
6 | 6 |
7 /** | 7 /** |
8 * If true, print a warning for each method that was resolved, but not | 8 * If true, print a warning for each method that was resolved, but not |
9 * compiled. | 9 * compiled. |
10 */ | 10 */ |
(...skipping 1533 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1544 } else { | 1544 } else { |
1545 internalError(main, 'Problem with $MAIN.'); | 1545 internalError(main, 'Problem with $MAIN.'); |
1546 } | 1546 } |
1547 mainFunction = backend.helperForBadMain(); | 1547 mainFunction = backend.helperForBadMain(); |
1548 } else if (!main.isFunction) { | 1548 } else if (!main.isFunction) { |
1549 errorElement = new ErroneousElementX( | 1549 errorElement = new ErroneousElementX( |
1550 MessageKind.MAIN_NOT_A_FUNCTION, {'main': MAIN}, MAIN, main); | 1550 MessageKind.MAIN_NOT_A_FUNCTION, {'main': MAIN}, MAIN, main); |
1551 mainFunction = backend.helperForBadMain(); | 1551 mainFunction = backend.helperForBadMain(); |
1552 } else { | 1552 } else { |
1553 mainFunction = main; | 1553 mainFunction = main; |
1554 FunctionSignature parameters = mainFunction.computeSignature(this); | 1554 mainFunction.computeType(this); |
| 1555 FunctionSignature parameters = mainFunction.functionSignature; |
1555 if (parameters.requiredParameterCount > 2) { | 1556 if (parameters.requiredParameterCount > 2) { |
1556 int index = 0; | 1557 int index = 0; |
1557 parameters.orderedForEachParameter((Element parameter) { | 1558 parameters.orderedForEachParameter((Element parameter) { |
1558 if (index++ < 2) return; | 1559 if (index++ < 2) return; |
1559 errorElement = new ErroneousElementX( | 1560 errorElement = new ErroneousElementX( |
1560 MessageKind.MAIN_WITH_EXTRA_PARAMETER, {'main': MAIN}, MAIN, | 1561 MessageKind.MAIN_WITH_EXTRA_PARAMETER, {'main': MAIN}, MAIN, |
1561 parameter); | 1562 parameter); |
1562 mainFunction = backend.helperForMainArity(); | 1563 mainFunction = backend.helperForMainArity(); |
1563 // Don't warn about main not being used: | 1564 // Don't warn about main not being used: |
1564 enqueuer.resolution.registerStaticUse(main); | 1565 enqueuer.resolution.registerStaticUse(main); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1713 metadata.ensureResolved(this); | 1714 metadata.ensureResolved(this); |
1714 } | 1715 } |
1715 } | 1716 } |
1716 } | 1717 } |
1717 } | 1718 } |
1718 | 1719 |
1719 void processQueue(Enqueuer world, Element main) { | 1720 void processQueue(Enqueuer world, Element main) { |
1720 world.nativeEnqueuer.processNativeClasses(libraryLoader.libraries); | 1721 world.nativeEnqueuer.processNativeClasses(libraryLoader.libraries); |
1721 if (main != null && !main.isErroneous) { | 1722 if (main != null && !main.isErroneous) { |
1722 FunctionElement mainMethod = main; | 1723 FunctionElement mainMethod = main; |
1723 if (mainMethod.computeSignature(this).parameterCount != 0) { | 1724 mainMethod.computeType(this); |
| 1725 if (mainMethod.functionSignature.parameterCount != 0) { |
1724 // The first argument could be a list of strings. | 1726 // The first argument could be a list of strings. |
1725 backend.listImplementation.ensureResolved(this); | 1727 backend.listImplementation.ensureResolved(this); |
1726 world.registerInstantiatedType( | 1728 world.registerInstantiatedType( |
1727 backend.listImplementation.rawType, globalDependencies); | 1729 backend.listImplementation.rawType, globalDependencies); |
1728 backend.stringImplementation.ensureResolved(this); | 1730 backend.stringImplementation.ensureResolved(this); |
1729 world.registerInstantiatedType( | 1731 world.registerInstantiatedType( |
1730 backend.stringImplementation.rawType, globalDependencies); | 1732 backend.stringImplementation.rawType, globalDependencies); |
1731 | 1733 |
1732 backend.registerMainHasArguments(world); | 1734 backend.registerMainHasArguments(world); |
1733 } | 1735 } |
(...skipping 774 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2508 InterfaceType streamType([DartType elementType]) { | 2510 InterfaceType streamType([DartType elementType]) { |
2509 InterfaceType type = streamClass.computeType(compiler); | 2511 InterfaceType type = streamClass.computeType(compiler); |
2510 if (elementType == null) { | 2512 if (elementType == null) { |
2511 return streamClass.rawType; | 2513 return streamClass.rawType; |
2512 } | 2514 } |
2513 return type.createInstantiation([elementType]); | 2515 return type.createInstantiation([elementType]); |
2514 } | 2516 } |
2515 } | 2517 } |
2516 | 2518 |
2517 typedef void InternalErrorFunction(Spannable location, String message); | 2519 typedef void InternalErrorFunction(Spannable location, String message); |
OLD | NEW |