OLD | NEW |
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 import 'package:front_end/src/fasta/scanner.dart' show StringToken, Token; | 5 import 'package:front_end/src/fasta/scanner.dart' show StringToken, Token; |
6 import 'package:front_end/src/fasta/scanner.dart' as Tokens show EOF_TOKEN; | 6 import 'package:front_end/src/fasta/scanner.dart' as Tokens show EOF_TOKEN; |
7 import 'package:front_end/src/scanner/token.dart' show BeginToken; | 7 import 'package:front_end/src/scanner/token.dart' show BeginToken; |
8 | 8 |
9 import '../common.dart'; | 9 import '../common.dart'; |
10 import '../common_elements.dart' show CommonElements, ElementEnvironment; | 10 import '../common_elements.dart' show CommonElements, ElementEnvironment; |
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
210 } | 210 } |
211 | 211 |
212 class NativeDataResolverImpl extends NativeMemberResolverBase | 212 class NativeDataResolverImpl extends NativeMemberResolverBase |
213 implements NativeDataResolver { | 213 implements NativeDataResolver { |
214 final Compiler _compiler; | 214 final Compiler _compiler; |
215 | 215 |
216 NativeDataResolverImpl(this._compiler); | 216 NativeDataResolverImpl(this._compiler); |
217 | 217 |
218 JavaScriptBackend get _backend => _compiler.backend; | 218 JavaScriptBackend get _backend => _compiler.backend; |
219 DiagnosticReporter get _reporter => _compiler.reporter; | 219 DiagnosticReporter get _reporter => _compiler.reporter; |
220 ElementEnvironment get elementEnvironment => _compiler.elementEnvironment; | 220 ElementEnvironment get elementEnvironment => |
| 221 _compiler.resolution.elementEnvironment; |
221 CommonElements get commonElements => _compiler.resolution.commonElements; | 222 CommonElements get commonElements => _compiler.resolution.commonElements; |
222 NativeBasicData get nativeBasicData => _backend.nativeBasicData; | 223 NativeBasicData get nativeBasicData => _backend.nativeBasicData; |
223 NativeDataBuilder get nativeDataBuilder => _backend.nativeDataBuilder; | 224 NativeDataBuilder get nativeDataBuilder => _backend.nativeDataBuilder; |
224 | 225 |
225 @override | 226 @override |
226 bool isJsInteropMember(MemberElement element) { | 227 bool isJsInteropMember(MemberElement element) { |
227 // TODO(johnniwinther): Avoid computing this twice for external function; | 228 // TODO(johnniwinther): Avoid computing this twice for external function; |
228 // once from JavaScriptBackendTarget.resolveExternalFunction and once | 229 // once from JavaScriptBackendTarget.resolveExternalFunction and once |
229 // through JavaScriptBackendTarget.resolveNativeMember. | 230 // through JavaScriptBackendTarget.resolveNativeMember. |
230 bool isJsInterop = | 231 bool isJsInterop = |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
616 | 617 |
617 Iterable<ConstantValue> fields = constructedObject.fields.values; | 618 Iterable<ConstantValue> fields = constructedObject.fields.values; |
618 // TODO(sra): Better validation of the constant. | 619 // TODO(sra): Better validation of the constant. |
619 if (fields.length != 1 || fields.single is! StringConstantValue) { | 620 if (fields.length != 1 || fields.single is! StringConstantValue) { |
620 throw new SpannableAssertionFailure( | 621 throw new SpannableAssertionFailure( |
621 spannable, 'Annotations needs one string: ${value.toStructuredText()}'); | 622 spannable, 'Annotations needs one string: ${value.toStructuredText()}'); |
622 } | 623 } |
623 StringConstantValue specStringConstant = fields.single; | 624 StringConstantValue specStringConstant = fields.single; |
624 return specStringConstant.primitiveValue; | 625 return specStringConstant.primitiveValue; |
625 } | 626 } |
OLD | NEW |