<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[46410] trunk/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/46410">46410</a></dd>
<dt>Author</dt> <dd>pfeldman@chromium.org</dd>
<dt>Date</dt> <dd>2009-07-27 02:06:55 -0700 (Mon, 27 Jul 2009)</dd>
</dl>

<h3>Log Message</h3>
<pre>2009-07-27  Pavel Feldman  &lt;pfeldman@chromium.org&gt;

        Reviewed by Timothy Hatcher.

        WebCore bindings: Implement ScriptArray bindings.

        https://bugs.webkit.org/show_bug.cgi?id=27691

        * GNUmakefile.am:
        * WebCore.gypi:
        * WebCore.pro:
        * WebCore.vcproj/WebCore.vcproj:
        * WebCore.xcodeproj/project.pbxproj:
        * bindings/js/ScriptArray.cpp: Added.
        (WebCore::ScriptArray::ScriptArray):
        (WebCore::handleException):
        (WebCore::ScriptArray::set):
        (WebCore::length):
        (WebCore::ScriptArray::createNew):
        * bindings/js/ScriptArray.h: Added.
        (WebCore::ScriptArray::ScriptArray):
        (WebCore::ScriptArray::jsArray):
        * bindings/v8/ScriptArray.cpp: Added.
        (WebCore::ScriptArray::ScriptArray):
        (WebCore::ScriptArray::set):
        (WebCore::ScriptArray::length):
        (WebCore::ScriptArray::createNew):
        * bindings/v8/ScriptArray.h: Added.
        (WebCore::ScriptArray::ScriptArray):
        (WebCore::ScriptArray::~ScriptArray):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkWebCoreChangeLog">trunk/WebCore/ChangeLog</a></li>
