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

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

Issue 26540002: Don't run main if library failed to import (Closed) Base URL: svn://svn.chromium.org/multivm/trunk/webkit
Patch Set: Created 7 years, 2 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/DartApplicationLoader.cpp
diff --git a/Source/bindings/dart/DartApplicationLoader.cpp b/Source/bindings/dart/DartApplicationLoader.cpp
index b95a191319c4a7f126210f81ff878f7ece6b4e37..0892f7e3bf0ae35391ee6d5521e08f820ec6be76 100644
--- a/Source/bindings/dart/DartApplicationLoader.cpp
+++ b/Source/bindings/dart/DartApplicationLoader.cpp
@@ -101,7 +101,11 @@ Dart_Handle DartApplicationLoader::libraryTagHandlerCallback(Dart_LibraryTag tag
Dart_Handle DartApplicationLoader::libraryTagHandler(Dart_LibraryTag tag, Dart_Handle library, Dart_Handle urlHandle, String url)
{
- ASSERT(m_asyncLoader->contains(url));
+ if (!m_asyncLoader->contains(url)) {
+ scriptLoadError(url);
+ return Dart_NewBoolean(false);
+ }
+
const String& source = m_asyncLoader->get(url);
Dart_Handle import;
@@ -111,6 +115,7 @@ Dart_Handle DartApplicationLoader::libraryTagHandler(Dart_LibraryTag tag, Dart_H
import = Dart_LoadSource(library, DartUtilities::stringToDartString(url), DartUtilities::convertSourceString(source));
} else {
ASSERT_NOT_REACHED();
+ m_scriptHasError = true;
DartUtilities::reportProblem(m_originDocument, "Invalid import tag");
return Dart_NewBoolean(false);
}
@@ -260,6 +265,7 @@ Dart_Handle DartApplicationLoader::topLevelLibrary()
void DartApplicationLoader::scriptLoadError(String failedUrl)
{
+ m_scriptHasError = true;
// FIXME: try to dig out line number, -1 for now.
if (failedUrl.startsWith(String("dart:"))) {
m_originDocument->logExceptionToConsole(String("The built-in library '") + failedUrl + String("' is not available on Dartium."), m_libraryUrl, -1, 0, 0);
« 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