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

Unified Diff: pkg/dev_compiler/lib/js/legacy/dart_library.js

Issue 2954523002: fix #27259, implement covariance checking for strong mode and DDC (Closed)
Patch Set: merged and fix an analysis error Created 3 years, 5 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
Index: pkg/dev_compiler/lib/js/legacy/dart_library.js
diff --git a/pkg/dev_compiler/lib/js/legacy/dart_library.js b/pkg/dev_compiler/lib/js/legacy/dart_library.js
index 3ffbda294e5869cd926308f9e059a3381ae26bd4..114149595130c37837c0dfb79eafda1e20d99379 100644
--- a/pkg/dev_compiler/lib/js/legacy/dart_library.js
+++ b/pkg/dev_compiler/lib/js/legacy/dart_library.js
@@ -76,7 +76,11 @@ dart_library =
loadImports() {
let results = [];
for (let name of this._imports) {
- results.push(import_(name));
+ let lib = libraries.get(name);
+ if (!lib) {
+ throwLibraryError('Library not available: ' + name);
+ }
+ results.push(lib.load());
}
return results;
}
@@ -166,6 +170,14 @@ dart_library =
}
dart_library.library = library;
+<<<<<<< HEAD
+ function import_(libraryName) {
+ let loader = libraries.get(libraryName);
+ // TODO(vsm): A user might call this directly from JS (as we do in tests).
+ // We may want a different error type.
+ if (!loader) throwLibraryError('Library not found: ' + libraryName);
+ return loader.load();
+=======
// Maintain a stack of active imports. If a requested library/module is not
// available, print the stack to show where/how it was requested.
let _stack = [];
@@ -187,6 +199,7 @@ dart_library =
let result = lib.load();
_stack.pop();
return result;
+>>>>>>> origin/master
}
dart_library.import = import_;
« no previous file with comments | « pkg/analyzer/test/generated/strong_mode_test.dart ('k') | pkg/dev_compiler/lib/src/compiler/code_generator.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698