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 import 'dart:collection'; | 5 import 'dart:collection'; |
6 | 6 |
7 import 'package:js_runtime/shared/embedded_names.dart'; | 7 import 'package:js_runtime/shared/embedded_names.dart'; |
8 | 8 |
9 import '../closure.dart'; | 9 import '../closure.dart'; |
10 import '../common.dart'; | 10 import '../common.dart'; |
(...skipping 3855 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3866 } | 3866 } |
3867 | 3867 |
3868 @override | 3868 @override |
3869 void bulkHandleNode(ast.Node node, String message, _) { | 3869 void bulkHandleNode(ast.Node node, String message, _) { |
3870 internalError(node, "Unexpected bulk handled node: $node"); | 3870 internalError(node, "Unexpected bulk handled node: $node"); |
3871 } | 3871 } |
3872 | 3872 |
3873 @override | 3873 @override |
3874 void bulkHandleNew(ast.NewExpression node, [_]) { | 3874 void bulkHandleNew(ast.NewExpression node, [_]) { |
3875 Element element = elements[node.send]; | 3875 Element element = elements[node.send]; |
3876 final bool isSymbolConstructor = | |
3877 element == commonElements.symbolConstructor; | |
3878 if (!Elements.isMalformed(element)) { | 3876 if (!Elements.isMalformed(element)) { |
3879 ConstructorElement function = element; | 3877 ConstructorElement function = element; |
3880 element = function.effectiveTarget; | 3878 element = function.effectiveTarget; |
3881 } | 3879 } |
| 3880 final bool isSymbolConstructor = |
| 3881 element == commonElements.symbolConstructorTarget; |
3882 if (Elements.isError(element)) { | 3882 if (Elements.isError(element)) { |
3883 ErroneousElement error = element; | 3883 ErroneousElement error = element; |
3884 if (error.messageKind == MessageKind.CANNOT_FIND_CONSTRUCTOR || | 3884 if (error.messageKind == MessageKind.CANNOT_FIND_CONSTRUCTOR || |
3885 error.messageKind == MessageKind.CANNOT_FIND_UNNAMED_CONSTRUCTOR) { | 3885 error.messageKind == MessageKind.CANNOT_FIND_UNNAMED_CONSTRUCTOR) { |
3886 generateThrowNoSuchMethod( | 3886 generateThrowNoSuchMethod( |
3887 node.send, noSuchMethodTargetSymbolString(error, 'constructor'), | 3887 node.send, noSuchMethodTargetSymbolString(error, 'constructor'), |
3888 argumentNodes: node.send.arguments); | 3888 argumentNodes: node.send.arguments); |
3889 } else { | 3889 } else { |
3890 MessageTemplate template = MessageTemplate.TEMPLATES[error.messageKind]; | 3890 MessageTemplate template = MessageTemplate.TEMPLATES[error.messageKind]; |
3891 Message message = template.message(error.messageArguments); | 3891 Message message = template.message(error.messageArguments); |
(...skipping 2849 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6741 this.oldReturnLocal, | 6741 this.oldReturnLocal, |
6742 this.oldReturnType, | 6742 this.oldReturnType, |
6743 this.oldResolvedAst, | 6743 this.oldResolvedAst, |
6744 this.oldStack, | 6744 this.oldStack, |
6745 this.oldLocalsHandler, | 6745 this.oldLocalsHandler, |
6746 this.inTryStatement, | 6746 this.inTryStatement, |
6747 this.allFunctionsCalledOnce, | 6747 this.allFunctionsCalledOnce, |
6748 this.oldElementInferenceResults) | 6748 this.oldElementInferenceResults) |
6749 : super(function); | 6749 : super(function); |
6750 } | 6750 } |
OLD | NEW |