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

Unified Diff: lib/runtime/dart_utils.js

Issue 1298893003: Enable is and as checks on non-ground types (Closed) Base URL: https://github.com/dart-lang/dev_compiler.git@master
Patch Set: Minor fixes Created 5 years, 4 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: lib/runtime/dart_utils.js
diff --git a/lib/runtime/dart_utils.js b/lib/runtime/dart_utils.js
index a1c2bf9762b48b8a6ebae02a67a503018c3b7306..40f97f54a43cdff140dc8feed506d76dfe64b223 100644
--- a/lib/runtime/dart_utils.js
+++ b/lib/runtime/dart_utils.js
@@ -21,16 +21,28 @@ var dart_utils =
const slice = [].slice;
+ class StrongModeError extends Error {
+ constructor(message) {
+ super(message);
+ }
+ }
+
+ /** This error indicates a strong mode specific failure.
+ */
+ function throwStrongModeError(message) {
+ throw new StrongModeError(message);
+ }
+ dart_utils.throwStrongModeError = throwStrongModeError;
/** This error indicates a bug in the runtime or the compiler.
*/
- function throwError(message) {
+ function throwInternalError(message) {
throw Error(message);
}
- dart_utils.throwError = throwError;
+ dart_utils.throwInternalError = throwInternalError;
function assert(condition) {
- if (!condition) throwError("The compiler is broken: failed assert");
+ if (!condition) throwInternalError("The compiler is broken: failed assert");
}
dart_utils.assert = assert;
@@ -60,7 +72,7 @@ var dart_utils =
value = x;
}
function circularInitError() {
- throwError('circular initialization for field ' + name);
+ throwInternalError('circular initialization for field ' + name);
}
function lazyGetter() {
if (init == null) return value;

Powered by Google App Engine
This is Rietveld 408576698