| Index: Source/bindings/dart/DartUtilities.cpp
|
| diff --git a/Source/bindings/dart/DartUtilities.cpp b/Source/bindings/dart/DartUtilities.cpp
|
| index 04eadb97724e6c11a5924d0486bf0671123335f9..b2586d4a078632dca3da59d148c1a076572b0d37 100644
|
| --- a/Source/bindings/dart/DartUtilities.cpp
|
| +++ b/Source/bindings/dart/DartUtilities.cpp
|
| @@ -65,6 +65,7 @@ namespace WebCore {
|
|
|
| const char* DartUtilities::htmlLibraryName = "dart:html";
|
| const char* DartUtilities::indexedDBLibraryName = "dart:indexed_db";
|
| +const char* DartUtilities::svgLibraryName = "dart:svg";
|
|
|
| static void stringFinalizer(void* peer)
|
| {
|
| @@ -376,6 +377,28 @@ bool DartUtilities::objectIsType(Dart_Handle handle, const char* libraryName, co
|
| return isType;
|
| }
|
|
|
| +bool DartUtilities::isTypeSubclassOf(Dart_Handle type, const char* libraryName, const char* typeName)
|
| +{
|
| + Dart_Handle library = libraryForCurrentIsolate(libraryName);
|
| + ASSERT(!Dart_IsError(library));
|
| +
|
| + Dart_Handle other = Dart_GetType(library, Dart_NewStringFromCString(typeName), 0, 0);
|
| + ASSERT(!Dart_IsError(other));
|
| +
|
| + Dart_Handle args[2] = { type, other };
|
| + Dart_Handle result = DartUtilities::invokeUtilsMethod("isTypeSubclassOf", 2, args);
|
| + ASSERT(!Dart_IsError(result));
|
| + if (Dart_IsError(result))
|
| + return false;
|
| +
|
| + Dart_Handle exception = 0;
|
| + bool boolResult = dartToBool(result, exception);
|
| + if (exception) {
|
| + return false;
|
| + }
|
| + return boolResult;
|
| +}
|
| +
|
| bool DartUtilities::isTypedData(Dart_Handle handle)
|
| {
|
| return Dart_GetTypeOfTypedData(handle) != Dart_TypedData_kInvalid || Dart_GetTypeOfExternalTypedData(handle) != Dart_TypedData_kInvalid;
|
|
|