Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(366)

Unified Diff: pkg/compiler/lib/src/common_elements.dart

Issue 2835323004: Handle @NoInline annotations in closed_world2_test (Closed)
Patch Set: Updated cf. comments Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/compiler/lib/src/inferrer/inferrer_engine.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/compiler/lib/src/common_elements.dart
diff --git a/pkg/compiler/lib/src/common_elements.dart b/pkg/compiler/lib/src/common_elements.dart
index ec727022f86e0355efd9ecdf62f9815b0e78ed40..e113ed2d908b37c0f38595b9b7f5d2a3076358cd 100644
--- a/pkg/compiler/lib/src/common_elements.dart
+++ b/pkg/compiler/lib/src/common_elements.dart
@@ -1085,6 +1085,50 @@ class CommonElements {
FunctionEntity get callInIsolate =>
_findLibraryMember(isolateHelperLibrary, '_callInIsolate');
+
+ static final Uri PACKAGE_EXPECT =
+ new Uri(scheme: 'package', path: 'expect/expect.dart');
+
+ bool _expectAnnotationChecked = false;
+ ClassEntity _expectNoInlineClass;
+ ClassEntity _expectTrustTypeAnnotationsClass;
+ ClassEntity _expectAssumeDynamicClass;
+
+ void _ensureExpectAnnotations() {
+ if (!_expectAnnotationChecked) {
+ _expectAnnotationChecked = true;
+ LibraryEntity library = _env.lookupLibrary(PACKAGE_EXPECT);
+ if (library != null) {
+ _expectNoInlineClass = _env.lookupClass(library, 'NoInline');
+ _expectTrustTypeAnnotationsClass =
+ _env.lookupClass(library, 'TrustTypeAnnotations');
+ _expectAssumeDynamicClass = _env.lookupClass(library, 'AssumeDynamic');
+ if (_expectNoInlineClass == null ||
+ _expectTrustTypeAnnotationsClass == null ||
+ _expectAssumeDynamicClass == null) {
+ // This is not the package you're looking for.
+ _expectNoInlineClass = null;
+ _expectTrustTypeAnnotationsClass = null;
+ _expectAssumeDynamicClass = null;
+ }
+ }
+ }
+ }
+
+ ClassEntity get expectNoInlineClass {
+ _ensureExpectAnnotations();
+ return _expectNoInlineClass;
+ }
+
+ ClassEntity get expectTrustTypeAnnotationsClass {
+ _ensureExpectAnnotations();
+ return _expectTrustTypeAnnotationsClass;
+ }
+
+ ClassEntity get expectAssumeDynamicClass {
+ _ensureExpectAnnotations();
+ return _expectAssumeDynamicClass;
+ }
}
/// Interface for accessing libraries, classes and members.
« no previous file with comments | « no previous file | pkg/compiler/lib/src/inferrer/inferrer_engine.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698