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

Unified Diff: lib/runtime/dart_library.js

Issue 1486473002: Convert dart_utils.js to input_sdk/lib/_internal/utils.dart (#310) (Closed) Base URL: git@github.com:dart-lang/dev_compiler.git@master
Patch Set: Rebased Created 5 years 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 | « lib/runtime/dart/_utils.js ('k') | lib/runtime/dart_utils.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: lib/runtime/dart_library.js
diff --git a/lib/runtime/dart_library.js b/lib/runtime/dart_library.js
index 03d7bf612f946416f4c5cbc8d19e114124a6bbd2..12852bbf4dd5b8992eb274c679246f4eae7916ac 100644
--- a/lib/runtime/dart_library.js
+++ b/lib/runtime/dart_library.js
@@ -11,6 +11,11 @@ var dart_library =
(function (dart_library) {
'use strict';
+ /** Note that we cannot use dart_utils.throwInternalError from here. */
+ function throwLibraryError(message) {
+ throw Error(message);
+ }
+
// Module support. This is a simplified module system for Dart.
// Longer term, we can easily migrate to an existing JS module system:
// ES6, AMD, RequireJS, ....
@@ -48,7 +53,7 @@ var dart_library =
for (let name of list) {
let lib = libraries[name];
if (!lib) {
- dart_utils.throwInternalError('Library not available: ' + name);
+ throwLibraryError('Library not available: ' + name);
}
results.push(handler(lib));
}
@@ -58,7 +63,7 @@ var dart_library =
load(inheritedPendingSet) {
// Check for cycles
if (this._state == LibraryLoader.LOADING) {
- dart_utils.throwInternalError('Circular dependence on library: '
+ throwLibraryError('Circular dependence on library: '
+ this._name);
} else if (this._state >= LibraryLoader.LOADED) {
return this._library;
@@ -107,7 +112,7 @@ var dart_library =
let loader = libraries[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) dart_utils.throwInternalError('Library not found: ' + libraryName);
+ if (!loader) throwLibraryError('Library not found: ' + libraryName);
return loader.load();
}
dart_library.import = import_;
« no previous file with comments | « lib/runtime/dart/_utils.js ('k') | lib/runtime/dart_utils.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698