OLD | NEW |
1 // Copyright (c) 2016, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2016, 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 fasta.target_implementation; | 5 library fasta.target_implementation; |
6 | 6 |
7 import 'package:kernel/target/targets.dart' as backend show Target; | 7 import 'package:kernel/target/targets.dart' as backend show Target; |
8 | 8 |
9 import 'builder/builder.dart' show Builder, ClassBuilder, LibraryBuilder; | 9 import 'builder/builder.dart' show Builder, ClassBuilder, LibraryBuilder; |
10 | 10 |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 } | 71 } |
72 return cachedAbstractClassInstantiationError = | 72 return cachedAbstractClassInstantiationError = |
73 loader.coreLibrary.getConstructor("AbstractClassInstantiationError"); | 73 loader.coreLibrary.getConstructor("AbstractClassInstantiationError"); |
74 } | 74 } |
75 | 75 |
76 /// Returns a reference to the constructor used for creating `native` | 76 /// Returns a reference to the constructor used for creating `native` |
77 /// annotations. The constructor is expected to accept a single argument of | 77 /// annotations. The constructor is expected to accept a single argument of |
78 /// type String, which is the name of the native method. | 78 /// type String, which is the name of the native method. |
79 Builder getNativeAnnotation(Loader loader) { | 79 Builder getNativeAnnotation(Loader loader) { |
80 if (cachedNativeAnnotation != null) return cachedNativeAnnotation; | 80 if (cachedNativeAnnotation != null) return cachedNativeAnnotation; |
81 LibraryBuilder internal = loader.read(Uri.parse("dart:_internal")); | 81 LibraryBuilder internal = loader.read(Uri.parse("dart:_internal"), -1); |
82 return cachedNativeAnnotation = internal.getConstructor("ExternalName"); | 82 return cachedNativeAnnotation = internal.getConstructor("ExternalName"); |
83 } | 83 } |
84 | 84 |
85 void loadExtraRequiredLibraries(Loader loader) { | 85 void loadExtraRequiredLibraries(Loader loader) { |
86 for (String uri in backendTarget.extraRequiredLibraries) { | 86 for (String uri in backendTarget.extraRequiredLibraries) { |
87 loader.read(Uri.parse(uri)); | 87 loader.read(Uri.parse(uri), -1); |
88 } | 88 } |
89 } | 89 } |
90 | 90 |
91 Token skipNativeClause(Token token) => vm.skipNativeClause(token); | 91 Token skipNativeClause(Token token) => vm.skipNativeClause(token); |
92 | 92 |
93 String extractNativeMethodName(Token token) => | 93 String extractNativeMethodName(Token token) => |
94 unescapeString(token.next.lexeme); | 94 unescapeString(token.next.lexeme); |
95 | 95 |
96 void addSourceInformation( | 96 void addSourceInformation( |
97 Uri uri, List<int> lineStarts, List<int> sourceCode); | 97 Uri uri, List<int> lineStarts, List<int> sourceCode); |
98 } | 98 } |
OLD | NEW |