<li><a href="#trunkWebCoreGNUmakefileam">trunk/WebCore/GNUmakefile.am</a></li>
<li><a href="#trunkWebCoreWebCoregypi">trunk/WebCore/WebCore.gypi</a></li>
<li><a href="#trunkWebCoreWebCorepro">trunk/WebCore/WebCore.pro</a></li>
<li><a href="#trunkWebCoreWebCorevcprojWebCorevcproj">trunk/WebCore/WebCore.vcproj/WebCore.vcproj</a></li>
<li><a href="#trunkWebCoreWebCorexcodeprojprojectpbxproj">trunk/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkWebCorebindingsjsScriptArraycpp">trunk/WebCore/bindings/js/ScriptArray.cpp</a></li>
<li><a href="#trunkWebCorebindingsjsScriptArrayh">trunk/WebCore/bindings/js/ScriptArray.h</a></li>
<li><a href="#trunkWebCorebindingsv8ScriptArraycpp">trunk/WebCore/bindings/v8/ScriptArray.cpp</a></li>
<li><a href="#trunkWebCorebindingsv8ScriptArrayh">trunk/WebCore/bindings/v8/ScriptArray.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/ChangeLog (46409 => 46410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/ChangeLog        2009-07-27 07:17:48 UTC (rev 46409)
+++ trunk/WebCore/ChangeLog        2009-07-27 09:06:55 UTC (rev 46410)
</span><span class="lines">@@ -1,3 +1,34 @@
</span><ins>+2009-07-27  Pavel Feldman  &lt;pfeldman@chromium.org&gt;
+
+        Reviewed by Timothy Hatcher.
+
+        WebCore bindings: Implement ScriptArray bindings.
+
+        https://bugs.webkit.org/show_bug.cgi?id=27691
+
+        * GNUmakefile.am:
+        * WebCore.gypi:
+        * WebCore.pro:
+        * WebCore.vcproj/WebCore.vcproj:
+        * WebCore.xcodeproj/project.pbxproj:
+        * bindings/js/ScriptArray.cpp: Added.
+        (WebCore::ScriptArray::ScriptArray):
+        (WebCore::handleException):
+        (WebCore::ScriptArray::set):
+        (WebCore::length):
+        (WebCore::ScriptArray::createNew):
+        * bindings/js/ScriptArray.h: Added.
+        (WebCore::ScriptArray::ScriptArray):
+        (WebCore::ScriptArray::jsArray):
+        * bindings/v8/ScriptArray.cpp: Added.
+        (WebCore::ScriptArray::ScriptArray):
+        (WebCore::ScriptArray::set):
+        (WebCore::ScriptArray::length):
+        (WebCore::ScriptArray::createNew):
+        * bindings/v8/ScriptArray.h: Added.
+        (WebCore::ScriptArray::ScriptArray):
+        (WebCore::ScriptArray::~ScriptArray):
+
</ins><span class="cx"> 2009-07-27  Brent Fulgham  &lt;bfulgham@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Build correct, no review.
</span></span></pre></div>
<a id="trunkWebCoreGNUmakefileam"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/GNUmakefile.am (46409 => 46410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/GNUmakefile.am        2009-07-27 07:17:48 UTC (rev 46409)
+++ trunk/WebCore/GNUmakefile.am        2009-07-27 09:06:55 UTC (rev 46410)
</span><span class="lines">@@ -417,6 +417,8 @@
</span><span class="cx">         WebCore/bindings/js/JSXSLTProcessorCustom.cpp \
</span><span class="cx">         WebCore/bindings/js/ScheduledAction.cpp \
</span><span class="cx">         WebCore/bindings/js/ScheduledAction.h \
</span><ins>+        WebCore/bindings/js/ScriptArray.cpp \
+        WebCore/bindings/js/ScriptArray.h \
</ins><span class="cx">         WebCore/bindings/js/ScriptCachedFrameData.cpp \
</span><span class="cx">         WebCore/bindings/js/ScriptCachedFrameData.h \
</span><span class="cx">         WebCore/bindings/js/ScriptCallFrame.cpp \
</span></span></pre></div>
<a id="trunkWebCoreWebCoregypi"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.gypi (46409 => 46410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.gypi        2009-07-27 07:17:48 UTC (rev 46409)
+++ trunk/WebCore/WebCore.gypi        2009-07-27 09:06:55 UTC (rev 46410)
</span><span class="lines">@@ -552,6 +552,8 @@
</span><span class="cx">             'bindings/js/JSXSLTProcessorCustom.cpp',
</span><span class="cx">             'bindings/js/ScheduledAction.cpp',
</span><span class="cx">             'bindings/js/ScheduledAction.h',
</span><ins>+            'bindings/js/ScriptArray.cpp',
+            'bindings/js/ScriptArray.h',
</ins><span class="cx">             'bindings/js/ScriptCachedFrameData.cpp',
</span><span class="cx">             'bindings/js/ScriptCachedFrameData.h',
</span><span class="cx">             'bindings/js/ScriptCallFrame.cpp',
</span><span class="lines">@@ -669,6 +671,8 @@
</span><span class="cx">             'bindings/v8/NPV8Object.h',
</span><span class="cx">             'bindings/v8/ScheduledAction.cpp',
</span><span class="cx">             'bindings/v8/ScheduledAction.h',
</span><ins>+            'bindings/v8/ScriptArray.cpp',
+            'bindings/v8/ScriptArray.h',
</ins><span class="cx">             'bindings/v8/ScriptCachedFrameData.h',
</span><span class="cx">             'bindings/v8/ScriptCallFrame.cpp',
</span><span class="cx">             'bindings/v8/ScriptCallFrame.h',
</span></span></pre></div>
<a id="trunkWebCoreWebCorepro"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.pro (46409 => 46410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.pro        2009-07-27 07:17:48 UTC (rev 46409)
+++ trunk/WebCore/WebCore.pro        2009-07-27 09:06:55 UTC (rev 46410)
</span><span class="lines">@@ -536,6 +536,7 @@
</span><span class="cx">     bindings/js/JSEventListener.cpp \
</span><span class="cx">     bindings/js/JSLazyEventListener.cpp \
</span><span class="cx">     bindings/js/JSPluginElementFunctions.cpp \
</span><ins>+    bindings/js/ScriptArray.cpp \
</ins><span class="cx">     bindings/js/ScriptCachedFrameData.cpp \
</span><span class="cx">     bindings/js/ScriptCallFrame.cpp \
</span><span class="cx">     bindings/js/ScriptCallStack.cpp \
</span><span class="lines">@@ -1186,6 +1187,7 @@
</span><span class="cx">     bindings/js/JSXMLHttpRequestConstructor.h \
</span><span class="cx">     bindings/js/JSXSLTProcessorConstructor.h \
</span><span class="cx">     bindings/js/ScheduledAction.h \
</span><ins>+    bindings/js/ScriptArray.h \
</ins><span class="cx">     bindings/js/ScriptCachedFrameData.h \
</span><span class="cx">     bindings/js/ScriptCallFrame.h \
</span><span class="cx">     bindings/js/ScriptCallStack.h \
</span></span></pre></div>
<a id="trunkWebCoreWebCorevcprojWebCorevcproj"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.vcproj/WebCore.vcproj (46409 => 46410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.vcproj/WebCore.vcproj        2009-07-27 07:17:48 UTC (rev 46409)
+++ trunk/WebCore/WebCore.vcproj/WebCore.vcproj        2009-07-27 09:06:55 UTC (rev 46410)
</span><span class="lines">@@ -28862,6 +28862,14 @@
</span><span class="cx">                                         RelativePath=&quot;..\bindings\js\ScheduledAction.h&quot;
</span><span class="cx">                                         &gt;
</span><span class="cx">                                 &lt;/File&gt;
</span><ins>+                                &lt;File
+                                        RelativePath=&quot;..\bindings\js\ScriptArray.cpp&quot;
+                                        &gt;
+                                &lt;/File&gt;
+                                &lt;File
+                                        RelativePath=&quot;..\bindings\js\ScriptArray.h&quot;
+                                        &gt;
+                                &lt;/File&gt;
</ins><span class="cx">                                 &lt;File
</span><span class="cx">                                         RelativePath=&quot;..\bindings\js\ScriptCachedFrameData.cpp&quot;
</span><span class="cx">                                         &gt;
</span></span></pre></div>
<a id="trunkWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/WebCore/WebCore.xcodeproj/project.pbxproj (46409 => 46410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/WebCore.xcodeproj/project.pbxproj        2009-07-27 07:17:48 UTC (rev 46409)
+++ trunk/WebCore/WebCore.xcodeproj/project.pbxproj        2009-07-27 09:06:55 UTC (rev 46410)
</span><span class="lines">@@ -1020,6 +1020,8 @@
</span><span class="cx">                 75793ED30D0CE85B007FC0AC /* DOMMessageEvent.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793ED00D0CE85B007FC0AC /* DOMMessageEvent.h */; };
</span><span class="cx">                 75793ED40D0CE85B007FC0AC /* DOMMessageEvent.mm in Sources */ = {isa = PBXBuildFile; fileRef = 75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */; };
</span><span class="cx">                 75793ED50D0CE85B007FC0AC /* DOMMessageEventInternal.h in Headers */ = {isa = PBXBuildFile; fileRef = 75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */; };
</span><ins>+                7A1E88F5101CC384000C4DF5 /* ScriptArray.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A1E88F3101CC384000C4DF5 /* ScriptArray.cpp */; };
+                7A1E88F6101CC384000C4DF5 /* ScriptArray.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A1E88F4101CC384000C4DF5 /* ScriptArray.h */; };
</ins><span class="cx">                 7A674BDB0F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 7A674BD90F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp */; };
</span><span class="cx">                 7A674BDC0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h in Headers */ = {isa = PBXBuildFile; fileRef = 7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */; };
</span><span class="cx">                 7A74ECB71018399A00BF939E /* InspectorBackend.idl in Resources */ = {isa = PBXBuildFile; fileRef = 7A74ECB61018399A00BF939E /* InspectorBackend.idl */; };
</span><span class="lines">@@ -6044,6 +6046,8 @@
</span><span class="cx">                 75793ED00D0CE85B007FC0AC /* DOMMessageEvent.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMessageEvent.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 75793ED10D0CE85B007FC0AC /* DOMMessageEvent.mm */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMMessageEvent.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 75793ED20D0CE85B007FC0AC /* DOMMessageEventInternal.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = DOMMessageEventInternal.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                7A1E88F3101CC384000C4DF5 /* ScriptArray.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptArray.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                7A1E88F4101CC384000C4DF5 /* ScriptArray.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptArray.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 7A674BD90F9EBF4E006CF099 /* PageGroupLoadDeferrer.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = PageGroupLoadDeferrer.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7A674BDA0F9EBF4E006CF099 /* PageGroupLoadDeferrer.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = PageGroupLoadDeferrer.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 7A74ECB61018399A00BF939E /* InspectorBackend.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = InspectorBackend.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -13545,6 +13549,8 @@
</span><span class="cx">                                 BCE99EC20DCA624100182683 /* JSXSLTProcessorConstructor.h */,
</span><span class="cx">                                 BCA378BA0D15F64200B793D6 /* ScheduledAction.cpp */,
</span><span class="cx">                                 BCA378BB0D15F64200B793D6 /* ScheduledAction.h */,
</span><ins>+                                7A1E88F3101CC384000C4DF5 /* ScriptArray.cpp */,
+                                7A1E88F4101CC384000C4DF5 /* ScriptArray.h */,
</ins><span class="cx">                                 41F1D21E0EF35C2A00DA8753 /* ScriptCachedFrameData.cpp */,
</span><span class="cx">                                 41F1D21D0EF35C2A00DA8753 /* ScriptCachedFrameData.h */,
</span><span class="cx">                                 416E75CA0EDF90C700360E1D /* ScriptCallFrame.cpp */,
</span><span class="lines">@@ -17056,6 +17062,7 @@
</span><span class="cx">                                 A8EDB03D1016849400FE8113 /* DOMObjectWithSVGContext.h in Headers */,
</span><span class="cx">                                 CE54FD381016D9A6008B44C8 /* ScriptSourceProvider.h in Headers */,
</span><span class="cx">                                 7A74ECBB101839A600BF939E /* InspectorBackend.h in Headers */,
</span><ins>+                                7A1E88F6101CC384000C4DF5 /* ScriptArray.h in Headers */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span><span class="lines">@@ -19097,6 +19104,7 @@
</span><span class="cx">                                 BCAEFCAE1016CE4A0040D34E /* DOMRGBColor.mm in Sources */,
</span><span class="cx">                                 7A74ECBA101839A600BF939E /* InspectorBackend.cpp in Sources */,
</span><span class="cx">                                 7A74ECBD101839DA00BF939E /* JSInspectorBackendCustom.cpp in Sources */,
</span><ins>+                                7A1E88F5101CC384000C4DF5 /* ScriptArray.cpp in Sources */,
</ins><span class="cx">                         );
</span><span class="cx">                         runOnlyForDeploymentPostprocessing = 0;
</span><span class="cx">                 };
</span></span></pre></div>
<a id="trunkWebCorebindingsjsScriptArraycpp"></a>
<div class="addfile"><h4>Added: trunk/WebCore/bindings/js/ScriptArray.cpp (0 => 46410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/js/ScriptArray.cpp                                (rev 0)
+++ trunk/WebCore/bindings/js/ScriptArray.cpp        2009-07-27 09:06:55 UTC (rev 46410)
</span><span class="lines">@@ -0,0 +1,107 @@
</span><ins>+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;ScriptArray.h&quot;
+
+#include &lt;runtime/JSLock.h&gt;
+
+using namespace JSC;
+
+namespace WebCore {
+
+ScriptArray::ScriptArray(JSArray* object)
+    : ScriptObject(object)
+{
+}
+
+static bool handleException(ScriptState* scriptState)
+{
+    if (!scriptState-&gt;hadException())
+        return true;
+
+    reportException(scriptState, scriptState-&gt;exception());
+    return false;
+}
+
+bool ScriptArray::set(ScriptState* scriptState, unsigned index, const ScriptObject&amp; value)
+{
+    JSLock lock(false);
+    jsArray()-&gt;put(scriptState, index, value.jsObject());
+    return handleException(scriptState);
+}
+
+bool ScriptArray::set(ScriptState* scriptState, unsigned index, const String&amp; value)
+{
+    JSLock lock(false);
+    jsArray()-&gt;put(scriptState, index, jsString(scriptState, value));
+    return handleException(scriptState);
+}
+
+bool ScriptArray::set(ScriptState* scriptState, unsigned index, double value)
+{
+    JSLock lock(false);
+    jsArray()-&gt;put(scriptState, index, jsNumber(scriptState, value));
+    return handleException(scriptState);
+}
+
+bool ScriptArray::set(ScriptState* scriptState, unsigned index, long long value)
+{
+    JSLock lock(false);
+    jsArray()-&gt;put(scriptState, index, jsNumber(scriptState, value));
+    return handleException(scriptState);
+}
+
+bool ScriptArray::set(ScriptState* scriptState, unsigned index, int value)
+{
+    JSLock lock(false);
+    jsArray()-&gt;put(scriptState, index, jsNumber(scriptState, value));
+    return handleException(scriptState);
+}
+
+bool ScriptArray::set(ScriptState* scriptState, unsigned index, bool value)
+{
+    JSLock lock(false);
+    jsArray()-&gt;put(scriptState, index, jsBoolean(value));
+    return handleException(scriptState);
+}
+
+unsigned ScriptArray::length(ScriptState*)
+{
+    return jsArray()-&gt;length();
+}
+
+ScriptArray ScriptArray::createNew(ScriptState* scriptState)
+{
+    JSLock lock(false);
+    return ScriptArray(constructEmptyArray(scriptState));
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkWebCorebindingsjsScriptArrayh"></a>
<div class="addfile"><h4>Added: trunk/WebCore/bindings/js/ScriptArray.h (0 => 46410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/js/ScriptArray.h                                (rev 0)
+++ trunk/WebCore/bindings/js/ScriptArray.h        2009-07-27 09:06:55 UTC (rev 46410)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScriptArray_h
+#define ScriptArray_h
+
+#include &quot;ScriptObject.h&quot;
+#include &quot;ScriptState.h&quot;
+
+#include &lt;runtime/JSArray.h&gt;
+
+namespace WebCore {
+
+    class ScriptArray : public ScriptObject {
+    public:
+        ScriptArray(JSC::JSArray*);
+        ScriptArray() {}
+        JSC::JSArray* jsArray() const { return asArray(jsValue()); }
+
+        bool set(ScriptState*, unsigned index, const ScriptObject&amp;);
+        bool set(ScriptState*, unsigned index, const String&amp;);
+        bool set(ScriptState*, unsigned index, double);
+        bool set(ScriptState*, unsigned index, long long);
+        bool set(ScriptState*, unsigned index, int);
+        bool set(ScriptState*, unsigned index, bool);
+        unsigned length(ScriptState*);
+
+        static ScriptArray createNew(ScriptState*);
+    };
+}
+
+#endif // ScriptArray_h
</ins></span></pre></div>
<a id="trunkWebCorebindingsv8ScriptArraycpp"></a>
<div class="addfile"><h4>Added: trunk/WebCore/bindings/v8/ScriptArray.cpp (0 => 46410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/ScriptArray.cpp                                (rev 0)
+++ trunk/WebCore/bindings/v8/ScriptArray.cpp        2009-07-27 09:06:55 UTC (rev 46410)
</span><span class="lines">@@ -0,0 +1,105 @@
</span><ins>+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;ScriptArray.h&quot;
+
+#include &quot;ScriptScope.h&quot;
+#include &quot;ScriptState.h&quot;
+
+#include &quot;Document.h&quot;
+#include &quot;Frame.h&quot;
+#include &quot;V8Binding.h&quot;
+#include &quot;V8Proxy.h&quot;
+
+#include &lt;v8.h&gt;
+
+namespace WebCore {
+
+ScriptArray::ScriptArray(v8::Handle&lt;v8::Array&gt; v8Array)
+    : ScriptObject(v8Array)
+{
+}
+
+bool ScriptArray::set(ScriptState* scriptState, unsigned index, const ScriptObject&amp; value)
+{
+    ScriptScope scope(scriptState);
+    v8Object()-&gt;Set(v8::Integer::New(index), value.v8Value());
+    return scope.success();
+}
+
+bool ScriptArray::set(ScriptState* scriptState, unsigned index, const String&amp; value)
+{
+    ScriptScope scope(scriptState);
+    v8Object()-&gt;Set(v8::Integer::New(index), v8String(value));
+    return scope.success();
+}
+
+bool ScriptArray::set(ScriptState* scriptState, unsigned index, double value)
+{
+    ScriptScope scope(scriptState);
+    v8Object()-&gt;Set(v8::Integer::New(index), v8::Number::New(value));
+    return scope.success();
+}
+
+bool ScriptArray::set(ScriptState* scriptState, unsigned index, long long value)
+{
+    ScriptScope scope(scriptState);
+    v8Object()-&gt;Set(v8::Integer::New(index), v8::Number::New(value));
+    return scope.success();
+}
+
+bool ScriptArray::set(ScriptState* scriptState, unsigned index, int value)
+{
+    ScriptScope scope(scriptState);
+    v8Object()-&gt;Set(v8::Integer::New(index), v8::Number::New(value));
+    return scope.success();
+}
+
+bool ScriptArray::set(ScriptState* scriptState, unsigned index, bool value)
+{
+    ScriptScope scope(scriptState);
+    v8Object()-&gt;Set(v8::Integer::New(index), v8Boolean(value));
+    return scope.success();
+}
+
+unsigned ScriptArray::length(ScriptState* scriptState)
+{
+    ScriptScope scope(scriptState);
+    return v8::Array::Cast(*v8Value())-&gt;Length();
+}
+
+ScriptArray ScriptArray::createNew(ScriptState* scriptState)
+{
+    ScriptScope scope(scriptState);
+    return ScriptArray(v8::Array::New());
+}
+
+} // namespace WebCore
</ins></span></pre></div>
<a id="trunkWebCorebindingsv8ScriptArrayh"></a>
<div class="addfile"><h4>Added: trunk/WebCore/bindings/v8/ScriptArray.h (0 => 46410)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/WebCore/bindings/v8/ScriptArray.h                                (rev 0)
+++ trunk/WebCore/bindings/v8/ScriptArray.h        2009-07-27 09:06:55 UTC (rev 46410)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+/*
+ * Copyright (C) 2009 Google Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef ScriptArray_h
+#define ScriptArray_h
+
+#include &quot;ScriptObject.h&quot;
+
+#include &lt;v8.h&gt;
+
+namespace WebCore {
+    class ScriptState;
+
+    class ScriptArray : public ScriptObject {
+    public:
+        ScriptArray(v8::Handle&lt;v8::Array&gt;);
+        ScriptArray() {}
+        virtual ~ScriptArray() {}
+
+        bool set(ScriptState*, unsigned index, const ScriptObject&amp;);
+        bool set(ScriptState*, unsigned index, const String&amp;);
+        bool set(ScriptState*, unsigned index, double);
+        bool set(ScriptState*, unsigned index, long long);
+        bool set(ScriptState*, unsigned index, int);
+        bool set(ScriptState*, unsigned index, bool);
+        unsigned length(ScriptState*);
+
+        static ScriptArray createNew(ScriptState*);
+    };
+}
+
+#endif // ScriptArray_h
</ins></span></pre>
</div>
</div>

</body>
</html>