Changeset 138964 in webkit


Ignore:
Timestamp:
Jan 7, 2013 11:03:44 AM (11 years ago)
Author:
commit-queue@webkit.org
Message:

[JSC] Copy non-index properties of arrays in SerializedScriptValue
https://bugs.webkit.org/show_bug.cgi?id=105575

Patch by Michael Pruett <michael@68k.org> on 2013-01-07
Reviewed by Oliver Hunt.

The structured cloning algorithm requires copying all properties of
array objects, including non-index properties.

Source/WebCore:

Tests: fast/storage/serialized-script-value.html

storage/indexeddb/structured-clone.html

  • bindings/js/SerializedScriptValue.cpp:

(WebCore):
(WebCore::CloneSerializer::serialize):
(WebCore::CloneDeserializer::putProperty):
(WebCore::CloneDeserializer::deserialize):

LayoutTests:

  • fast/storage/resources/serialized-script-value.js:
  • fast/storage/serialized-script-value-expected.txt:
  • fast/storage/serialized-script-value.html:
  • platform/chromium/fast/storage/serialized-script-value-expected.txt:
  • platform/chromium/fast/storage/serialized-script-value.html:
Location:
trunk
Files:
8 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r138961 r138964  
     12013-01-07  Michael Pruett  <michael@68k.org>
     2
     3        [JSC] Copy non-index properties of arrays in SerializedScriptValue
     4        https://bugs.webkit.org/show_bug.cgi?id=105575
     5
     6        Reviewed by Oliver Hunt.
     7
     8        The structured cloning algorithm requires copying all properties of
     9        array objects, including non-index properties.
     10
     11        * fast/storage/resources/serialized-script-value.js:
     12        * fast/storage/serialized-script-value-expected.txt:
     13        * fast/storage/serialized-script-value.html:
     14        * platform/chromium/fast/storage/serialized-script-value-expected.txt:
     15        * platform/chromium/fast/storage/serialized-script-value.html:
     16
    1172013-01-07  Mihnea Ovidenie  <mihnea@adobe.com>
    218
  • trunk/LayoutTests/fast/storage/resources/serialized-script-value.js

    r137346 r138964  
    4747}
    4848
     49function areValuesIdentical(a, b) {
     50    function sortObject(object) {
     51        if (typeof object != "object" || object === null)
     52            return object;
     53        return Object.keys(object).sort().map(function(key) {
     54            return { key: key, value: sortObject(object[key]) };
     55        });
     56    }
     57    return JSON.stringify(sortObject(a)) === JSON.stringify(sortObject(b));
     58}
    4959
    5060function _testSerialization(bytesPerElement, obj, values, oldFormat, serializeExceptionValue) {
     
    5666        self.newObj = internals.deserializeBuffer(makeBuffer(bytesPerElement, values));
    5767        shouldBe("JSON.stringify(newObj)", "JSON.stringify(obj)");
     68        shouldBeTrue("areValuesIdentical(newObj, obj)");
    5869
    5970        if (oldFormat) {
    6071            self.newObj = internals.deserializeBuffer(makeBuffer(bytesPerElement, oldFormat));
    6172            shouldBe("JSON.stringify(newObj)", "JSON.stringify(obj)");
     73            shouldBeTrue("areValuesIdentical(newObj, obj)");
    6274        }
    6375    }
  • trunk/LayoutTests/fast/storage/serialized-script-value-expected.txt

    r137346 r138964  
    22Deserialize to {"foo":"zoo","bar":{"baz":"myNewKey"}}:
    33PASS JSON.stringify(newObj) is JSON.stringify(obj)
     4PASS areValuesIdentical(newObj, obj) is true
     5PASS JSON.stringify(newObj) is JSON.stringify(obj)
     6PASS areValuesIdentical(newObj, obj) is true
    47Serialize {"foo":"zoo","bar":{"baz":"myNewKey"}}:
    58PASS bufferView.length is expectedBufferValues.length
     
    710Deserialize to {"foo":"zoo","bar":"myNewKey"}:
    811PASS JSON.stringify(newObj) is JSON.stringify(obj)
     12PASS areValuesIdentical(newObj, obj) is true
     13PASS JSON.stringify(newObj) is JSON.stringify(obj)
     14PASS areValuesIdentical(newObj, obj) is true
    915Serialize {"foo":"zoo","bar":"myNewKey"}:
    1016PASS bufferView.length is expectedBufferValues.length
     
    1218Deserialize to []:
    1319PASS JSON.stringify(newObj) is JSON.stringify(obj)
     20PASS areValuesIdentical(newObj, obj) is true
     21PASS JSON.stringify(newObj) is JSON.stringify(obj)
     22PASS areValuesIdentical(newObj, obj) is true
    1423Serialize []:
    1524PASS bufferView.length is expectedBufferValues.length
     
    1726Deserialize to {"foo":"zoo"}:
    1827PASS JSON.stringify(newObj) is JSON.stringify(obj)
     28PASS areValuesIdentical(newObj, obj) is true
     29PASS JSON.stringify(newObj) is JSON.stringify(obj)
     30PASS areValuesIdentical(newObj, obj) is true
    1931Serialize {"foo":"zoo"}:
    2032PASS bufferView.length is expectedBufferValues.length
     
    2234Deserialize to {"foo":null}:
    2335PASS JSON.stringify(newObj) is JSON.stringify(obj)
     36PASS areValuesIdentical(newObj, obj) is true
     37PASS JSON.stringify(newObj) is JSON.stringify(obj)
     38PASS areValuesIdentical(newObj, obj) is true
    2439Serialize {"foo":null}:
    2540PASS bufferView.length is expectedBufferValues.length
     
    2742Deserialize to {}:
    2843PASS JSON.stringify(newObj) is JSON.stringify(obj)
     44PASS areValuesIdentical(newObj, obj) is true
     45PASS JSON.stringify(newObj) is JSON.stringify(obj)
     46PASS areValuesIdentical(newObj, obj) is true
    2947Serialize {}:
    3048PASS bufferView.length is expectedBufferValues.length
     
    3250Deserialize to undefined:
    3351PASS JSON.stringify(newObj) is JSON.stringify(obj)
     52PASS areValuesIdentical(newObj, obj) is true
     53PASS JSON.stringify(newObj) is JSON.stringify(obj)
     54PASS areValuesIdentical(newObj, obj) is true
    3455Serialize undefined:
    3556PASS bufferView.length is expectedBufferValues.length
     
    3758Deserialize to true:
    3859PASS JSON.stringify(newObj) is JSON.stringify(obj)
     60PASS areValuesIdentical(newObj, obj) is true
     61PASS JSON.stringify(newObj) is JSON.stringify(obj)
     62PASS areValuesIdentical(newObj, obj) is true
    3963Serialize true:
    4064PASS bufferView.length is expectedBufferValues.length
     
    4266Deserialize to false:
    4367PASS JSON.stringify(newObj) is JSON.stringify(obj)
     68PASS areValuesIdentical(newObj, obj) is true
     69PASS JSON.stringify(newObj) is JSON.stringify(obj)
     70PASS areValuesIdentical(newObj, obj) is true
    4471Serialize false:
    4572PASS bufferView.length is expectedBufferValues.length
     
    4774Deserialize to [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]:
    4875PASS JSON.stringify(newObj) is JSON.stringify(obj)
     76PASS areValuesIdentical(newObj, obj) is true
     77PASS JSON.stringify(newObj) is JSON.stringify(obj)
     78PASS areValuesIdentical(newObj, obj) is true
    4979Serialize [null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null,null]:
    5080PASS bufferView.length is expectedBufferValues.length
     
    5282Deserialize to 10:
    5383PASS JSON.stringify(newObj) is JSON.stringify(obj)
     84PASS areValuesIdentical(newObj, obj) is true
     85PASS JSON.stringify(newObj) is JSON.stringify(obj)
     86PASS areValuesIdentical(newObj, obj) is true
    5487Serialize 10:
    5588PASS bufferView.length is expectedBufferValues.length
     
    5790Deserialize to -10:
    5891PASS JSON.stringify(newObj) is JSON.stringify(obj)
     92PASS areValuesIdentical(newObj, obj) is true
     93PASS JSON.stringify(newObj) is JSON.stringify(obj)
     94PASS areValuesIdentical(newObj, obj) is true
    5995Serialize -10:
    6096PASS bufferView.length is expectedBufferValues.length
     
    6298Deserialize to 1073741824:
    6399PASS JSON.stringify(newObj) is JSON.stringify(obj)
     100PASS areValuesIdentical(newObj, obj) is true
     101PASS JSON.stringify(newObj) is JSON.stringify(obj)
     102PASS areValuesIdentical(newObj, obj) is true
    64103Serialize 1073741824:
    65104PASS bufferView.length is expectedBufferValues.length
     
    67106Deserialize to 36028797018963970:
    68107PASS JSON.stringify(newObj) is JSON.stringify(obj)
     108PASS areValuesIdentical(newObj, obj) is true
     109PASS JSON.stringify(newObj) is JSON.stringify(obj)
     110PASS areValuesIdentical(newObj, obj) is true
    69111Serialize 36028797018963970:
    70112PASS bufferView.length is expectedBufferValues.length
     
    72114Deserialize to 1.23:
    73115PASS JSON.stringify(newObj) is JSON.stringify(obj)
     116PASS areValuesIdentical(newObj, obj) is true
     117PASS JSON.stringify(newObj) is JSON.stringify(obj)
     118PASS areValuesIdentical(newObj, obj) is true
    74119Serialize 1.23:
    75120PASS bufferView.length is expectedBufferValues.length
     
    77122Deserialize to "":
    78123PASS JSON.stringify(newObj) is JSON.stringify(obj)
     124PASS areValuesIdentical(newObj, obj) is true
     125PASS JSON.stringify(newObj) is JSON.stringify(obj)
     126PASS areValuesIdentical(newObj, obj) is true
    79127Serialize "":
    80128PASS bufferView.length is expectedBufferValues.length
     
    82130Deserialize to "abc":
    83131PASS JSON.stringify(newObj) is JSON.stringify(obj)
     132PASS areValuesIdentical(newObj, obj) is true
     133PASS JSON.stringify(newObj) is JSON.stringify(obj)
     134PASS areValuesIdentical(newObj, obj) is true
    84135Serialize "abc":
    85136PASS bufferView.length is expectedBufferValues.length
     
    87138Deserialize to {"integer":123}:
    88139PASS JSON.stringify(newObj) is JSON.stringify(obj)
     140PASS areValuesIdentical(newObj, obj) is true
     141PASS JSON.stringify(newObj) is JSON.stringify(obj)
     142PASS areValuesIdentical(newObj, obj) is true
    89143Serialize {"integer":123}:
    90144PASS bufferView.length is expectedBufferValues.length
     
    92146Deserialize to {"string":"str"}:
    93147PASS JSON.stringify(newObj) is JSON.stringify(obj)
     148PASS areValuesIdentical(newObj, obj) is true
     149PASS JSON.stringify(newObj) is JSON.stringify(obj)
     150PASS areValuesIdentical(newObj, obj) is true
    94151Serialize {"string":"str"}:
    95152PASS bufferView.length is expectedBufferValues.length
     
    97154Deserialize to {"list":[1,2,3]}:
    98155PASS JSON.stringify(newObj) is JSON.stringify(obj)
     156PASS areValuesIdentical(newObj, obj) is true
     157PASS JSON.stringify(newObj) is JSON.stringify(obj)
     158PASS areValuesIdentical(newObj, obj) is true
    99159Serialize {"list":[1,2,3]}:
    100160PASS bufferView.length is expectedBufferValues.length
     
    102162Deserialize to null:
    103163PASS JSON.stringify(newObj) is JSON.stringify(obj)
     164PASS areValuesIdentical(newObj, obj) is true
     165PASS JSON.stringify(newObj) is JSON.stringify(obj)
     166PASS areValuesIdentical(newObj, obj) is true
    104167Serialize null:
    105168PASS bufferView.length is expectedBufferValues.length
     
    107170Deserialize to {}:
    108171PASS JSON.stringify(newObj) is JSON.stringify(obj)
     172PASS areValuesIdentical(newObj, obj) is true
     173PASS JSON.stringify(newObj) is JSON.stringify(obj)
     174PASS areValuesIdentical(newObj, obj) is true
    109175Serialize {}:
    110176PASS bufferView.length is expectedBufferValues.length
     
    112178Deserialize to {"inner":{"hello":"there"},"outer":{"hello":"there"}}:
    113179PASS JSON.stringify(newObj) is JSON.stringify(obj)
     180PASS areValuesIdentical(newObj, obj) is true
     181PASS JSON.stringify(newObj) is JSON.stringify(obj)
     182PASS areValuesIdentical(newObj, obj) is true
    114183Serialize {"inner":{"hello":"there"},"outer":{"hello":"there"}}:
    115184PASS bufferView.length is expectedBufferValues.length
     
    117186Deserialize to {"hello":"there"}:
    118187PASS JSON.stringify(newObj) is JSON.stringify(obj)
     188PASS areValuesIdentical(newObj, obj) is true
     189PASS JSON.stringify(newObj) is JSON.stringify(obj)
     190PASS areValuesIdentical(newObj, obj) is true
    119191Serialize {"hello":"there"}:
    120192PASS bufferView.length is expectedBufferValues.length
     
    122194Deserialize to {"a":"a","u":"αβ","d":42}:
    123195PASS JSON.stringify(newObj) is JSON.stringify(obj)
     196PASS areValuesIdentical(newObj, obj) is true
     197PASS JSON.stringify(newObj) is JSON.stringify(obj)
     198PASS areValuesIdentical(newObj, obj) is true
    124199Serialize {"a":"a","u":"αβ","d":42}:
    125200PASS bufferView.length is expectedBufferValues.length
     
    127202Deserialize to {"a":"ab","u":"αβ","d":42}:
    128203PASS JSON.stringify(newObj) is JSON.stringify(obj)
     204PASS areValuesIdentical(newObj, obj) is true
     205PASS JSON.stringify(newObj) is JSON.stringify(obj)
     206PASS areValuesIdentical(newObj, obj) is true
    129207Serialize {"a":"ab","u":"αβ","d":42}:
     208PASS bufferView.length is expectedBufferValues.length
     209
     210Deserialize to []:
     211PASS JSON.stringify(newObj) is JSON.stringify(obj)
     212PASS areValuesIdentical(newObj, obj) is true
     213Serialize []:
     214PASS bufferView.length is expectedBufferValues.length
     215
     216Deserialize to ["foo","bar"]:
     217PASS JSON.stringify(newObj) is JSON.stringify(obj)
     218PASS areValuesIdentical(newObj, obj) is true
     219Serialize ["foo","bar"]:
    130220PASS bufferView.length is expectedBufferValues.length
    131221
  • trunk/LayoutTests/fast/storage/serialized-script-value.html

    r137346 r138964  
    1818testSerialization({foo: 'zoo', bar: {baz: 'myNewKey'}},
    1919[
    20     0x03, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,
     20    0x04, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,
    2121    0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x10,
    2222    0x03, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x6f, 0x00,
     
    2828    0x65, 0x00, 0x79, 0x00, 0xff, 0xff, 0xff, 0xff,
    2929    0xff, 0xff, 0xff, 0xff
     30],
     31[
     32    0x03, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,
     33    0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x10,
     34    0x03, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x6f, 0x00,
     35    0x6f, 0x00, 0x03, 0x00, 0x00, 0x00, 0x62, 0x00,
     36    0x61, 0x00, 0x72, 0x00, 0x02, 0x03, 0x00, 0x00,
     37    0x00, 0x62, 0x00, 0x61, 0x00, 0x7a, 0x00, 0x10,
     38    0x08, 0x00, 0x00, 0x00, 0x6d, 0x00, 0x79, 0x00,
     39    0x4e, 0x00, 0x65, 0x00, 0x77, 0x00, 0x4b, 0x00,
     40    0x65, 0x00, 0x79, 0x00, 0xff, 0xff, 0xff, 0xff,
     41    0xff, 0xff, 0xff, 0xff
    3042]);
    3143
    3244testSerialization({foo: 'zoo', bar: 'myNewKey'},
    3345[
    34     0x03, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,
     46    0x04, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,
    3547    0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x10,
    3648    0x03, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x6f, 0x00,
     
    4052    0x00, 0x77, 0x00, 0x4b, 0x00, 0x65, 0x00, 0x79,
    4153    0x00, 0xff, 0xff, 0xff, 0xff
     54],
     55[
     56    0x03, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,
     57    0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x10,
     58    0x03, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x6f, 0x00,
     59    0x6f, 0x00, 0x03, 0x00, 0x00, 0x00, 0x62, 0x00,
     60    0x61, 0x00, 0x72, 0x00, 0x10, 0x08, 0x00, 0x00,
     61    0x00, 0x6d, 0x00, 0x79, 0x00, 0x4e, 0x00, 0x65,
     62    0x00, 0x77, 0x00, 0x4b, 0x00, 0x65, 0x00, 0x79,
     63    0x00, 0xff, 0xff, 0xff, 0xff
    4264]);
    4365
    4466testSerialization([],
    4567[
     68    0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
     69    0x00, 0xff, 0xff, 0xff, 0xff
     70],
     71[
    4672    0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
    4773    0x00, 0xff, 0xff, 0xff, 0xff
     
    4975testSerialization({foo: "zoo"},
    5076[
     77    0x04, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,
     78    0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x10,
     79    0x03, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x6f, 0x00,
     80    0x6f, 0x00, 0xff, 0xff, 0xff, 0xff
     81],
     82[
    5183    0x03, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,
    5284    0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x10,
     
    5587]);
    5688testSerialization({foo: null},
     89[
     90    0x04, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,
     91    0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x04,
     92    0xff, 0xff, 0xff, 0xff
     93],
    5794[
    5895    0x03, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,
     
    63100testSerialization({},
    64101[
     102    0x04, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff, 0xff,
     103    0xff
     104],
     105[
    65106    0x03, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff, 0xff,
    66107    0xff
     
    69110testSerialization(undefined,
    70111[
     112    0x04, 0x00, 0x00, 0x00, 0x03
     113],
     114[
    71115    0x03, 0x00, 0x00, 0x00, 0x03
    72116]);
    73117testSerialization(true,
    74118[
     119    0x04, 0x00, 0x00, 0x00, 0x09
     120],
     121[
    75122    0x03, 0x00, 0x00, 0x00, 0x09
    76123]);
    77124testSerialization(false,
    78125[
     126    0x04, 0x00, 0x00, 0x00, 0x08
     127],
     128[
    79129    0x03, 0x00, 0x00, 0x00, 0x08
    80130]);
    81131testSerialization(new Array(100),
    82132[
     133    0x04, 0x00, 0x00, 0x00, 0x01, 0x64, 0x00, 0x00,
     134    0x00, 0xff, 0xff, 0xff, 0xff
     135],
     136[
    83137    0x03, 0x00, 0x00, 0x00, 0x01, 0x64, 0x00, 0x00,
    84138    0x00, 0xff, 0xff, 0xff, 0xff
    85139]);
    86140testSerialization(10,
     141[
     142    0x04, 0x00, 0x00, 0x00, 0x05, 0x0a, 0x00, 0x00,
     143    0x00
     144],
    87145[
    88146    0x03, 0x00, 0x00, 0x00, 0x05, 0x0a, 0x00, 0x00,
     
    91149testSerialization(-10,
    92150[
     151    0x04, 0x00, 0x00, 0x00, 0x05, 0xf6, 0xff, 0xff,
     152    0xff
     153],
     154[
    93155    0x03, 0x00, 0x00, 0x00, 0x05, 0xf6, 0xff, 0xff,
    94156    0xff
    95157]);
    96158testSerialization(Math.pow(2,30),
     159[
     160    0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
     161    0x40
     162],
    97163[
    98164    0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00,
     
    101167testSerialization(Math.pow(2,55),
    102168[
     169    0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
     170    0x00, 0x00, 0x00, 0x60, 0x43,
     171],
     172[
    103173    0x03, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00,
    104174    0x00, 0x00, 0x00, 0x60, 0x43,
     
    106176testSerialization(1.23,
    107177[
     178    0x04, 0x00, 0x00, 0x00, 0x0a, 0xae, 0x47, 0xe1,
     179    0x7a, 0x14, 0xae, 0xf3, 0x3f
     180],
     181[
    108182    0x03, 0x00, 0x00, 0x00, 0x0a, 0xae, 0x47, 0xe1,
    109183    0x7a, 0x14, 0xae, 0xf3, 0x3f
     
    111185testSerialization("",
    112186[
     187    0x04, 0x00, 0x00, 0x00, 0x11
     188],
     189[
    113190    0x03, 0x00, 0x00, 0x00, 0x11
    114191]);
    115192testSerialization("abc",
     193[
     194    0x04, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00,
     195    0x00, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00
     196],
    116197[
    117198    0x03, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00,
     
    119200]);
    120201testSerialization({integer: 123},
     202[
     203    0x04, 0x00, 0x00, 0x00, 0x02, 0x07, 0x00, 0x00,
     204    0x00, 0x69, 0x00, 0x6e, 0x00, 0x74, 0x00, 0x65,
     205    0x00, 0x67, 0x00, 0x65, 0x00, 0x72, 0x00, 0x05,
     206    0x7b, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff
     207],
    121208[
    122209    0x03, 0x00, 0x00, 0x00, 0x02, 0x07, 0x00, 0x00,
     
    127214testSerialization({string: "str"},
    128215[
     216    0x04, 0x00, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00,
     217    0x00, 0x73, 0x00, 0x74, 0x00, 0x72, 0x00, 0x69,
     218    0x00, 0x6e, 0x00, 0x67, 0x00, 0x10, 0x03, 0x00,
     219    0x00, 0x00, 0x73, 0x00, 0x74, 0x00, 0x72, 0x00,
     220    0xff, 0xff, 0xff, 0xff
     221],
     222[
    129223    0x03, 0x00, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00,
    130224    0x00, 0x73, 0x00, 0x74, 0x00, 0x72, 0x00, 0x69,
     
    134228]);
    135229testSerialization({list: [1,2,3]},
     230[
     231    0x04, 0x00, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00,
     232    0x00, 0x6c, 0x00, 0x69, 0x00, 0x73, 0x00, 0x74,
     233    0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00,
     234    0x00, 0x00, 0x07, 0x01, 0x00, 0x00, 0x00, 0x05,
     235    0x02, 0x00, 0x00, 0x00, 0x02, 0x00, 0x00, 0x00,
     236    0x05, 0x03, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff,
     237    0xff, 0xff, 0xff, 0xff, 0xff
     238],
    136239[
    137240    0x03, 0x00, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00,
     
    145248testSerialization(null,
    146249[
     250    0x04, 0x00, 0x00, 0x00, 0x04
     251],
     252[
    147253    0x03, 0x00, 0x00, 0x00, 0x04
    148254]);
    149255testSerialization(/abc/,
     256[
     257    0x04, 0x00, 0x00, 0x00, 0x12, 0x03, 0x00, 0x00,
     258    0x00, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00, 0x00,
     259    0x00, 0x00, 0x00
     260],
    150261[
    151262    0x03, 0x00, 0x00, 0x00, 0x12, 0x03, 0x00, 0x00,
     
    158269outerObject['outer'] = innerObject;
    159270testSerialization(outerObject,
     271[
     272    0x04, 0x00, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00,
     273    0x00, 0x69, 0x00, 0x6e, 0x00, 0x6e, 0x00, 0x65,
     274    0x00, 0x72, 0x00, 0x02, 0x05, 0x00, 0x00, 0x00,
     275    0x68, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c, 0x00,
     276    0x6f, 0x00, 0x10, 0x05, 0x00, 0x00, 0x00, 0x74,
     277    0x00, 0x68, 0x00, 0x65, 0x00, 0x72, 0x00, 0x65,
     278    0x00, 0xff, 0xff, 0xff, 0xff, 0x05, 0x00, 0x00,
     279    0x00, 0x6f, 0x00, 0x75, 0x00, 0x74, 0x00, 0x65,
     280    0x00, 0x72, 0x00, 0x13, 0x01, 0xff, 0xff, 0xff,
     281    0xff
     282],
    160283[
    161284    0x03, 0x00, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00,
     
    172295testSerialization(innerObject,
    173296[
     297    0x04, 0x00, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00,
     298    0x00, 0x68, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c,
     299    0x00, 0x6f, 0x00, 0x10, 0x05, 0x00, 0x00, 0x00,
     300    0x74, 0x00, 0x68, 0x00, 0x65, 0x00, 0x72, 0x00,
     301    0x65, 0x00, 0xff, 0xff, 0xff, 0xff
     302],
     303[
    174304    0x03, 0x00, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00,
    175305    0x00, 0x68, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c,
     
    181311var unicodeObject = {a: 'a', u: String.fromCharCode(0x03B1,0x03B2), d: 42};
    182312testSerialization(unicodeObject,
     313[
     314    0x04, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
     315    0x00, 0x61, 0x00, 0x10, 0xfe, 0xff, 0xff, 0xff,
     316    0x00, 0x01, 0x00, 0x00, 0x00, 0x75, 0x00, 0x10,
     317    0x02, 0x00, 0x00, 0x00, 0xb1, 0x03, 0xb2, 0x03,
     318    0x01, 0x00, 0x00, 0x00, 0x64, 0x00, 0x05, 0x2a,
     319    0x00, 0x00, 0x00, 0xff, 0xff, 0xff, 0xff
     320],
    183321[
    184322    0x03, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
     
    191329unicodeObject.a = 'ab';
    192330testSerialization(unicodeObject,
     331[
     332    0x04, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
     333    0x00, 0x61, 0x00, 0x10, 0x02, 0x00, 0x00, 0x00,
     334    0x61, 0x00, 0x62, 0x00, 0x01, 0x00, 0x00, 0x00,
     335    0x75, 0x00, 0x10, 0x02, 0x00, 0x00, 0x00, 0xb1,
     336    0x03, 0xb2, 0x03, 0x01, 0x00, 0x00, 0x00, 0x64,
     337    0x00, 0x05, 0x2a, 0x00, 0x00, 0x00, 0xff, 0xff,
     338    0xff, 0xff
     339],
    193340[
    194341    0x03, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00,
     
    201348]);
    202349
     350var arrayObject = [];
     351arrayObject['a'] = true;
     352arrayObject['b'] = false;
     353arrayObject['foo'] = 123;
     354arrayObject['bar'] = 456;
     355arrayObject[''] = null;
     356testSerialization(arrayObject,
     357[
     358    0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00,
     359    0x00, 0xfd, 0xff, 0xff, 0xff, 0x01, 0x00, 0x00,
     360    0x00, 0x61, 0x00, 0x09, 0x01, 0x00, 0x00, 0x00,
     361    0x62, 0x00, 0x08, 0x03, 0x00, 0x00, 0x00, 0x66,
     362    0x00, 0x6f, 0x00, 0x6f, 0x00, 0x05, 0x7b, 0x00,
     363    0x00, 0x00, 0x03, 0x00, 0x00, 0x00, 0x62, 0x00,
     364    0x61, 0x00, 0x72, 0x00, 0x05, 0xc8, 0x01, 0x00,
     365    0x00, 0x00, 0x00, 0x00, 0x00, 0x04, 0xff, 0xff,
     366    0xff, 0xff
     367]);
     368
     369arrayObject[0] = 'foo';
     370arrayObject[1] = 'bar';
     371testSerialization(arrayObject,
     372[
     373    0x04, 0x00, 0x00, 0x00, 0x01, 0x02, 0x00, 0x00,
     374    0x00, 0x00, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00,
     375    0x00, 0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00,
     376    0x01, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00,
     377    0x00, 0x62, 0x00, 0x61, 0x00, 0x72, 0x00, 0xfd,
     378    0xff, 0xff, 0xff, 0x01, 0x00, 0x00, 0x00, 0x61,
     379    0x00, 0x09, 0x01, 0x00, 0x00, 0x00, 0x62, 0x00,
     380    0x08, 0xfe, 0xff, 0xff, 0xff, 0x00, 0x05, 0x7b,
     381    0x00, 0x00, 0x00, 0xfe, 0xff, 0xff, 0xff, 0x01,
     382    0x05, 0xc8, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00,
     383    0x00, 0x04, 0xff, 0xff, 0xff, 0xff
     384]);
     385
    203386testSerialization(function(){}, [], null, DOMException.DATA_CLONE_ERR);
    204387        </script>
  • trunk/LayoutTests/platform/chromium/fast/storage/serialized-script-value-expected.txt

    r136624 r138964  
    22Deserialize to {"foo":"zoo","bar":{"baz":"myNewKey"}}:
    33PASS JSON.stringify(newObj) is JSON.stringify(obj)
     4PASS areValuesIdentical(newObj, obj) is true
    45Serialize {"foo":"zoo","bar":{"baz":"myNewKey"}}:
    56PASS bufferView.length is expectedBufferValues.length
     
    78Deserialize to {"foo":"zoo","bar":"myNewKey"}:
    89PASS JSON.stringify(newObj) is JSON.stringify(obj)
     10PASS areValuesIdentical(newObj, obj) is true
    911Serialize {"foo":"zoo","bar":"myNewKey"}:
    1012PASS bufferView.length is expectedBufferValues.length
     
    1214Deserialize to []:
    1315PASS JSON.stringify(newObj) is JSON.stringify(obj)
     16PASS areValuesIdentical(newObj, obj) is true
    1417Serialize []:
    1518PASS bufferView.length is expectedBufferValues.length
     
    1720Deserialize to {"foo":"zoo"}:
    1821PASS JSON.stringify(newObj) is JSON.stringify(obj)
     22PASS areValuesIdentical(newObj, obj) is true
    1923PASS JSON.stringify(newObj) is JSON.stringify(obj)
     24PASS areValuesIdentical(newObj, obj) is true
    2025Serialize {"foo":"zoo"}:
    2126PASS bufferView.length is expectedBufferValues.length
     
    2328Deserialize to {"foo":null}:
    2429PASS JSON.stringify(newObj) is JSON.stringify(obj)
     30PASS areValuesIdentical(newObj, obj) is true
    2531PASS JSON.stringify(newObj) is JSON.stringify(obj)
     32PASS areValuesIdentical(newObj, obj) is true
    2633Serialize {"foo":null}:
    2734PASS bufferView.length is expectedBufferValues.length
     
    2936Deserialize to {}:
    3037PASS JSON.stringify(newObj) is JSON.stringify(obj)
     38PASS areValuesIdentical(newObj, obj) is true
    3139PASS JSON.stringify(newObj) is JSON.stringify(obj)
     40PASS areValuesIdentical(newObj, obj) is true
    3241Serialize {}:
    3342PASS bufferView.length is expectedBufferValues.length
     
    3544Deserialize to undefined:
    3645PASS JSON.stringify(newObj) is JSON.stringify(obj)
     46PASS areValuesIdentical(newObj, obj) is true
    3747Serialize undefined:
    3848PASS bufferView.length is expectedBufferValues.length
     
    4050Deserialize to true:
    4151PASS JSON.stringify(newObj) is JSON.stringify(obj)
     52PASS areValuesIdentical(newObj, obj) is true
    4253Serialize true:
    4354PASS bufferView.length is expectedBufferValues.length
     
    4556Deserialize to false:
    4657PASS JSON.stringify(newObj) is JSON.stringify(obj)
     58PASS areValuesIdentical(newObj, obj) is true
    4759Serialize false:
    4860PASS bufferView.length is expectedBufferValues.length
     
    5062Deserialize to 10:
    5163PASS JSON.stringify(newObj) is JSON.stringify(obj)
     64PASS areValuesIdentical(newObj, obj) is true
    5265Serialize 10:
    5366PASS bufferView.length is expectedBufferValues.length
     
    5568Deserialize to -10:
    5669PASS JSON.stringify(newObj) is JSON.stringify(obj)
     70PASS areValuesIdentical(newObj, obj) is true
    5771Serialize -10:
    5872PASS bufferView.length is expectedBufferValues.length
     
    6074Deserialize to 1073741824:
    6175PASS JSON.stringify(newObj) is JSON.stringify(obj)
     76PASS areValuesIdentical(newObj, obj) is true
    6277Serialize 1073741824:
    6378PASS bufferView.length is expectedBufferValues.length
     
    6580Deserialize to 36028797018963970:
    6681PASS JSON.stringify(newObj) is JSON.stringify(obj)
     82PASS areValuesIdentical(newObj, obj) is true
    6783Serialize 36028797018963970:
    6884PASS bufferView.length is expectedBufferValues.length
     
    7086Deserialize to 1.23:
    7187PASS JSON.stringify(newObj) is JSON.stringify(obj)
     88PASS areValuesIdentical(newObj, obj) is true
    7289Serialize 1.23:
    7390PASS bufferView.length is expectedBufferValues.length
     
    7592Deserialize to "":
    7693PASS JSON.stringify(newObj) is JSON.stringify(obj)
     94PASS areValuesIdentical(newObj, obj) is true
    7795Serialize "":
    7896PASS bufferView.length is expectedBufferValues.length
     
    8098Deserialize to "abc":
    8199PASS JSON.stringify(newObj) is JSON.stringify(obj)
     100PASS areValuesIdentical(newObj, obj) is true
    82101Serialize "abc":
    83102PASS bufferView.length is expectedBufferValues.length
     
    85104Deserialize to {"integer":123}:
    86105PASS JSON.stringify(newObj) is JSON.stringify(obj)
     106PASS areValuesIdentical(newObj, obj) is true
    87107Serialize {"integer":123}:
    88108PASS bufferView.length is expectedBufferValues.length
     
    90110Deserialize to {"string":"str"}:
    91111PASS JSON.stringify(newObj) is JSON.stringify(obj)
     112PASS areValuesIdentical(newObj, obj) is true
    92113Serialize {"string":"str"}:
    93114PASS bufferView.length is expectedBufferValues.length
     
    95116Deserialize to {"list":[1,2,3]}:
    96117PASS JSON.stringify(newObj) is JSON.stringify(obj)
     118PASS areValuesIdentical(newObj, obj) is true
    97119Serialize {"list":[1,2,3]}:
    98120PASS bufferView.length is expectedBufferValues.length
     
    100122Deserialize to null:
    101123PASS JSON.stringify(newObj) is JSON.stringify(obj)
     124PASS areValuesIdentical(newObj, obj) is true
    102125Serialize null:
    103126PASS bufferView.length is expectedBufferValues.length
     
    105128Deserialize to {}:
    106129PASS JSON.stringify(newObj) is JSON.stringify(obj)
     130PASS areValuesIdentical(newObj, obj) is true
    107131Serialize {}:
    108132PASS bufferView.length is expectedBufferValues.length
     
    110134Deserialize to {"inner":{"hello":"there"},"outer":{"hello":"there"}}:
    111135PASS JSON.stringify(newObj) is JSON.stringify(obj)
     136PASS areValuesIdentical(newObj, obj) is true
    112137Serialize {"inner":{"hello":"there"},"outer":{"hello":"there"}}:
    113138PASS bufferView.length is expectedBufferValues.length
     
    115140Deserialize to {"hello":"there"}:
    116141PASS JSON.stringify(newObj) is JSON.stringify(obj)
     142PASS areValuesIdentical(newObj, obj) is true
    117143Serialize {"hello":"there"}:
    118144PASS bufferView.length is expectedBufferValues.length
     
    120146Deserialize to {"a":"a","u":"αβ","d":42}:
    121147PASS JSON.stringify(newObj) is JSON.stringify(obj)
     148PASS areValuesIdentical(newObj, obj) is true
    122149PASS JSON.stringify(newObj) is JSON.stringify(obj)
     150PASS areValuesIdentical(newObj, obj) is true
    123151Serialize {"a":"a","u":"αβ","d":42}:
    124152PASS bufferView.length is expectedBufferValues.length
     
    126154Deserialize to {"a":"ab","u":"αβ","d":42}:
    127155PASS JSON.stringify(newObj) is JSON.stringify(obj)
     156PASS areValuesIdentical(newObj, obj) is true
    128157PASS JSON.stringify(newObj) is JSON.stringify(obj)
     158PASS areValuesIdentical(newObj, obj) is true
    129159Serialize {"a":"ab","u":"αβ","d":42}:
     160PASS bufferView.length is expectedBufferValues.length
     161
     162Deserialize to []:
     163PASS JSON.stringify(newObj) is JSON.stringify(obj)
     164PASS areValuesIdentical(newObj, obj) is true
     165PASS JSON.stringify(newObj) is JSON.stringify(obj)
     166PASS areValuesIdentical(newObj, obj) is true
     167Serialize []:
     168PASS bufferView.length is expectedBufferValues.length
     169
     170Deserialize to ["foo","bar"]:
     171PASS JSON.stringify(newObj) is JSON.stringify(obj)
     172PASS areValuesIdentical(newObj, obj) is true
     173PASS JSON.stringify(newObj) is JSON.stringify(obj)
     174PASS areValuesIdentical(newObj, obj) is true
     175Serialize ["foo","bar"]:
    130176PASS bufferView.length is expectedBufferValues.length
    131177
  • trunk/LayoutTests/platform/chromium/fast/storage/serialized-script-value.html

    r137346 r138964  
    106106                   0x5301, 0x6401, 0x013f, 0x5449, 0x037b]);
    107107
     108var arrayObject = [];
     109arrayObject['a'] = true;
     110arrayObject['b'] = false;
     111arrayObject['foo'] = 123;
     112arrayObject['bar'] = 456;
     113arrayObject[''] = null;
     114testSerialization(arrayObject,
     115                  [0x02ff, 0x003f, 0x0041, 0x013f, 0x0153,
     116                   0x3f61, 0x5401, 0x013f, 0x0153, 0x3f62,
     117                   0x4601, 0x013f, 0x0353, 0x6f66, 0x3f6f,
     118                   0x4901, 0x01f6, 0x013f, 0x0353, 0x6162,
     119                   0x3f72, 0x4901, 0x0790, 0x013f, 0x0053,
     120                   0x013f, 0x2430, 0x0005],
     121                  [0x01ff, 0x003f, 0x0041, 0x013f, 0x0153,
     122                   0x3f61, 0x5401, 0x013f, 0x0153, 0x3f62,
     123                   0x4601, 0x013f, 0x0353, 0x6f66, 0x3f6f,
     124                   0x4901, 0x01f6, 0x013f, 0x0353, 0x6162,
     125                   0x3f72, 0x4901, 0x0790, 0x013f, 0x0053,
     126                   0x013f, 0x2430, 0x0005]);
     127
     128arrayObject[0] = 'foo';
     129arrayObject[1] = 'bar';
     130testSerialization(arrayObject,
     131                  [0x02ff, 0x003f, 0x0241, 0x013f, 0x0353,
     132                   0x6f66, 0x3f6f, 0x5301, 0x6203, 0x7261,
     133                   0x013f, 0x0153, 0x3f61, 0x5401, 0x013f,
     134                   0x0153, 0x3f62, 0x4601, 0x013f, 0x0353,
     135                   0x6f66, 0x3f6f, 0x4901, 0x01f6, 0x013f,
     136                   0x0353, 0x6162, 0x3f72, 0x4901, 0x0790,
     137                   0x013f, 0x0053, 0x013f, 0x2430, 0x0205],
     138                  [0x01ff, 0x003f, 0x0241, 0x013f, 0x0353,
     139                   0x6f66, 0x3f6f, 0x5301, 0x6203, 0x7261,
     140                   0x013f, 0x0153, 0x3f61, 0x5401, 0x013f,
     141                   0x0153, 0x3f62, 0x4601, 0x013f, 0x0353,
     142                   0x6f66, 0x3f6f, 0x4901, 0x01f6, 0x013f,
     143                   0x0353, 0x6162, 0x3f72, 0x4901, 0x0790,
     144                   0x013f, 0x0053, 0x013f, 0x2430, 0x0205]);
     145
    108146testSerialization(function(){}, [], null, DOMException.DATA_CLONE_ERR);
    109147        </script>
  • trunk/Source/WebCore/ChangeLog

    r138963 r138964  
     12013-01-07  Michael Pruett  <michael@68k.org>
     2
     3        [JSC] Copy non-index properties of arrays in SerializedScriptValue
     4        https://bugs.webkit.org/show_bug.cgi?id=105575
     5
     6        Reviewed by Oliver Hunt.
     7
     8        The structured cloning algorithm requires copying all properties of
     9        array objects, including non-index properties.
     10
     11        Tests: fast/storage/serialized-script-value.html
     12               storage/indexeddb/structured-clone.html
     13
     14        * bindings/js/SerializedScriptValue.cpp:
     15        (WebCore):
     16        (WebCore::CloneSerializer::serialize):
     17        (WebCore::CloneDeserializer::putProperty):
     18        (WebCore::CloneDeserializer::deserialize):
     19
    1202013-01-07  Alec Flett  <alecflett@chromium.org>
    221
  • trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp

    r137954 r138964  
    161161 * Version 3. added the FalseObjectTag, TrueObjectTag, NumberObjectTag, StringObjectTag
    162162 * and EmptyStringObjectTag for serialization of Boolean, Number and String objects.
     163 * Version 4. added support for serializing non-index properties of arrays.
    163164 */
    164 static const unsigned int CurrentVersion = 3;
    165 static const unsigned int TerminatorTag = 0xFFFFFFFF;
    166 static const unsigned int StringPoolTag = 0xFFFFFFFE;
     165static const unsigned CurrentVersion = 4;
     166static const unsigned TerminatorTag = 0xFFFFFFFF;
     167static const unsigned StringPoolTag = 0xFFFFFFFE;
     168static const unsigned NonIndexPropertiesTag = 0xFFFFFFFD;
    167169
    168170/*
     
    839841    Vector<uint32_t, 16> lengthStack;
    840842    Vector<PropertyNameArray, 16> propertyStack;
    841     Vector<JSObject*, 16> inputObjectStack;
    842     Vector<JSArray*, 16> inputArrayStack;
     843    Vector<JSObject*, 32> inputObjectStack;
    843844    Vector<WalkerState, 16> stateStack;
    844845    WalkerState state = StateUnknown;
     
    850851            case ArrayStartState: {
    851852                ASSERT(isArray(inValue));
    852                 if (inputObjectStack.size() + inputArrayStack.size() > maximumFilterRecursion)
     853                if (inputObjectStack.size() > maximumFilterRecursion)
    853854                    return StackOverflowError;
    854855
     
    857858                if (!startArray(inArray))
    858859                    break;
    859                 inputArrayStack.append(inArray);
     860                inputObjectStack.append(inArray);
    860861                indexStack.append(0);
    861862                lengthStack.append(length);
     
    870871                }
    871872
    872                 JSArray* array = inputArrayStack.last();
     873                JSObject* array = inputObjectStack.last();
    873874                uint32_t index = indexStack.last();
    874875                if (index == lengthStack.last()) {
    875                     endObject();
    876                     inputArrayStack.removeLast();
    877876                    indexStack.removeLast();
    878877                    lengthStack.removeLast();
     878
     879                    propertyStack.append(PropertyNameArray(m_exec));
     880                    array->methodTable()->getOwnNonIndexPropertyNames(array, m_exec, propertyStack.last(), ExcludeDontEnumProperties);
     881                    if (propertyStack.last().size()) {
     882                        write(NonIndexPropertiesTag);
     883                        indexStack.append(0);
     884                        goto objectStartVisitMember;
     885                    }
     886                    propertyStack.removeLast();
     887
     888                    endObject();
     889                    inputObjectStack.removeLast();
    879890                    break;
    880891                }
     
    903914            case ObjectStartState: {
    904915                ASSERT(inValue.isObject());
    905                 if (inputObjectStack.size() + inputArrayStack.size() > maximumFilterRecursion)
     916                if (inputObjectStack.size() > maximumFilterRecursion)
    906917                    return StackOverflowError;
    907918                JSObject* inObject = asObject(inValue);
     
    12801291    }
    12811292
    1282     void putProperty(JSArray* array, unsigned index, JSValue value)
    1283     {
    1284         array->putDirectIndex(m_exec, index, value);
     1293    void putProperty(JSObject* object, unsigned index, JSValue value)
     1294    {
     1295        object->putDirectIndex(m_exec, index, value);
    12851296    }
    12861297
     
    16011612    Vector<uint32_t, 16> indexStack;
    16021613    Vector<Identifier, 16> propertyNameStack;
    1603     Vector<JSObject*, 16> outputObjectStack;
    1604     Vector<JSArray*, 16> outputArrayStack;
     1614    Vector<JSObject*, 32> outputObjectStack;
    16051615    Vector<WalkerState, 16> stateStack;
    16061616    WalkerState state = StateUnknown;
     
    16191629            JSArray* outArray = constructEmptyArray(m_exec, 0, m_globalObject, length);
    16201630            m_gcBuffer.append(outArray);
    1621             outputArrayStack.append(outArray);
     1631            outputObjectStack.append(outArray);
    16221632            // fallthrough
    16231633        }
     
    16361646            }
    16371647            if (index == TerminatorTag) {
    1638                 JSArray* outArray = outputArrayStack.last();
     1648                JSObject* outArray = outputObjectStack.last();
    16391649                outValue = outArray;
    1640                 outputArrayStack.removeLast();
     1650                outputObjectStack.removeLast();
    16411651                break;
     1652            } else if (index == NonIndexPropertiesTag) {
     1653                goto objectStartVisitMember;
    16421654            }
    16431655
    16441656            if (JSValue terminal = readTerminal()) {
    1645                 putProperty(outputArrayStack.last(), index, terminal);
     1657                putProperty(outputObjectStack.last(), index, terminal);
    16461658                goto arrayStartVisitMember;
    16471659            }
     
    16531665        }
    16541666        case ArrayEndVisitMember: {
    1655             JSArray* outArray = outputArrayStack.last();
     1667            JSObject* outArray = outputObjectStack.last();
    16561668            putProperty(outArray, indexStack.last(), outValue);
    16571669            indexStack.removeLast();
     
    16601672        objectStartState:
    16611673        case ObjectStartState: {
    1662             if (outputObjectStack.size() + outputArrayStack.size() > maximumFilterRecursion)
     1674            if (outputObjectStack.size() > maximumFilterRecursion)
    16631675                return make_pair(JSValue(), StackOverflowError);
    16641676            JSObject* outObject = constructEmptyObject(m_exec, m_globalObject);
Note: See TracChangeset for help on using the changeset viewer.