Index: src/inspector/InjectedScript.cpp |
diff --git a/src/inspector/InjectedScript.cpp b/src/inspector/InjectedScript.cpp |
index ebd26ece673bb1c0dffe526be29082e9b600b650..5b1b2b1b6d34316b8999434bd90183531aefb7d6 100644 |
--- a/src/inspector/InjectedScript.cpp |
+++ b/src/inspector/InjectedScript.cpp |
@@ -144,10 +144,10 @@ void InjectedScript::getProperties( |
*properties = Array<PropertyDescriptor>::create(); |
return; |
} |
- |
+ if (hasInternalError(errorString, resultValue.IsEmpty())) return; |
std::unique_ptr<protocol::Value> protocolValue = |
- toProtocolValue(context, resultValue); |
- if (hasInternalError(errorString, !protocolValue)) return; |
+ toProtocolValue(errorString, context, resultValue); |
+ if (!protocolValue) return; |
protocol::ErrorSupport errors(errorString); |
std::unique_ptr<Array<PropertyDescriptor>> result = |
Array<PropertyDescriptor>::parse(protocolValue.get(), &errors); |
@@ -178,10 +178,12 @@ std::unique_ptr<protocol::Runtime::RemoteObject> InjectedScript::wrapObject( |
.ToLocal(&wrappedObject)) |
return nullptr; |
protocol::ErrorSupport errors; |
+ std::unique_ptr<protocol::Value> protocolValue = |
+ toProtocolValue(errorString, context, wrappedObject); |
+ if (!protocolValue) return nullptr; |
std::unique_ptr<protocol::Runtime::RemoteObject> remoteObject = |
- protocol::Runtime::RemoteObject::parse( |
- toProtocolValue(context, wrappedObject).get(), &errors); |
- if (!remoteObject) *errorString = "Object has too long reference chain"; |
+ protocol::Runtime::RemoteObject::parse(protocolValue.get(), &errors); |
+ if (!remoteObject) *errorString = errors.errors(); |
return remoteObject; |
} |
@@ -272,10 +274,13 @@ std::unique_ptr<protocol::Runtime::RemoteObject> InjectedScript::wrapTable( |
function.appendArgument(columns); |
bool hadException = false; |
v8::Local<v8::Value> r = function.call(hadException); |
- if (hadException) return nullptr; |
+ if (hadException || r.IsEmpty()) return nullptr; |
+ protocol::ErrorString errorString; |
+ std::unique_ptr<protocol::Value> protocolValue = |
+ toProtocolValue(&errorString, context, r); |
+ if (!protocolValue) return nullptr; |
protocol::ErrorSupport errors; |
- return protocol::Runtime::RemoteObject::parse( |
- toProtocolValue(context, r).get(), &errors); |
+ return protocol::Runtime::RemoteObject::parse(protocolValue.get(), &errors); |
} |
bool InjectedScript::findObject(ErrorString* errorString, |