Index: runtime/lib/errors_patch.dart |
diff --git a/runtime/lib/errors_patch.dart b/runtime/lib/errors_patch.dart |
index 01920edd28e08ec35df5ffa4d64db1df69fb9e07..59a61ec4bb9238f98da38db0bd605b63a7c3c224 100644 |
--- a/runtime/lib/errors_patch.dart |
+++ b/runtime/lib/errors_patch.dart |
@@ -57,6 +57,18 @@ class _TypeError extends _AssertionError implements TypeError { |
String error_msg) |
native "TypeError_throwNew"; |
+ static _throwNewIfNotLoaded(_LibraryPrefix prefix, |
+ int location, |
+ Object src_value, |
+ String dst_type_name, |
+ String dst_name, |
+ String error_msg) { |
+ if (!prefix.isLoaded()) { |
+ _throwNew(location, src_value, dst_type_name, dst_name, error_msg); |
+ } |
+ } |
+ |
+ |
String toString() { |
String str = (_errorMsg != null) ? _errorMsg : ""; |
if ((_dstName != null) && (_dstName.length > 0)) { |
@@ -181,6 +193,19 @@ patch class NoSuchMethodError { |
existingArgumentNames); |
} |
+ static void _throwNewIfNotLoaded(_LibraryPrefix prefix, |
+ Object receiver, |
+ String memberName, |
+ int invocation_type, |
+ List arguments, |
+ List argumentNames, |
+ List existingArgumentNames) { |
+ if (!prefix.isLoaded()) { |
+ _throwNew(receiver, memberName, invocation_type, arguments, |
+ argumentNames, existingArgumentNames); |
+ } |
+ } |
+ |
// Remember the type from the invocation mirror or static compilation |
// analysis when thrown directly with _throwNew. A negative value means |
// that no information is available. |