Changeset 138964 in webkit
- Timestamp:
- Jan 7, 2013 11:03:44 AM (11 years ago)
- Location:
- trunk
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r138961 r138964 1 2013-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 1 17 2013-01-07 Mihnea Ovidenie <mihnea@adobe.com> 2 18 -
trunk/LayoutTests/fast/storage/resources/serialized-script-value.js
r137346 r138964 47 47 } 48 48 49 function 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 } 49 59 50 60 function _testSerialization(bytesPerElement, obj, values, oldFormat, serializeExceptionValue) { … … 56 66 self.newObj = internals.deserializeBuffer(makeBuffer(bytesPerElement, values)); 57 67 shouldBe("JSON.stringify(newObj)", "JSON.stringify(obj)"); 68 shouldBeTrue("areValuesIdentical(newObj, obj)"); 58 69 59 70 if (oldFormat) { 60 71 self.newObj = internals.deserializeBuffer(makeBuffer(bytesPerElement, oldFormat)); 61 72 shouldBe("JSON.stringify(newObj)", "JSON.stringify(obj)"); 73 shouldBeTrue("areValuesIdentical(newObj, obj)"); 62 74 } 63 75 } -
trunk/LayoutTests/fast/storage/serialized-script-value-expected.txt
r137346 r138964 2 2 Deserialize to {"foo":"zoo","bar":{"baz":"myNewKey"}}: 3 3 PASS JSON.stringify(newObj) is JSON.stringify(obj) 4 PASS areValuesIdentical(newObj, obj) is true 5 PASS JSON.stringify(newObj) is JSON.stringify(obj) 6 PASS areValuesIdentical(newObj, obj) is true 4 7 Serialize {"foo":"zoo","bar":{"baz":"myNewKey"}}: 5 8 PASS bufferView.length is expectedBufferValues.length … … 7 10 Deserialize to {"foo":"zoo","bar":"myNewKey"}: 8 11 PASS JSON.stringify(newObj) is JSON.stringify(obj) 12 PASS areValuesIdentical(newObj, obj) is true 13 PASS JSON.stringify(newObj) is JSON.stringify(obj) 14 PASS areValuesIdentical(newObj, obj) is true 9 15 Serialize {"foo":"zoo","bar":"myNewKey"}: 10 16 PASS bufferView.length is expectedBufferValues.length … … 12 18 Deserialize to []: 13 19 PASS JSON.stringify(newObj) is JSON.stringify(obj) 20 PASS areValuesIdentical(newObj, obj) is true 21 PASS JSON.stringify(newObj) is JSON.stringify(obj) 22 PASS areValuesIdentical(newObj, obj) is true 14 23 Serialize []: 15 24 PASS bufferView.length is expectedBufferValues.length … … 17 26 Deserialize to {"foo":"zoo"}: 18 27 PASS JSON.stringify(newObj) is JSON.stringify(obj) 28 PASS areValuesIdentical(newObj, obj) is true 29 PASS JSON.stringify(newObj) is JSON.stringify(obj) 30 PASS areValuesIdentical(newObj, obj) is true 19 31 Serialize {"foo":"zoo"}: 20 32 PASS bufferView.length is expectedBufferValues.length … … 22 34 Deserialize to {"foo":null}: 23 35 PASS JSON.stringify(newObj) is JSON.stringify(obj) 36 PASS areValuesIdentical(newObj, obj) is true 37 PASS JSON.stringify(newObj) is JSON.stringify(obj) 38 PASS areValuesIdentical(newObj, obj) is true 24 39 Serialize {"foo":null}: 25 40 PASS bufferView.length is expectedBufferValues.length … … 27 42 Deserialize to {}: 28 43 PASS JSON.stringify(newObj) is JSON.stringify(obj) 44 PASS areValuesIdentical(newObj, obj) is true 45 PASS JSON.stringify(newObj) is JSON.stringify(obj) 46 PASS areValuesIdentical(newObj, obj) is true 29 47 Serialize {}: 30 48 PASS bufferView.length is expectedBufferValues.length … … 32 50 Deserialize to undefined: 33 51 PASS JSON.stringify(newObj) is JSON.stringify(obj) 52 PASS areValuesIdentical(newObj, obj) is true 53 PASS JSON.stringify(newObj) is JSON.stringify(obj) 54 PASS areValuesIdentical(newObj, obj) is true 34 55 Serialize undefined: 35 56 PASS bufferView.length is expectedBufferValues.length … … 37 58 Deserialize to true: 38 59 PASS JSON.stringify(newObj) is JSON.stringify(obj) 60 PASS areValuesIdentical(newObj, obj) is true 61 PASS JSON.stringify(newObj) is JSON.stringify(obj) 62 PASS areValuesIdentical(newObj, obj) is true 39 63 Serialize true: 40 64 PASS bufferView.length is expectedBufferValues.length … … 42 66 Deserialize to false: 43 67 PASS JSON.stringify(newObj) is JSON.stringify(obj) 68 PASS areValuesIdentical(newObj, obj) is true 69 PASS JSON.stringify(newObj) is JSON.stringify(obj) 70 PASS areValuesIdentical(newObj, obj) is true 44 71 Serialize false: 45 72 PASS bufferView.length is expectedBufferValues.length … … 47 74 Deserialize 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]: 48 75 PASS JSON.stringify(newObj) is JSON.stringify(obj) 76 PASS areValuesIdentical(newObj, obj) is true 77 PASS JSON.stringify(newObj) is JSON.stringify(obj) 78 PASS areValuesIdentical(newObj, obj) is true 49 79 Serialize [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]: 50 80 PASS bufferView.length is expectedBufferValues.length … … 52 82 Deserialize to 10: 53 83 PASS JSON.stringify(newObj) is JSON.stringify(obj) 84 PASS areValuesIdentical(newObj, obj) is true 85 PASS JSON.stringify(newObj) is JSON.stringify(obj) 86 PASS areValuesIdentical(newObj, obj) is true 54 87 Serialize 10: 55 88 PASS bufferView.length is expectedBufferValues.length … … 57 90 Deserialize to -10: 58 91 PASS JSON.stringify(newObj) is JSON.stringify(obj) 92 PASS areValuesIdentical(newObj, obj) is true 93 PASS JSON.stringify(newObj) is JSON.stringify(obj) 94 PASS areValuesIdentical(newObj, obj) is true 59 95 Serialize -10: 60 96 PASS bufferView.length is expectedBufferValues.length … … 62 98 Deserialize to 1073741824: 63 99 PASS JSON.stringify(newObj) is JSON.stringify(obj) 100 PASS areValuesIdentical(newObj, obj) is true 101 PASS JSON.stringify(newObj) is JSON.stringify(obj) 102 PASS areValuesIdentical(newObj, obj) is true 64 103 Serialize 1073741824: 65 104 PASS bufferView.length is expectedBufferValues.length … … 67 106 Deserialize to 36028797018963970: 68 107 PASS JSON.stringify(newObj) is JSON.stringify(obj) 108 PASS areValuesIdentical(newObj, obj) is true 109 PASS JSON.stringify(newObj) is JSON.stringify(obj) 110 PASS areValuesIdentical(newObj, obj) is true 69 111 Serialize 36028797018963970: 70 112 PASS bufferView.length is expectedBufferValues.length … … 72 114 Deserialize to 1.23: 73 115 PASS JSON.stringify(newObj) is JSON.stringify(obj) 116 PASS areValuesIdentical(newObj, obj) is true 117 PASS JSON.stringify(newObj) is JSON.stringify(obj) 118 PASS areValuesIdentical(newObj, obj) is true 74 119 Serialize 1.23: 75 120 PASS bufferView.length is expectedBufferValues.length … … 77 122 Deserialize to "": 78 123 PASS JSON.stringify(newObj) is JSON.stringify(obj) 124 PASS areValuesIdentical(newObj, obj) is true 125 PASS JSON.stringify(newObj) is JSON.stringify(obj) 126 PASS areValuesIdentical(newObj, obj) is true 79 127 Serialize "": 80 128 PASS bufferView.length is expectedBufferValues.length … … 82 130 Deserialize to "abc": 83 131 PASS JSON.stringify(newObj) is JSON.stringify(obj) 132 PASS areValuesIdentical(newObj, obj) is true 133 PASS JSON.stringify(newObj) is JSON.stringify(obj) 134 PASS areValuesIdentical(newObj, obj) is true 84 135 Serialize "abc": 85 136 PASS bufferView.length is expectedBufferValues.length … … 87 138 Deserialize to {"integer":123}: 88 139 PASS JSON.stringify(newObj) is JSON.stringify(obj) 140 PASS areValuesIdentical(newObj, obj) is true 141 PASS JSON.stringify(newObj) is JSON.stringify(obj) 142 PASS areValuesIdentical(newObj, obj) is true 89 143 Serialize {"integer":123}: 90 144 PASS bufferView.length is expectedBufferValues.length … … 92 146 Deserialize to {"string":"str"}: 93 147 PASS JSON.stringify(newObj) is JSON.stringify(obj) 148 PASS areValuesIdentical(newObj, obj) is true 149 PASS JSON.stringify(newObj) is JSON.stringify(obj) 150 PASS areValuesIdentical(newObj, obj) is true 94 151 Serialize {"string":"str"}: 95 152 PASS bufferView.length is expectedBufferValues.length … … 97 154 Deserialize to {"list":[1,2,3]}: 98 155 PASS JSON.stringify(newObj) is JSON.stringify(obj) 156 PASS areValuesIdentical(newObj, obj) is true 157 PASS JSON.stringify(newObj) is JSON.stringify(obj) 158 PASS areValuesIdentical(newObj, obj) is true 99 159 Serialize {"list":[1,2,3]}: 100 160 PASS bufferView.length is expectedBufferValues.length … … 102 162 Deserialize to null: 103 163 PASS JSON.stringify(newObj) is JSON.stringify(obj) 164 PASS areValuesIdentical(newObj, obj) is true 165 PASS JSON.stringify(newObj) is JSON.stringify(obj) 166 PASS areValuesIdentical(newObj, obj) is true 104 167 Serialize null: 105 168 PASS bufferView.length is expectedBufferValues.length … … 107 170 Deserialize to {}: 108 171 PASS JSON.stringify(newObj) is JSON.stringify(obj) 172 PASS areValuesIdentical(newObj, obj) is true 173 PASS JSON.stringify(newObj) is JSON.stringify(obj) 174 PASS areValuesIdentical(newObj, obj) is true 109 175 Serialize {}: 110 176 PASS bufferView.length is expectedBufferValues.length … … 112 178 Deserialize to {"inner":{"hello":"there"},"outer":{"hello":"there"}}: 113 179 PASS JSON.stringify(newObj) is JSON.stringify(obj) 180 PASS areValuesIdentical(newObj, obj) is true 181 PASS JSON.stringify(newObj) is JSON.stringify(obj) 182 PASS areValuesIdentical(newObj, obj) is true 114 183 Serialize {"inner":{"hello":"there"},"outer":{"hello":"there"}}: 115 184 PASS bufferView.length is expectedBufferValues.length … … 117 186 Deserialize to {"hello":"there"}: 118 187 PASS JSON.stringify(newObj) is JSON.stringify(obj) 188 PASS areValuesIdentical(newObj, obj) is true 189 PASS JSON.stringify(newObj) is JSON.stringify(obj) 190 PASS areValuesIdentical(newObj, obj) is true 119 191 Serialize {"hello":"there"}: 120 192 PASS bufferView.length is expectedBufferValues.length … … 122 194 Deserialize to {"a":"a","u":"αβ","d":42}: 123 195 PASS JSON.stringify(newObj) is JSON.stringify(obj) 196 PASS areValuesIdentical(newObj, obj) is true 197 PASS JSON.stringify(newObj) is JSON.stringify(obj) 198 PASS areValuesIdentical(newObj, obj) is true 124 199 Serialize {"a":"a","u":"αβ","d":42}: 125 200 PASS bufferView.length is expectedBufferValues.length … … 127 202 Deserialize to {"a":"ab","u":"αβ","d":42}: 128 203 PASS JSON.stringify(newObj) is JSON.stringify(obj) 204 PASS areValuesIdentical(newObj, obj) is true 205 PASS JSON.stringify(newObj) is JSON.stringify(obj) 206 PASS areValuesIdentical(newObj, obj) is true 129 207 Serialize {"a":"ab","u":"αβ","d":42}: 208 PASS bufferView.length is expectedBufferValues.length 209 210 Deserialize to []: 211 PASS JSON.stringify(newObj) is JSON.stringify(obj) 212 PASS areValuesIdentical(newObj, obj) is true 213 Serialize []: 214 PASS bufferView.length is expectedBufferValues.length 215 216 Deserialize to ["foo","bar"]: 217 PASS JSON.stringify(newObj) is JSON.stringify(obj) 218 PASS areValuesIdentical(newObj, obj) is true 219 Serialize ["foo","bar"]: 130 220 PASS bufferView.length is expectedBufferValues.length 131 221 -
trunk/LayoutTests/fast/storage/serialized-script-value.html
r137346 r138964 18 18 testSerialization({foo: 'zoo', bar: {baz: 'myNewKey'}}, 19 19 [ 20 0x0 3, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,20 0x04, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 21 21 0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x10, 22 22 0x03, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x6f, 0x00, … … 28 28 0x65, 0x00, 0x79, 0x00, 0xff, 0xff, 0xff, 0xff, 29 29 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 30 42 ]); 31 43 32 44 testSerialization({foo: 'zoo', bar: 'myNewKey'}, 33 45 [ 34 0x0 3, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00,46 0x04, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 35 47 0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x10, 36 48 0x03, 0x00, 0x00, 0x00, 0x7a, 0x00, 0x6f, 0x00, … … 40 52 0x00, 0x77, 0x00, 0x4b, 0x00, 0x65, 0x00, 0x79, 41 53 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 42 64 ]); 43 65 44 66 testSerialization([], 45 67 [ 68 0x04, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 69 0x00, 0xff, 0xff, 0xff, 0xff 70 ], 71 [ 46 72 0x03, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 47 73 0x00, 0xff, 0xff, 0xff, 0xff … … 49 75 testSerialization({foo: "zoo"}, 50 76 [ 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 [ 51 83 0x03, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, 52 84 0x00, 0x66, 0x00, 0x6f, 0x00, 0x6f, 0x00, 0x10, … … 55 87 ]); 56 88 testSerialization({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 ], 57 94 [ 58 95 0x03, 0x00, 0x00, 0x00, 0x02, 0x03, 0x00, 0x00, … … 63 100 testSerialization({}, 64 101 [ 102 0x04, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff, 0xff, 103 0xff 104 ], 105 [ 65 106 0x03, 0x00, 0x00, 0x00, 0x02, 0xff, 0xff, 0xff, 66 107 0xff … … 69 110 testSerialization(undefined, 70 111 [ 112 0x04, 0x00, 0x00, 0x00, 0x03 113 ], 114 [ 71 115 0x03, 0x00, 0x00, 0x00, 0x03 72 116 ]); 73 117 testSerialization(true, 74 118 [ 119 0x04, 0x00, 0x00, 0x00, 0x09 120 ], 121 [ 75 122 0x03, 0x00, 0x00, 0x00, 0x09 76 123 ]); 77 124 testSerialization(false, 78 125 [ 126 0x04, 0x00, 0x00, 0x00, 0x08 127 ], 128 [ 79 129 0x03, 0x00, 0x00, 0x00, 0x08 80 130 ]); 81 131 testSerialization(new Array(100), 82 132 [ 133 0x04, 0x00, 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 134 0x00, 0xff, 0xff, 0xff, 0xff 135 ], 136 [ 83 137 0x03, 0x00, 0x00, 0x00, 0x01, 0x64, 0x00, 0x00, 84 138 0x00, 0xff, 0xff, 0xff, 0xff 85 139 ]); 86 140 testSerialization(10, 141 [ 142 0x04, 0x00, 0x00, 0x00, 0x05, 0x0a, 0x00, 0x00, 143 0x00 144 ], 87 145 [ 88 146 0x03, 0x00, 0x00, 0x00, 0x05, 0x0a, 0x00, 0x00, … … 91 149 testSerialization(-10, 92 150 [ 151 0x04, 0x00, 0x00, 0x00, 0x05, 0xf6, 0xff, 0xff, 152 0xff 153 ], 154 [ 93 155 0x03, 0x00, 0x00, 0x00, 0x05, 0xf6, 0xff, 0xff, 94 156 0xff 95 157 ]); 96 158 testSerialization(Math.pow(2,30), 159 [ 160 0x04, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, 161 0x40 162 ], 97 163 [ 98 164 0x03, 0x00, 0x00, 0x00, 0x05, 0x00, 0x00, 0x00, … … 101 167 testSerialization(Math.pow(2,55), 102 168 [ 169 0x04, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 170 0x00, 0x00, 0x00, 0x60, 0x43, 171 ], 172 [ 103 173 0x03, 0x00, 0x00, 0x00, 0x0a, 0x00, 0x00, 0x00, 104 174 0x00, 0x00, 0x00, 0x60, 0x43, … … 106 176 testSerialization(1.23, 107 177 [ 178 0x04, 0x00, 0x00, 0x00, 0x0a, 0xae, 0x47, 0xe1, 179 0x7a, 0x14, 0xae, 0xf3, 0x3f 180 ], 181 [ 108 182 0x03, 0x00, 0x00, 0x00, 0x0a, 0xae, 0x47, 0xe1, 109 183 0x7a, 0x14, 0xae, 0xf3, 0x3f … … 111 185 testSerialization("", 112 186 [ 187 0x04, 0x00, 0x00, 0x00, 0x11 188 ], 189 [ 113 190 0x03, 0x00, 0x00, 0x00, 0x11 114 191 ]); 115 192 testSerialization("abc", 193 [ 194 0x04, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, 195 0x00, 0x61, 0x00, 0x62, 0x00, 0x63, 0x00 196 ], 116 197 [ 117 198 0x03, 0x00, 0x00, 0x00, 0x10, 0x03, 0x00, 0x00, … … 119 200 ]); 120 201 testSerialization({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 ], 121 208 [ 122 209 0x03, 0x00, 0x00, 0x00, 0x02, 0x07, 0x00, 0x00, … … 127 214 testSerialization({string: "str"}, 128 215 [ 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 [ 129 223 0x03, 0x00, 0x00, 0x00, 0x02, 0x06, 0x00, 0x00, 130 224 0x00, 0x73, 0x00, 0x74, 0x00, 0x72, 0x00, 0x69, … … 134 228 ]); 135 229 testSerialization({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 ], 136 239 [ 137 240 0x03, 0x00, 0x00, 0x00, 0x02, 0x04, 0x00, 0x00, … … 145 248 testSerialization(null, 146 249 [ 250 0x04, 0x00, 0x00, 0x00, 0x04 251 ], 252 [ 147 253 0x03, 0x00, 0x00, 0x00, 0x04 148 254 ]); 149 255 testSerialization(/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 ], 150 261 [ 151 262 0x03, 0x00, 0x00, 0x00, 0x12, 0x03, 0x00, 0x00, … … 158 269 outerObject['outer'] = innerObject; 159 270 testSerialization(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 ], 160 283 [ 161 284 0x03, 0x00, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, … … 172 295 testSerialization(innerObject, 173 296 [ 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 [ 174 304 0x03, 0x00, 0x00, 0x00, 0x02, 0x05, 0x00, 0x00, 175 305 0x00, 0x68, 0x00, 0x65, 0x00, 0x6c, 0x00, 0x6c, … … 181 311 var unicodeObject = {a: 'a', u: String.fromCharCode(0x03B1,0x03B2), d: 42}; 182 312 testSerialization(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 ], 183 321 [ 184 322 0x03, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, … … 191 329 unicodeObject.a = 'ab'; 192 330 testSerialization(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 ], 193 340 [ 194 341 0x03, 0x00, 0x00, 0x00, 0x02, 0x01, 0x00, 0x00, … … 201 348 ]); 202 349 350 var arrayObject = []; 351 arrayObject['a'] = true; 352 arrayObject['b'] = false; 353 arrayObject['foo'] = 123; 354 arrayObject['bar'] = 456; 355 arrayObject[''] = null; 356 testSerialization(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 369 arrayObject[0] = 'foo'; 370 arrayObject[1] = 'bar'; 371 testSerialization(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 203 386 testSerialization(function(){}, [], null, DOMException.DATA_CLONE_ERR); 204 387 </script> -
trunk/LayoutTests/platform/chromium/fast/storage/serialized-script-value-expected.txt
r136624 r138964 2 2 Deserialize to {"foo":"zoo","bar":{"baz":"myNewKey"}}: 3 3 PASS JSON.stringify(newObj) is JSON.stringify(obj) 4 PASS areValuesIdentical(newObj, obj) is true 4 5 Serialize {"foo":"zoo","bar":{"baz":"myNewKey"}}: 5 6 PASS bufferView.length is expectedBufferValues.length … … 7 8 Deserialize to {"foo":"zoo","bar":"myNewKey"}: 8 9 PASS JSON.stringify(newObj) is JSON.stringify(obj) 10 PASS areValuesIdentical(newObj, obj) is true 9 11 Serialize {"foo":"zoo","bar":"myNewKey"}: 10 12 PASS bufferView.length is expectedBufferValues.length … … 12 14 Deserialize to []: 13 15 PASS JSON.stringify(newObj) is JSON.stringify(obj) 16 PASS areValuesIdentical(newObj, obj) is true 14 17 Serialize []: 15 18 PASS bufferView.length is expectedBufferValues.length … … 17 20 Deserialize to {"foo":"zoo"}: 18 21 PASS JSON.stringify(newObj) is JSON.stringify(obj) 22 PASS areValuesIdentical(newObj, obj) is true 19 23 PASS JSON.stringify(newObj) is JSON.stringify(obj) 24 PASS areValuesIdentical(newObj, obj) is true 20 25 Serialize {"foo":"zoo"}: 21 26 PASS bufferView.length is expectedBufferValues.length … … 23 28 Deserialize to {"foo":null}: 24 29 PASS JSON.stringify(newObj) is JSON.stringify(obj) 30 PASS areValuesIdentical(newObj, obj) is true 25 31 PASS JSON.stringify(newObj) is JSON.stringify(obj) 32 PASS areValuesIdentical(newObj, obj) is true 26 33 Serialize {"foo":null}: 27 34 PASS bufferView.length is expectedBufferValues.length … … 29 36 Deserialize to {}: 30 37 PASS JSON.stringify(newObj) is JSON.stringify(obj) 38 PASS areValuesIdentical(newObj, obj) is true 31 39 PASS JSON.stringify(newObj) is JSON.stringify(obj) 40 PASS areValuesIdentical(newObj, obj) is true 32 41 Serialize {}: 33 42 PASS bufferView.length is expectedBufferValues.length … … 35 44 Deserialize to undefined: 36 45 PASS JSON.stringify(newObj) is JSON.stringify(obj) 46 PASS areValuesIdentical(newObj, obj) is true 37 47 Serialize undefined: 38 48 PASS bufferView.length is expectedBufferValues.length … … 40 50 Deserialize to true: 41 51 PASS JSON.stringify(newObj) is JSON.stringify(obj) 52 PASS areValuesIdentical(newObj, obj) is true 42 53 Serialize true: 43 54 PASS bufferView.length is expectedBufferValues.length … … 45 56 Deserialize to false: 46 57 PASS JSON.stringify(newObj) is JSON.stringify(obj) 58 PASS areValuesIdentical(newObj, obj) is true 47 59 Serialize false: 48 60 PASS bufferView.length is expectedBufferValues.length … … 50 62 Deserialize to 10: 51 63 PASS JSON.stringify(newObj) is JSON.stringify(obj) 64 PASS areValuesIdentical(newObj, obj) is true 52 65 Serialize 10: 53 66 PASS bufferView.length is expectedBufferValues.length … … 55 68 Deserialize to -10: 56 69 PASS JSON.stringify(newObj) is JSON.stringify(obj) 70 PASS areValuesIdentical(newObj, obj) is true 57 71 Serialize -10: 58 72 PASS bufferView.length is expectedBufferValues.length … … 60 74 Deserialize to 1073741824: 61 75 PASS JSON.stringify(newObj) is JSON.stringify(obj) 76 PASS areValuesIdentical(newObj, obj) is true 62 77 Serialize 1073741824: 63 78 PASS bufferView.length is expectedBufferValues.length … … 65 80 Deserialize to 36028797018963970: 66 81 PASS JSON.stringify(newObj) is JSON.stringify(obj) 82 PASS areValuesIdentical(newObj, obj) is true 67 83 Serialize 36028797018963970: 68 84 PASS bufferView.length is expectedBufferValues.length … … 70 86 Deserialize to 1.23: 71 87 PASS JSON.stringify(newObj) is JSON.stringify(obj) 88 PASS areValuesIdentical(newObj, obj) is true 72 89 Serialize 1.23: 73 90 PASS bufferView.length is expectedBufferValues.length … … 75 92 Deserialize to "": 76 93 PASS JSON.stringify(newObj) is JSON.stringify(obj) 94 PASS areValuesIdentical(newObj, obj) is true 77 95 Serialize "": 78 96 PASS bufferView.length is expectedBufferValues.length … … 80 98 Deserialize to "abc": 81 99 PASS JSON.stringify(newObj) is JSON.stringify(obj) 100 PASS areValuesIdentical(newObj, obj) is true 82 101 Serialize "abc": 83 102 PASS bufferView.length is expectedBufferValues.length … … 85 104 Deserialize to {"integer":123}: 86 105 PASS JSON.stringify(newObj) is JSON.stringify(obj) 106 PASS areValuesIdentical(newObj, obj) is true 87 107 Serialize {"integer":123}: 88 108 PASS bufferView.length is expectedBufferValues.length … … 90 110 Deserialize to {"string":"str"}: 91 111 PASS JSON.stringify(newObj) is JSON.stringify(obj) 112 PASS areValuesIdentical(newObj, obj) is true 92 113 Serialize {"string":"str"}: 93 114 PASS bufferView.length is expectedBufferValues.length … … 95 116 Deserialize to {"list":[1,2,3]}: 96 117 PASS JSON.stringify(newObj) is JSON.stringify(obj) 118 PASS areValuesIdentical(newObj, obj) is true 97 119 Serialize {"list":[1,2,3]}: 98 120 PASS bufferView.length is expectedBufferValues.length … … 100 122 Deserialize to null: 101 123 PASS JSON.stringify(newObj) is JSON.stringify(obj) 124 PASS areValuesIdentical(newObj, obj) is true 102 125 Serialize null: 103 126 PASS bufferView.length is expectedBufferValues.length … … 105 128 Deserialize to {}: 106 129 PASS JSON.stringify(newObj) is JSON.stringify(obj) 130 PASS areValuesIdentical(newObj, obj) is true 107 131 Serialize {}: 108 132 PASS bufferView.length is expectedBufferValues.length … … 110 134 Deserialize to {"inner":{"hello":"there"},"outer":{"hello":"there"}}: 111 135 PASS JSON.stringify(newObj) is JSON.stringify(obj) 136 PASS areValuesIdentical(newObj, obj) is true 112 137 Serialize {"inner":{"hello":"there"},"outer":{"hello":"there"}}: 113 138 PASS bufferView.length is expectedBufferValues.length … … 115 140 Deserialize to {"hello":"there"}: 116 141 PASS JSON.stringify(newObj) is JSON.stringify(obj) 142 PASS areValuesIdentical(newObj, obj) is true 117 143 Serialize {"hello":"there"}: 118 144 PASS bufferView.length is expectedBufferValues.length … … 120 146 Deserialize to {"a":"a","u":"αβ","d":42}: 121 147 PASS JSON.stringify(newObj) is JSON.stringify(obj) 148 PASS areValuesIdentical(newObj, obj) is true 122 149 PASS JSON.stringify(newObj) is JSON.stringify(obj) 150 PASS areValuesIdentical(newObj, obj) is true 123 151 Serialize {"a":"a","u":"αβ","d":42}: 124 152 PASS bufferView.length is expectedBufferValues.length … … 126 154 Deserialize to {"a":"ab","u":"αβ","d":42}: 127 155 PASS JSON.stringify(newObj) is JSON.stringify(obj) 156 PASS areValuesIdentical(newObj, obj) is true 128 157 PASS JSON.stringify(newObj) is JSON.stringify(obj) 158 PASS areValuesIdentical(newObj, obj) is true 129 159 Serialize {"a":"ab","u":"αβ","d":42}: 160 PASS bufferView.length is expectedBufferValues.length 161 162 Deserialize to []: 163 PASS JSON.stringify(newObj) is JSON.stringify(obj) 164 PASS areValuesIdentical(newObj, obj) is true 165 PASS JSON.stringify(newObj) is JSON.stringify(obj) 166 PASS areValuesIdentical(newObj, obj) is true 167 Serialize []: 168 PASS bufferView.length is expectedBufferValues.length 169 170 Deserialize to ["foo","bar"]: 171 PASS JSON.stringify(newObj) is JSON.stringify(obj) 172 PASS areValuesIdentical(newObj, obj) is true 173 PASS JSON.stringify(newObj) is JSON.stringify(obj) 174 PASS areValuesIdentical(newObj, obj) is true 175 Serialize ["foo","bar"]: 130 176 PASS bufferView.length is expectedBufferValues.length 131 177 -
trunk/LayoutTests/platform/chromium/fast/storage/serialized-script-value.html
r137346 r138964 106 106 0x5301, 0x6401, 0x013f, 0x5449, 0x037b]); 107 107 108 var arrayObject = []; 109 arrayObject['a'] = true; 110 arrayObject['b'] = false; 111 arrayObject['foo'] = 123; 112 arrayObject['bar'] = 456; 113 arrayObject[''] = null; 114 testSerialization(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 128 arrayObject[0] = 'foo'; 129 arrayObject[1] = 'bar'; 130 testSerialization(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 108 146 testSerialization(function(){}, [], null, DOMException.DATA_CLONE_ERR); 109 147 </script> -
trunk/Source/WebCore/ChangeLog
r138963 r138964 1 2013-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 1 20 2013-01-07 Alec Flett <alecflett@chromium.org> 2 21 -
trunk/Source/WebCore/bindings/js/SerializedScriptValue.cpp
r137954 r138964 161 161 * Version 3. added the FalseObjectTag, TrueObjectTag, NumberObjectTag, StringObjectTag 162 162 * and EmptyStringObjectTag for serialization of Boolean, Number and String objects. 163 * Version 4. added support for serializing non-index properties of arrays. 163 164 */ 164 static const unsigned int CurrentVersion = 3; 165 static const unsigned int TerminatorTag = 0xFFFFFFFF; 166 static const unsigned int StringPoolTag = 0xFFFFFFFE; 165 static const unsigned CurrentVersion = 4; 166 static const unsigned TerminatorTag = 0xFFFFFFFF; 167 static const unsigned StringPoolTag = 0xFFFFFFFE; 168 static const unsigned NonIndexPropertiesTag = 0xFFFFFFFD; 167 169 168 170 /* … … 839 841 Vector<uint32_t, 16> lengthStack; 840 842 Vector<PropertyNameArray, 16> propertyStack; 841 Vector<JSObject*, 16> inputObjectStack; 842 Vector<JSArray*, 16> inputArrayStack; 843 Vector<JSObject*, 32> inputObjectStack; 843 844 Vector<WalkerState, 16> stateStack; 844 845 WalkerState state = StateUnknown; … … 850 851 case ArrayStartState: { 851 852 ASSERT(isArray(inValue)); 852 if (inputObjectStack.size() + inputArrayStack.size()> maximumFilterRecursion)853 if (inputObjectStack.size() > maximumFilterRecursion) 853 854 return StackOverflowError; 854 855 … … 857 858 if (!startArray(inArray)) 858 859 break; 859 input ArrayStack.append(inArray);860 inputObjectStack.append(inArray); 860 861 indexStack.append(0); 861 862 lengthStack.append(length); … … 870 871 } 871 872 872 JS Array* array = inputArrayStack.last();873 JSObject* array = inputObjectStack.last(); 873 874 uint32_t index = indexStack.last(); 874 875 if (index == lengthStack.last()) { 875 endObject();876 inputArrayStack.removeLast();877 876 indexStack.removeLast(); 878 877 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(); 879 890 break; 880 891 } … … 903 914 case ObjectStartState: { 904 915 ASSERT(inValue.isObject()); 905 if (inputObjectStack.size() + inputArrayStack.size()> maximumFilterRecursion)916 if (inputObjectStack.size() > maximumFilterRecursion) 906 917 return StackOverflowError; 907 918 JSObject* inObject = asObject(inValue); … … 1280 1291 } 1281 1292 1282 void putProperty(JS Array* 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); 1285 1296 } 1286 1297 … … 1601 1612 Vector<uint32_t, 16> indexStack; 1602 1613 Vector<Identifier, 16> propertyNameStack; 1603 Vector<JSObject*, 16> outputObjectStack; 1604 Vector<JSArray*, 16> outputArrayStack; 1614 Vector<JSObject*, 32> outputObjectStack; 1605 1615 Vector<WalkerState, 16> stateStack; 1606 1616 WalkerState state = StateUnknown; … … 1619 1629 JSArray* outArray = constructEmptyArray(m_exec, 0, m_globalObject, length); 1620 1630 m_gcBuffer.append(outArray); 1621 output ArrayStack.append(outArray);1631 outputObjectStack.append(outArray); 1622 1632 // fallthrough 1623 1633 } … … 1636 1646 } 1637 1647 if (index == TerminatorTag) { 1638 JS Array* outArray = outputArrayStack.last();1648 JSObject* outArray = outputObjectStack.last(); 1639 1649 outValue = outArray; 1640 output ArrayStack.removeLast();1650 outputObjectStack.removeLast(); 1641 1651 break; 1652 } else if (index == NonIndexPropertiesTag) { 1653 goto objectStartVisitMember; 1642 1654 } 1643 1655 1644 1656 if (JSValue terminal = readTerminal()) { 1645 putProperty(output ArrayStack.last(), index, terminal);1657 putProperty(outputObjectStack.last(), index, terminal); 1646 1658 goto arrayStartVisitMember; 1647 1659 } … … 1653 1665 } 1654 1666 case ArrayEndVisitMember: { 1655 JS Array* outArray = outputArrayStack.last();1667 JSObject* outArray = outputObjectStack.last(); 1656 1668 putProperty(outArray, indexStack.last(), outValue); 1657 1669 indexStack.removeLast(); … … 1660 1672 objectStartState: 1661 1673 case ObjectStartState: { 1662 if (outputObjectStack.size() + outputArrayStack.size()> maximumFilterRecursion)1674 if (outputObjectStack.size() > maximumFilterRecursion) 1663 1675 return make_pair(JSValue(), StackOverflowError); 1664 1676 JSObject* outObject = constructEmptyObject(m_exec, m_globalObject);
Note: See TracChangeset
for help on using the changeset viewer.