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

Unified Diff: Source/bindings/dart/DartDOMWrapper.cpp

Issue 490033005: Fallback to unsupported browser type instead of returning null (Closed) Base URL: svn://svn.chromium.org/blink/branches/dart/dartium
Patch Set: Address comments Created 6 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/bindings/dart/DartDOMWrapper.cpp
diff --git a/Source/bindings/dart/DartDOMWrapper.cpp b/Source/bindings/dart/DartDOMWrapper.cpp
index f73b9091e9978daef8fb4beadf3daee02d5e4c5e..70a6b843be95ec3b6ff570d8c116832b02b06d4f 100644
--- a/Source/bindings/dart/DartDOMWrapper.cpp
+++ b/Source/bindings/dart/DartDOMWrapper.cpp
@@ -74,8 +74,16 @@ Dart_PersistentHandle DartDOMWrapper::dartClass(
}
}
if ((searchid <= 0) || Dart_IsError(type) || !Dart_IsType(type) || Dart_IsNull(type)) {
- DartUtilities::reportProblem(domData->scriptExecutionContext(), type);
- return Dart_Null();
+ Dart_Handle error;
+ if (Dart_IsError(type)) {
+ error = type;
+ } else {
+ char message[256];
+ snprintf(message, 256, "Unsupported native browser type: %s", DartWebkitClassInfo[cid].jsName);
+ error = Dart_NewApiError(message);
+ }
+ DartUtilities::reportProblem(domData->scriptExecutionContext(), error);
+ type = Dart_GetType(htmlLibrary, Dart_NewStringFromCString("_UnsupportedBrowserObject"), 0, 0);
}
persistentType = Dart_NewPersistentHandle(type);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698