| 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 library dart2js.resolution.members; | 5 library dart2js.resolution.members; |
| 6 | 6 |
| 7 import 'package:front_end/src/fasta/scanner.dart' show isUserDefinableOperator; | 7 import 'package:front_end/src/fasta/scanner.dart' show isUserDefinableOperator; |
| 8 | 8 |
| 9 import '../common.dart'; | 9 import '../common.dart'; |
| 10 import '../common/names.dart' show Selectors; | 10 import '../common/names.dart' show Selectors; |
| (...skipping 3936 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3947 Node argumentNode = node.send.arguments.head; | 3947 Node argumentNode = node.send.arguments.head; |
| 3948 ConstantExpression constant = resolver.constantCompiler | 3948 ConstantExpression constant = resolver.constantCompiler |
| 3949 .compileNode(argumentNode, registry.mapping); | 3949 .compileNode(argumentNode, registry.mapping); |
| 3950 ConstantValue name = resolution.constants.getConstantValue(constant); | 3950 ConstantValue name = resolution.constants.getConstantValue(constant); |
| 3951 if (!name.isString) { | 3951 if (!name.isString) { |
| 3952 ResolutionDartType type = name.getType(commonElements); | 3952 ResolutionDartType type = name.getType(commonElements); |
| 3953 reporter.reportErrorMessage( | 3953 reporter.reportErrorMessage( |
| 3954 argumentNode, MessageKind.STRING_EXPECTED, {'type': type}); | 3954 argumentNode, MessageKind.STRING_EXPECTED, {'type': type}); |
| 3955 } else { | 3955 } else { |
| 3956 StringConstantValue stringConstant = name; | 3956 StringConstantValue stringConstant = name; |
| 3957 String nameString = stringConstant.toDartString().slowToString(); | 3957 String nameString = stringConstant.primitiveValue; |
| 3958 if (validateSymbol(argumentNode, nameString)) { | 3958 if (validateSymbol(argumentNode, nameString)) { |
| 3959 registry.registerConstSymbol(nameString); | 3959 registry.registerConstSymbol(nameString); |
| 3960 } | 3960 } |
| 3961 } | 3961 } |
| 3962 } else if (commonElements.isMirrorsUsedConstructor(constructor)) { | 3962 } else if (commonElements.isMirrorsUsedConstructor(constructor)) { |
| 3963 resolution.mirrorUsageAnalyzerTask.validate(node, registry.mapping); | 3963 resolution.mirrorUsageAnalyzerTask.validate(node, registry.mapping); |
| 3964 } | 3964 } |
| 3965 | 3965 |
| 3966 analyzeConstantDeferred(node); | 3966 analyzeConstantDeferred(node); |
| 3967 | 3967 |
| (...skipping 834 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4802 } | 4802 } |
| 4803 return const NoneResult(); | 4803 return const NoneResult(); |
| 4804 } | 4804 } |
| 4805 } | 4805 } |
| 4806 | 4806 |
| 4807 /// Looks up [name] in [scope] and unwraps the result. | 4807 /// Looks up [name] in [scope] and unwraps the result. |
| 4808 Element lookupInScope( | 4808 Element lookupInScope( |
| 4809 DiagnosticReporter reporter, Node node, Scope scope, String name) { | 4809 DiagnosticReporter reporter, Node node, Scope scope, String name) { |
| 4810 return Elements.unwrap(scope.lookup(name), reporter, node); | 4810 return Elements.unwrap(scope.lookup(name), reporter, node); |
| 4811 } | 4811 } |
| OLD | NEW |