| Index: Source/bindings/dart/DartApplicationLoader.cpp
|
| diff --git a/Source/bindings/dart/DartApplicationLoader.cpp b/Source/bindings/dart/DartApplicationLoader.cpp
|
| index 7f8ef4ccba352ad945b132cc9479bb035eb2cc31..14e34df87ae6fa29a56e588f05b1ce927630f36d 100644
|
| --- a/Source/bindings/dart/DartApplicationLoader.cpp
|
| +++ b/Source/bindings/dart/DartApplicationLoader.cpp
|
| @@ -180,10 +180,15 @@ void DartApplicationLoader::loadMainScript(const String& url, const String& sour
|
| }
|
| ASSERT(!Dart_IsNull(script));
|
|
|
| - // FIXME(dartbug.com/13460): We need to record the lineOffset and columnOffset.
|
| - Dart_Handle library = Dart_LoadLibrary(DartUtilities::stringToDartString(url), dartSource);
|
| - if (Dart_IsError(library))
|
| - DartUtilities::reportProblem(m_originDocument, library, m_libraryUrl);
|
| + Dart_Handle libraryUrlHandle = DartUtilities::stringToDartString(url);
|
| + // Test if a previous script already loaded this library.
|
| + Dart_Handle library = Dart_LookupLibrary(libraryUrlHandle);
|
| + if (Dart_IsError(library)) {
|
| + // FIXME(dartbug.com/13460): We need to record the lineOffset and columnOffset.
|
| + library = Dart_LoadLibrary(libraryUrlHandle, dartSource);
|
| + if (Dart_IsError(library))
|
| + DartUtilities::reportProblem(m_originDocument, library, m_libraryUrl);
|
| + }
|
|
|
| Dart_Handle result = Dart_LibraryImportLibrary(script, library, Dart_Null());
|
| if (Dart_IsError(result))
|
|
|