<!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" /><style type="text/css"><!--
#msg dl { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer { 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, #msg p { overflow: auto; background: #ffc; border: 1px #fc0 solid; padding: 6px; }
#msg ul { overflow: auto; }
#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>
<title>[29047] trunk/JavaScriptCore</title>
</head>
<body>

<div id="msg">
<dl>
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/29047">29047</a></dd>
<dt>Author</dt> <dd>eric@webkit.org</dd>
<dt>Date</dt> <dd>2007-12-30 23:03:31 -0800 (Sun, 30 Dec 2007)</dd>
</dl>

<h3>Log Message</h3>
<pre>        Reviewed by Sam.

        More small cleanup to array_object.cpp

        * kjs/array_object.cpp:
        (KJS::ArrayProtoFuncToString::callAsFunction):
        (KJS::ArrayProtoFuncToLocaleString::callAsFunction):
        (KJS::ArrayProtoFuncJoin::callAsFunction):
        (KJS::ArrayProtoFuncConcat::callAsFunction):
        (KJS::ArrayProtoFuncReverse::callAsFunction):
        (KJS::ArrayProtoFuncShift::callAsFunction):
        (KJS::ArrayProtoFuncSlice::callAsFunction):
        (KJS::ArrayProtoFuncSort::callAsFunction):
        (KJS::ArrayProtoFuncSplice::callAsFunction):
        (KJS::ArrayProtoFuncUnShift::callAsFunction):
        (KJS::ArrayProtoFuncFilter::callAsFunction):
        (KJS::ArrayProtoFuncMap::callAsFunction):
        (KJS::ArrayProtoFuncEvery::callAsFunction):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkJavaScriptCoreChangeLog">trunk/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkJavaScriptCorekjsarray_objectcpp">trunk/JavaScriptCore/kjs/array_object.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/ChangeLog (29046 => 29047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/ChangeLog        2007-12-31 07:03:05 UTC (rev 29046)
+++ trunk/JavaScriptCore/ChangeLog        2007-12-31 07:03:31 UTC (rev 29047)
</span><span class="lines">@@ -2,6 +2,27 @@
</span><span class="cx"> 
</span><span class="cx">         Reviewed by Sam.
</span><span class="cx"> 
</span><ins>+        More small cleanup to array_object.cpp
+
+        * kjs/array_object.cpp:
+        (KJS::ArrayProtoFuncToString::callAsFunction):
+        (KJS::ArrayProtoFuncToLocaleString::callAsFunction):
+        (KJS::ArrayProtoFuncJoin::callAsFunction):
+        (KJS::ArrayProtoFuncConcat::callAsFunction):
+        (KJS::ArrayProtoFuncReverse::callAsFunction):
+        (KJS::ArrayProtoFuncShift::callAsFunction):
+        (KJS::ArrayProtoFuncSlice::callAsFunction):
+        (KJS::ArrayProtoFuncSort::callAsFunction):
+        (KJS::ArrayProtoFuncSplice::callAsFunction):
+        (KJS::ArrayProtoFuncUnShift::callAsFunction):
+        (KJS::ArrayProtoFuncFilter::callAsFunction):
+        (KJS::ArrayProtoFuncMap::callAsFunction):
+        (KJS::ArrayProtoFuncEvery::callAsFunction):
+
+2007-12-30  Eric Seidel  &lt;eric@webkit.org&gt;
+
+        Reviewed by Sam.
+
</ins><span class="cx">         Apply wkstyle to array_object.cpp
</span><span class="cx"> 
</span><span class="cx">         * kjs/array_object.cpp:
</span></span></pre></div>
<a id="trunkJavaScriptCorekjsarray_objectcpp"></a>
<div class="modfile"><h4>Modified: trunk/JavaScriptCore/kjs/array_object.cpp (29046 => 29047)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/JavaScriptCore/kjs/array_object.cpp        2007-12-31 07:03:05 UTC (rev 29046)
+++ trunk/JavaScriptCore/kjs/array_object.cpp        2007-12-31 07:03:31 UTC (rev 29047)
</span><span class="lines">@@ -66,7 +66,7 @@
</span><span class="cx"> 
</span><span class="cx"> // ECMA 15.4.4
</span><span class="cx"> ArrayPrototype::ArrayPrototype(ExecState*, ObjectPrototype* objProto)
</span><del>-        : ArrayInstance(objProto, 0)
</del><ins>+    : ArrayInstance(objProto, 0)
</ins><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx">         if (k &gt;= 1)
</span><span class="cx">             str += separator;
</span><span class="cx">         if (str.isNull()) {
</span><del>-            JSObject *error = Error::create(exec, GeneralError, &quot;Out of memory&quot;);
</del><ins>+            JSObject* error = Error::create(exec, GeneralError, &quot;Out of memory&quot;);
</ins><span class="cx">             exec-&gt;setException(error);
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="lines">@@ -118,7 +118,7 @@
</span><span class="cx">         str += element-&gt;toString(exec);
</span><span class="cx"> 
</span><span class="cx">         if (str.isNull()) {
</span><del>-            JSObject *error = Error::create(exec, GeneralError, &quot;Out of memory&quot;);
</del><ins>+            JSObject* error = Error::create(exec, GeneralError, &quot;Out of memory&quot;);
</ins><span class="cx">             exec-&gt;setException(error);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx">         if (k &gt;= 1)
</span><span class="cx">             str += separator;
</span><span class="cx">         if (str.isNull()) {
</span><del>-            JSObject *error = Error::create(exec, GeneralError, &quot;Out of memory&quot;);
</del><ins>+            JSObject* error = Error::create(exec, GeneralError, &quot;Out of memory&quot;);
</ins><span class="cx">             exec-&gt;setException(error);
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="lines">@@ -157,22 +157,15 @@
</span><span class="cx">         if (element-&gt;isUndefinedOrNull())
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        bool fallback = false;
</del><span class="cx">         JSObject* o = element-&gt;toObject(exec);
</span><span class="cx">         JSValue* conversionFunction = o-&gt;get(exec, exec-&gt;propertyNames().toLocaleString);
</span><del>-        if (conversionFunction-&gt;isObject() &amp;&amp; static_cast&lt;JSObject*&gt;(conversionFunction)-&gt;implementsCall()) {
-            List args;
-            str += static_cast&lt;JSObject*&gt;(conversionFunction)-&gt;call(exec, o, args)-&gt;toString(exec);
-        } else {
-            // try toString() fallback
-            fallback = true;
-        }
-
-        if (fallback)
</del><ins>+        if (conversionFunction-&gt;isObject() &amp;&amp; static_cast&lt;JSObject*&gt;(conversionFunction)-&gt;implementsCall())
+            str += static_cast&lt;JSObject*&gt;(conversionFunction)-&gt;call(exec, o, List::empty())-&gt;toString(exec);
+        else
</ins><span class="cx">             str += element-&gt;toString(exec);
</span><span class="cx"> 
</span><span class="cx">         if (str.isNull()) {
</span><del>-            JSObject *error = Error::create(exec, GeneralError, &quot;Out of memory&quot;);
</del><ins>+            JSObject* error = Error::create(exec, GeneralError, &quot;Out of memory&quot;);
</ins><span class="cx">             exec-&gt;setException(error);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -202,7 +195,7 @@
</span><span class="cx">         if (k &gt;= 1)
</span><span class="cx">             str += separator;
</span><span class="cx">         if (str.isNull()) {
</span><del>-            JSObject *error = Error::create(exec, GeneralError, &quot;Out of memory&quot;);
</del><ins>+            JSObject* error = Error::create(exec, GeneralError, &quot;Out of memory&quot;);
</ins><span class="cx">             exec-&gt;setException(error);
</span><span class="cx">             break;
</span><span class="cx">         }
</span><span class="lines">@@ -214,7 +207,7 @@
</span><span class="cx">         str += element-&gt;toString(exec);
</span><span class="cx"> 
</span><span class="cx">         if (str.isNull()) {
</span><del>-            JSObject *error = Error::create(exec, GeneralError, &quot;Out of memory&quot;);
</del><ins>+            JSObject* error = Error::create(exec, GeneralError, &quot;Out of memory&quot;);
</ins><span class="cx">             exec-&gt;setException(error);
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -229,19 +222,19 @@
</span><span class="cx"> {
</span><span class="cx">     JSObject* arr = static_cast&lt;JSObject*&gt;(exec-&gt;lexicalGlobalObject()-&gt;arrayConstructor()-&gt;construct(exec, List::empty()));
</span><span class="cx">     int n = 0;
</span><del>-    JSValue *curArg = thisObj;
-    JSObject *curObj = static_cast&lt;JSObject *&gt;(thisObj);
</del><ins>+    JSValue* curArg = thisObj;
+    JSObject* curObj = static_cast&lt;JSObject* &gt;(thisObj);
</ins><span class="cx">     List::const_iterator it = args.begin();
</span><span class="cx">     List::const_iterator end = args.end();
</span><span class="cx">     unsigned length = thisObj-&gt;get(exec, exec-&gt;propertyNames().length)-&gt;toUInt32(exec);
</span><del>-    for (;;) {
</del><ins>+    while (1) {
</ins><span class="cx">         if (curArg-&gt;isObject() &amp;&amp; curObj-&gt;inherits(&amp;ArrayInstance::info)) {
</span><span class="cx">             unsigned int k = 0;
</span><span class="cx">             // Older versions tried to optimize out getting the length of thisObj
</span><span class="cx">             // by checking for n != 0, but that doesn't work if thisObj is an empty array.
</span><span class="cx">             length = curObj-&gt;get(exec, exec-&gt;propertyNames().length)-&gt;toUInt32(exec);
</span><span class="cx">             while (k &lt; length) {
</span><del>-                if (JSValue *v = getProperty(exec, curObj, k))
</del><ins>+                if (JSValue* v = getProperty(exec, curObj, k))
</ins><span class="cx">                     arr-&gt;put(exec, n, v);
</span><span class="cx">                 n++;
</span><span class="cx">                 k++;
</span><span class="lines">@@ -291,8 +284,8 @@
</span><span class="cx"> 
</span><span class="cx">     for (unsigned int k = 0; k &lt; middle; k++) {
</span><span class="cx">         unsigned lk1 = length - k - 1;
</span><del>-        JSValue *obj2 = getProperty(exec, thisObj, lk1);
-        JSValue *obj = getProperty(exec, thisObj, k);
</del><ins>+        JSValue* obj2 = getProperty(exec, thisObj, lk1);
+        JSValue* obj = getProperty(exec, thisObj, k);
</ins><span class="cx"> 
</span><span class="cx">         if (obj2)
</span><span class="cx">             thisObj-&gt;put(exec, k, obj2);
</span><span class="lines">@@ -318,10 +311,10 @@
</span><span class="cx">     } else {
</span><span class="cx">         result = thisObj-&gt;get(exec, 0);
</span><span class="cx">         for (unsigned int k = 1; k &lt; length; k++) {
</span><del>-            if (JSValue *obj = getProperty(exec, thisObj, k))
-                thisObj-&gt;put(exec, k-1, obj);
</del><ins>+            if (JSValue* obj = getProperty(exec, thisObj, k))
+                thisObj-&gt;put(exec, k - 1, obj);
</ins><span class="cx">             else
</span><del>-                thisObj-&gt;deleteProperty(exec, k-1);
</del><ins>+                thisObj-&gt;deleteProperty(exec, k - 1);
</ins><span class="cx">         }
</span><span class="cx">         thisObj-&gt;deleteProperty(exec, length - 1);
</span><span class="cx">         thisObj-&gt;put(exec, exec-&gt;propertyNames().length, jsNumber(length - 1), DontEnum | DontDelete);
</span><span class="lines">@@ -334,7 +327,7 @@
</span><span class="cx">     // http://developer.netscape.com/docs/manuals/js/client/jsref/array.htm#1193713 or 15.4.4.10
</span><span class="cx"> 
</span><span class="cx">     // We return a new array
</span><del>-    JSObject *resObj = static_cast&lt;JSObject *&gt;(exec-&gt;lexicalGlobalObject()-&gt;arrayConstructor()-&gt;construct(exec,List::empty()));
</del><ins>+    JSObject* resObj = static_cast&lt;JSObject* &gt;(exec-&gt;lexicalGlobalObject()-&gt;arrayConstructor()-&gt;construct(exec, List::empty()));
</ins><span class="cx">     JSValue* result = resObj;
</span><span class="cx">     double begin = args[0]-&gt;toInteger(exec);
</span><span class="cx">     unsigned length = thisObj-&gt;get(exec, exec-&gt;propertyNames().length)-&gt;toUInt32(exec);
</span><span class="lines">@@ -365,7 +358,7 @@
</span><span class="cx">     int b = static_cast&lt;int&gt;(begin);
</span><span class="cx">     int e = static_cast&lt;int&gt;(end);
</span><span class="cx">     for (int k = b; k &lt; e; k++, n++) {
</span><del>-        if (JSValue *v = getProperty(exec, thisObj, k))
</del><ins>+        if (JSValue* v = getProperty(exec, thisObj, k))
</ins><span class="cx">             resObj-&gt;put(exec, n, v);
</span><span class="cx">     }
</span><span class="cx">     resObj-&gt;put(exec, exec-&gt;propertyNames().length, jsNumber(n), DontEnum | DontDelete);
</span><span class="lines">@@ -374,78 +367,67 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue* ArrayProtoFuncSort::callAsFunction(ExecState* exec, JSObject* thisObj, const List&amp; args)
</span><span class="cx"> {
</span><del>-#if 0
-    printf(&quot;KJS Array::Sort length=%d\n&quot;, length);
-    for (unsigned int i = 0 ; i&lt;length ; ++i)
-        printf(&quot;KJS Array::Sort: %d: %s\n&quot;, i, thisObj-&gt;get(exec, i)-&gt;toString(exec).ascii());
-#endif
-    JSObject *sortFunction = NULL;
</del><ins>+    JSObject* sortFunction = 0;
</ins><span class="cx">     if (!args[0]-&gt;isUndefined()) {
</span><span class="cx">         sortFunction = args[0]-&gt;toObject(exec);
</span><span class="cx">         if (!sortFunction-&gt;implementsCall())
</span><del>-            sortFunction = NULL;
</del><ins>+            sortFunction = 0;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (thisObj-&gt;classInfo() == &amp;ArrayInstance::info) {
</span><span class="cx">         if (sortFunction)
</span><del>-            ((ArrayInstance *)thisObj)-&gt;sort(exec, sortFunction);
</del><ins>+            static_cast&lt;ArrayInstance*&gt;(thisObj)-&gt;sort(exec, sortFunction);
</ins><span class="cx">         else
</span><del>-            ((ArrayInstance *)thisObj)-&gt;sort(exec);
</del><ins>+            static_cast&lt;ArrayInstance*&gt;(thisObj)-&gt;sort(exec);
</ins><span class="cx">         return thisObj;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     unsigned length = thisObj-&gt;get(exec, exec-&gt;propertyNames().length)-&gt;toUInt32(exec);
</span><span class="cx"> 
</span><del>-    if (length == 0) {
</del><ins>+    if (!length) {
</ins><span class="cx">         thisObj-&gt;put(exec, exec-&gt;propertyNames().length, jsNumber(0), DontEnum | DontDelete);
</span><span class="cx">         return thisObj;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // &quot;Min&quot; sort. Not the fastest, but definitely less code than heapsort
</span><span class="cx">     // or quicksort, and much less swapping than bubblesort/insertionsort.
</span><del>-    for (unsigned int i = 0 ; i&lt;length-1 ; ++i) {
-        JSValue *iObj = thisObj-&gt;get(exec,i);
</del><ins>+    for (unsigned int i = 0 ; i &lt; length - 1 ; ++i) {
+        JSValue* iObj = thisObj-&gt;get(exec, i);
</ins><span class="cx">         unsigned int themin = i;
</span><del>-        JSValue *minObj = iObj;
-        for (unsigned int j = i+1 ; j&lt;length ; ++j) {
-            JSValue *jObj = thisObj-&gt;get(exec,j);
-            double cmp;
-            if (jObj-&gt;isUndefined()) {
-                cmp = 1; // don't check minObj because there's no need to differentiate == (0) from &gt; (1)
-            } else if (minObj-&gt;isUndefined()) {
-                cmp = -1;
-            } else if (sortFunction) {
</del><ins>+        JSValue* minObj = iObj;
+        for (unsigned int j = i + 1 ; j &lt; length ; ++j) {
+            JSValue* jObj = thisObj-&gt;get(exec, j);
+            double compareResult;
+            if (jObj-&gt;isUndefined())
+                compareResult = 1; // don't check minObj because there's no need to differentiate == (0) from &gt; (1)
+            else if (minObj-&gt;isUndefined())
+                compareResult = -1;
+            else if (sortFunction) {
</ins><span class="cx">                 List l;
</span><span class="cx">                 l.append(jObj);
</span><span class="cx">                 l.append(minObj);
</span><del>-                cmp = sortFunction-&gt;call(exec, exec-&gt;dynamicGlobalObject(), l)-&gt;toNumber(exec);
-            } else {
-                cmp = (jObj-&gt;toString(exec) &lt; minObj-&gt;toString(exec)) ? -1 : 1;
-            }
-            if (cmp &lt; 0) {
</del><ins>+                compareResult = sortFunction-&gt;call(exec, exec-&gt;dynamicGlobalObject(), l)-&gt;toNumber(exec);
+            } else
+                compareResult = (jObj-&gt;toString(exec) &lt; minObj-&gt;toString(exec)) ? -1 : 1;
+
+            if (compareResult &lt; 0) {
</ins><span class="cx">                 themin = j;
</span><span class="cx">                 minObj = jObj;
</span><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">         // Swap themin and i
</span><span class="cx">         if (themin &gt; i) {
</span><del>-            //printf(&quot;KJS Array::Sort: swapping %d and %d\n&quot;, i, themin);
</del><span class="cx">             thisObj-&gt;put(exec, i, minObj);
</span><span class="cx">             thisObj-&gt;put(exec, themin, iObj);
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-#if 0
-    printf(&quot;KJS Array::Sort -- Resulting array:\n&quot;);
-    for (unsigned int i = 0 ; i&lt;length ; ++i)
-        printf(&quot;KJS Array::Sort: %d: %s\n&quot;, i, thisObj-&gt;get(exec, i)-&gt;toString(exec).ascii());
-#endif
</del><span class="cx">     return thisObj;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> JSValue* ArrayProtoFuncSplice::callAsFunction(ExecState* exec, JSObject* thisObj, const List&amp; args)
</span><span class="cx"> {
</span><span class="cx">     // 15.4.4.12
</span><del>-    JSObject *resObj = static_cast&lt;JSObject *&gt;(exec-&gt;lexicalGlobalObject()-&gt;arrayConstructor()-&gt;construct(exec, List::empty()));
</del><ins>+    JSObject* resObj = static_cast&lt;JSObject* &gt;(exec-&gt;lexicalGlobalObject()-&gt;arrayConstructor()-&gt;construct(exec, List::empty()));
</ins><span class="cx">     JSValue* result = resObj;
</span><span class="cx">     unsigned length = thisObj-&gt;get(exec, exec-&gt;propertyNames().length)-&gt;toUInt32(exec);
</span><span class="cx">     int begin = args[0]-&gt;toUInt32(exec);
</span><span class="lines">@@ -456,7 +438,7 @@
</span><span class="cx">     unsigned int deleteCount = std::min&lt;int&gt;(std::max&lt;int&gt;(args[1]-&gt;toUInt32(exec), 0), length - begin);
</span><span class="cx"> 
</span><span class="cx">     for (unsigned int k = 0; k &lt; deleteCount; k++) {
</span><del>-        if (JSValue *v = getProperty(exec, thisObj, k+begin))
</del><ins>+        if (JSValue* v = getProperty(exec, thisObj, k + begin))
</ins><span class="cx">             resObj-&gt;put(exec, k, v);
</span><span class="cx">     }
</span><span class="cx">     resObj-&gt;put(exec, exec-&gt;propertyNames().length, jsNumber(deleteCount), DontEnum | DontDelete);
</span><span class="lines">@@ -465,25 +447,25 @@
</span><span class="cx">     if (additionalArgs != deleteCount) {
</span><span class="cx">         if (additionalArgs &lt; deleteCount) {
</span><span class="cx">             for (unsigned int k = begin; k &lt; length - deleteCount; ++k) {
</span><del>-                if (JSValue *v = getProperty(exec, thisObj, k+deleteCount))
-                    thisObj-&gt;put(exec, k+additionalArgs, v);
</del><ins>+                if (JSValue* v = getProperty(exec, thisObj, k + deleteCount))
+                    thisObj-&gt;put(exec, k + additionalArgs, v);
</ins><span class="cx">                 else
</span><del>-                    thisObj-&gt;deleteProperty(exec, k+additionalArgs);
</del><ins>+                    thisObj-&gt;deleteProperty(exec, k + additionalArgs);
</ins><span class="cx">             }
</span><span class="cx">             for (unsigned int k = length ; k &gt; length - deleteCount + additionalArgs; --k)
</span><del>-                thisObj-&gt;deleteProperty(exec, k-1);
</del><ins>+                thisObj-&gt;deleteProperty(exec, k - 1);
</ins><span class="cx">         } else {
</span><span class="cx">             for (unsigned int k = length - deleteCount; (int)k &gt; begin; --k) {
</span><del>-                if (JSValue *obj = getProperty(exec, thisObj, k + deleteCount - 1))
</del><ins>+                if (JSValue* obj = getProperty(exec, thisObj, k + deleteCount - 1))
</ins><span class="cx">                     thisObj-&gt;put(exec, k + additionalArgs - 1, obj);
</span><span class="cx">                 else
</span><del>-                    thisObj-&gt;deleteProperty(exec, k+additionalArgs-1);
</del><ins>+                    thisObj-&gt;deleteProperty(exec, k + additionalArgs - 1);
</ins><span class="cx">             }
</span><span class="cx">         }
</span><span class="cx">     }
</span><del>-    for (unsigned int k = 0; k &lt; additionalArgs; ++k) {
-        thisObj-&gt;put(exec, k+begin, args[k+2]);
-    }
</del><ins>+    for (unsigned int k = 0; k &lt; additionalArgs; ++k)
+        thisObj-&gt;put(exec, k + begin, args[k + 2]);
+
</ins><span class="cx">     thisObj-&gt;put(exec, exec-&gt;propertyNames().length, jsNumber(length - deleteCount + additionalArgs), DontEnum | DontDelete);
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="lines">@@ -494,10 +476,10 @@
</span><span class="cx">     unsigned length = thisObj-&gt;get(exec, exec-&gt;propertyNames().length)-&gt;toUInt32(exec);
</span><span class="cx">     unsigned int nrArgs = args.size();
</span><span class="cx">     for (unsigned int k = length; k &gt; 0; --k) {
</span><del>-        if (JSValue *v = getProperty(exec, thisObj, k - 1))
-            thisObj-&gt;put(exec, k+nrArgs-1, v);
</del><ins>+        if (JSValue* v = getProperty(exec, thisObj, k - 1))
+            thisObj-&gt;put(exec, k + nrArgs-1, v);
</ins><span class="cx">         else
</span><del>-            thisObj-&gt;deleteProperty(exec, k+nrArgs-1);
</del><ins>+            thisObj-&gt;deleteProperty(exec, k + nrArgs-1);
</ins><span class="cx">     }
</span><span class="cx">     for (unsigned int k = 0; k &lt; nrArgs; ++k)
</span><span class="cx">         thisObj-&gt;put(exec, k, args[k]);
</span><span class="lines">@@ -513,8 +495,8 @@
</span><span class="cx">     if (!eachFunction-&gt;implementsCall())
</span><span class="cx">         return throwError(exec, TypeError);
</span><span class="cx"> 
</span><del>-    JSObject *applyThis = args[1]-&gt;isUndefinedOrNull() ? exec-&gt;dynamicGlobalObject() :  args[1]-&gt;toObject(exec);
-    JSObject *resultArray = static_cast&lt;JSObject*&gt;(exec-&gt;lexicalGlobalObject()-&gt;arrayConstructor()-&gt;construct(exec, List::empty()));
</del><ins>+    JSObject* applyThis = args[1]-&gt;isUndefinedOrNull() ? exec-&gt;dynamicGlobalObject() :  args[1]-&gt;toObject(exec);
+    JSObject* resultArray = static_cast&lt;JSObject*&gt;(exec-&gt;lexicalGlobalObject()-&gt;arrayConstructor()-&gt;construct(exec, List::empty()));
</ins><span class="cx"> 
</span><span class="cx">     unsigned filterIndex = 0;
</span><span class="cx">     unsigned length = thisObj-&gt;get(exec, exec-&gt;propertyNames().length)-&gt;toUInt32(exec);
</span><span class="lines">@@ -524,7 +506,7 @@
</span><span class="cx">         if (!thisObj-&gt;getPropertySlot(exec, k, slot))
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        JSValue *v = slot.getValue(exec, thisObj, k);
</del><ins>+        JSValue* v = slot.getValue(exec, thisObj, k);
</ins><span class="cx"> 
</span><span class="cx">         List eachArguments;
</span><span class="cx"> 
</span><span class="lines">@@ -532,7 +514,7 @@
</span><span class="cx">         eachArguments.append(jsNumber(k));
</span><span class="cx">         eachArguments.append(thisObj);
</span><span class="cx"> 
</span><del>-        JSValue *result = eachFunction-&gt;call(exec, applyThis, eachArguments);
</del><ins>+        JSValue* result = eachFunction-&gt;call(exec, applyThis, eachArguments);
</ins><span class="cx"> 
</span><span class="cx">         if (result-&gt;toBoolean(exec))
</span><span class="cx">             resultArray-&gt;put(exec, filterIndex++, v);
</span><span class="lines">@@ -546,7 +528,7 @@
</span><span class="cx">     if (!eachFunction-&gt;implementsCall())
</span><span class="cx">         return throwError(exec, TypeError);
</span><span class="cx"> 
</span><del>-    JSObject *applyThis = args[1]-&gt;isUndefinedOrNull() ? exec-&gt;dynamicGlobalObject() :  args[1]-&gt;toObject(exec);
</del><ins>+    JSObject* applyThis = args[1]-&gt;isUndefinedOrNull() ? exec-&gt;dynamicGlobalObject() :  args[1]-&gt;toObject(exec);
</ins><span class="cx"> 
</span><span class="cx">     unsigned length = thisObj-&gt;get(exec, exec-&gt;propertyNames().length)-&gt;toUInt32(exec);
</span><span class="cx"> 
</span><span class="lines">@@ -559,7 +541,7 @@
</span><span class="cx">         if (!thisObj-&gt;getPropertySlot(exec, k, slot))
</span><span class="cx">             continue;
</span><span class="cx"> 
</span><del>-        JSValue *v = slot.getValue(exec, thisObj, k);
</del><ins>+        JSValue* v = slot.getValue(exec, thisObj, k);
</ins><span class="cx"> 
</span><span class="cx">         List eachArguments;
</span><span class="cx"> 
</span><span class="lines">@@ -567,7 +549,7 @@
</span><span class="cx">         eachArguments.append(jsNumber(k));
</span><span class="cx">         eachArguments.append(thisObj);
</span><span class="cx"> 
</span><del>-        JSValue *result = eachFunction-&gt;call(exec, applyThis, eachArguments);
</del><ins>+        JSValue* result = eachFunction-&gt;call(exec, applyThis, eachArguments);
</ins><span class="cx">         resultArray-&gt;put(exec, k, result);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -581,12 +563,12 @@
</span><span class="cx"> 
</span><span class="cx"> JSValue* ArrayProtoFuncEvery::callAsFunction(ExecState* exec, JSObject* thisObj, const List&amp; args)
</span><span class="cx"> {
</span><del>-    JSObject *eachFunction = args[0]-&gt;toObject(exec);
</del><ins>+    JSObject* eachFunction = args[0]-&gt;toObject(exec);
</ins><span class="cx"> 
</span><span class="cx">     if (!eachFunction-&gt;implementsCall())
</span><span class="cx">         return throwError(exec, TypeError);
</span><span class="cx"> 
</span><del>-    JSObject *applyThis = args[1]-&gt;isUndefinedOrNull() ? exec-&gt;dynamicGlobalObject() :  args[1]-&gt;toObject(exec);
</del><ins>+    JSObject* applyThis = args[1]-&gt;isUndefinedOrNull() ? exec-&gt;dynamicGlobalObject() :  args[1]-&gt;toObject(exec);
</ins><span class="cx"> 
</span><span class="cx">     JSValue* result = jsBoolean(true);
</span><span class="cx"> 
</span><span class="lines">@@ -731,9 +713,9 @@
</span><span class="cx"> 
</span><span class="cx"> // ------------------------------ ArrayObjectImp -------------------------------
</span><span class="cx"> 
</span><del>-ArrayObjectImp::ArrayObjectImp(ExecState *exec,
-                               FunctionPrototype *funcProto,
-                               ArrayPrototype *arrayProto)
</del><ins>+ArrayObjectImp::ArrayObjectImp(ExecState* exec,
+                               FunctionPrototype* funcProto,
+                               ArrayPrototype* arrayProto)
</ins><span class="cx">         : InternalFunctionImp(funcProto)
</span><span class="cx"> {
</span><span class="cx">     // ECMA 15.4.3.1 Array.prototype
</span><span class="lines">@@ -749,7 +731,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // ECMA 15.4.2
</span><del>-JSObject *ArrayObjectImp::construct(ExecState *exec, const List &amp;args)
</del><ins>+JSObject* ArrayObjectImp::construct(ExecState* exec, const List&amp; args)
</ins><span class="cx"> {
</span><span class="cx">     // a single numeric argument denotes the array size (!)
</span><span class="cx">     if (args.size() == 1 &amp;&amp; args[0]-&gt;isNumber()) {
</span><span class="lines">@@ -764,7 +746,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // ECMA 15.6.1
</span><del>-JSValue *ArrayObjectImp::callAsFunction(ExecState *exec, JSObject *, const List &amp;args)
</del><ins>+JSValue* ArrayObjectImp::callAsFunction(ExecState* exec, JSObject*, const List&amp; args)
</ins><span class="cx"> {
</span><span class="cx">     // equivalent to 'new Array(....)'
</span><span class="cx">     return construct(exec,args);
</span></span></pre>
</div>
</div>

</body>
</html>