summaryrefslogtreecommitdiffstats
path: root/WebCore/bindings/js/ScriptArray.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'WebCore/bindings/js/ScriptArray.cpp')
-rw-r--r--WebCore/bindings/js/ScriptArray.cpp15
1 files changed, 15 insertions, 0 deletions
diff --git a/WebCore/bindings/js/ScriptArray.cpp b/WebCore/bindings/js/ScriptArray.cpp
index caecc40..119d303 100644
--- a/WebCore/bindings/js/ScriptArray.cpp
+++ b/WebCore/bindings/js/ScriptArray.cpp
@@ -31,6 +31,8 @@
#include "config.h"
#include "ScriptArray.h"
+#include "SerializedScriptValue.h"
+
#include <runtime/JSLock.h>
using namespace JSC;
@@ -62,6 +64,19 @@ bool ScriptArray::set(unsigned index, const ScriptObject& value)
return handleException(m_scriptState);
}
+bool ScriptArray::set(unsigned index, SerializedScriptValue* value)
+{
+ ScriptValue scriptValue = ScriptValue::deserialize(m_scriptState, value);
+ if (scriptValue.hasNoValue()) {
+ ASSERT_NOT_REACHED();
+ return false;
+ }
+
+ JSLock lock(SilenceAssertionsOnly);
+ jsArray()->put(m_scriptState, index, scriptValue.jsValue());
+ return handleException(m_scriptState);
+}
+
bool ScriptArray::set(unsigned index, const String& value)
{
JSLock lock(SilenceAssertionsOnly);