Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(238)

Side by Side Diff: LayoutTests/platform/chromium-win/fast/js/JSON-stringify-expected.txt

Issue 14891003: The first in a series of mass rebaselines. I tried to avoid (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 function (jsonObject) { 1 function (jsonObject){
2 return jsonObject.stringify(1); 2 return jsonObject.stringify(1);
3 } 3 }
4 PASS tests[i](nativeJSON) is tests[i](JSON) 4 PASS tests[i](nativeJSON) is tests[i](JSON)
5 function (jsonObject) { 5 function (jsonObject){
6 return jsonObject.stringify(1.5); 6 return jsonObject.stringify(1.5);
7 } 7 }
8 PASS tests[i](nativeJSON) is tests[i](JSON) 8 PASS tests[i](nativeJSON) is tests[i](JSON)
9 function (jsonObject) { 9 function (jsonObject){
10 return jsonObject.stringify(-1); 10 return jsonObject.stringify(-1);
11 } 11 }
12 PASS tests[i](nativeJSON) is tests[i](JSON) 12 PASS tests[i](nativeJSON) is tests[i](JSON)
13 function (jsonObject) { 13 function (jsonObject){
14 return jsonObject.stringify(-1.5); 14 return jsonObject.stringify(-1.5);
15 } 15 }
16 PASS tests[i](nativeJSON) is tests[i](JSON) 16 PASS tests[i](nativeJSON) is tests[i](JSON)
17 function (jsonObject) { 17 function (jsonObject){
18 return jsonObject.stringify(null); 18 return jsonObject.stringify(null);
19 } 19 }
20 PASS tests[i](nativeJSON) is tests[i](JSON) 20 PASS tests[i](nativeJSON) is tests[i](JSON)
21 function (jsonObject) { 21 function (jsonObject){
22 return jsonObject.stringify("string"); 22 return jsonObject.stringify("string");
23 } 23 }
24 PASS tests[i](nativeJSON) is tests[i](JSON) 24 PASS tests[i](nativeJSON) is tests[i](JSON)
25 function (jsonObject) { 25 function (jsonObject){
26 return jsonObject.stringify(new Number(0)); 26 return jsonObject.stringify(new Number(0));
27 } 27 }
28 PASS tests[i](nativeJSON) is tests[i](JSON) 28 PASS tests[i](nativeJSON) is tests[i](JSON)
29 function (jsonObject) { 29 function (jsonObject){
30 return jsonObject.stringify(new Number(1)); 30 return jsonObject.stringify(new Number(1));
31 } 31 }
32 PASS tests[i](nativeJSON) is tests[i](JSON) 32 PASS tests[i](nativeJSON) is tests[i](JSON)
33 function (jsonObject) { 33 function (jsonObject){
34 return jsonObject.stringify(new Number(1.5)); 34 return jsonObject.stringify(new Number(1.5));
35 } 35 }
36 PASS tests[i](nativeJSON) is tests[i](JSON) 36 PASS tests[i](nativeJSON) is tests[i](JSON)
37 function (jsonObject) { 37 function (jsonObject){
38 return jsonObject.stringify(new Number(-1)); 38 return jsonObject.stringify(new Number(-1));
39 } 39 }
40 PASS tests[i](nativeJSON) is tests[i](JSON) 40 PASS tests[i](nativeJSON) is tests[i](JSON)
41 function (jsonObject) { 41 function (jsonObject){
42 return jsonObject.stringify(new Number(-1.5)); 42 return jsonObject.stringify(new Number(-1.5));
43 } 43 }
44 PASS tests[i](nativeJSON) is tests[i](JSON) 44 PASS tests[i](nativeJSON) is tests[i](JSON)
45 function (jsonObject) { 45 function (jsonObject){
46 return jsonObject.stringify(new String("a string object")); 46 return jsonObject.stringify(new String("a string object"));
47 } 47 }
48 PASS tests[i](nativeJSON) is tests[i](JSON) 48 PASS tests[i](nativeJSON) is tests[i](JSON)
49 function (jsonObject) { 49 function (jsonObject){
50 return jsonObject.stringify(new Boolean(true)); 50 return jsonObject.stringify(new Boolean(true));
51 } 51 }
52 PASS tests[i](nativeJSON) is tests[i](JSON) 52 PASS tests[i](nativeJSON) is tests[i](JSON)
53 function (jsonObject) { 53 function (jsonObject){
54 var value = new Number(1); 54 var value = new Number(1);
55 value.valueOf = function() { return 2; } 55 value.valueOf = function() { return 2; }
56 return jsonObject.stringify(value); 56 return jsonObject.stringify(value);
57 } 57 }
58 PASS tests[i](nativeJSON) is tests[i].expected 58 PASS tests[i](nativeJSON) is tests[i].expected
59 function (jsonObject) { 59 function (jsonObject){
60 var value = new Boolean(true); 60 var value = new Boolean(true);
61 value.valueOf = function() { return 2; } 61 value.valueOf = function() { return 2; }
62 return jsonObject.stringify(value); 62 return jsonObject.stringify(value);
63 } 63 }
64 PASS tests[i](nativeJSON) is tests[i].expected 64 FAIL tests[i](nativeJSON) should be 2. Was true.
65 function (jsonObject) { 65 function (jsonObject){
66 var value = new String("fail"); 66 var value = new String("fail");
67 value.toString = function() { return "converted string"; } 67 value.toString = function() { return "converted string"; }
68 return jsonObject.stringify(value); 68 return jsonObject.stringify(value);
69 } 69 }
70 PASS tests[i](nativeJSON) is tests[i].expected 70 PASS tests[i](nativeJSON) is tests[i].expected
71 function (jsonObject) { 71 function (jsonObject){
72 return jsonObject.stringify(true); 72 return jsonObject.stringify(true);
73 } 73 }
74 PASS tests[i](nativeJSON) is tests[i](JSON) 74 PASS tests[i](nativeJSON) is tests[i](JSON)
75 function (jsonObject) { 75 function (jsonObject){
76 return jsonObject.stringify(false); 76 return jsonObject.stringify(false);
77 } 77 }
78 PASS tests[i](nativeJSON) is tests[i](JSON) 78 PASS tests[i](nativeJSON) is tests[i](JSON)
79 function (jsonObject) { 79 function (jsonObject){
80 return jsonObject.stringify(new Date(0)); 80 return jsonObject.stringify(new Date(0));
81 } 81 }
82 PASS tests[i](nativeJSON) is tests[i](JSON) 82 PASS tests[i](nativeJSON) is tests[i](JSON)
83 function (jsonObject) { 83 function (jsonObject){
84 return jsonObject.stringify({toJSON: Date.prototype.toJSON}); 84 return jsonObject.stringify({toJSON: Date.prototype.toJSON});
85 } 85 }
86 PASS tests[i](nativeJSON) threw exception TypeError: toISOString is not a functi on. 86 PASS tests[i](nativeJSON) threw exception TypeError: Object #<Object> has no met hod 'toISOString'.
87 function (jsonObject) { 87 function (jsonObject){
88 return jsonObject.stringify({toJSON: Date.prototype.toJSON, toISOString: function(){ return "custom toISOString"; }}); 88 return jsonObject.stringify({toJSON: Date.prototype.toJSON, toISOString: function(){ return "custom toISOString"; }});
89 } 89 }
90 PASS tests[i](nativeJSON) is tests[i](JSON) 90 PASS tests[i](nativeJSON) is tests[i](JSON)
91 function (jsonObject) { 91 function (jsonObject){
92 return jsonObject.stringify({toJSON: Date.prototype.toJSON, toISOString: function(){ return {}; }}); 92 return jsonObject.stringify({toJSON: Date.prototype.toJSON, toISOString: function(){ return {}; }});
93 } 93 }
94 PASS tests[i](nativeJSON) threw exception TypeError: toISOString did not return a primitive value. 94 FAIL tests[i](nativeJSON) should throw an exception. Was {}.
95 function (jsonObject) { 95 function (jsonObject){
96 return jsonObject.stringify({toJSON: Date.prototype.toJSON, toISOString: function(){ throw "An exception"; }}); 96 return jsonObject.stringify({toJSON: Date.prototype.toJSON, toISOString: function(){ throw "An exception"; }});
97 } 97 }
98 PASS tests[i](nativeJSON) threw exception An exception. 98 PASS tests[i](nativeJSON) threw exception An exception.
99 function (jsonObject) { 99 function (jsonObject){
100 var d = new Date(0); 100 var d = new Date(0);
101 d.toISOString = null; 101 d.toISOString = null;
102 return jsonObject.stringify(d); 102 return jsonObject.stringify(d);
103 } 103 }
104 PASS tests[i](nativeJSON) threw exception TypeError: toISOString is not a functi on. 104 PASS tests[i](nativeJSON) threw exception TypeError: Property 'toISOString' of o bject [object Date] is not a function.
105 function (jsonObject) { 105 function (jsonObject){
106 var d = new Date(0); 106 var d = new Date(0);
107 d.toJSON = undefined; 107 d.toJSON = undefined;
108 return jsonObject.stringify(d); 108 return jsonObject.stringify(d);
109 } 109 }
110 PASS tests[i](nativeJSON) is tests[i](JSON) 110 PASS tests[i](nativeJSON) is tests[i](JSON)
111 function (jsonObject) { 111 function (jsonObject){
112 return jsonObject.stringify({get Foo() { return "bar"; }}); 112 return jsonObject.stringify({get Foo() { return "bar"; }});
113 } 113 }
114 PASS tests[i](nativeJSON) is tests[i](JSON) 114 PASS tests[i](nativeJSON) is tests[i](JSON)
115 function (jsonObject) { 115 function (jsonObject){
116 return jsonObject.stringify({get Foo() { this.foo="wibble"; return "bar" ; }}); 116 return jsonObject.stringify({get Foo() { this.foo="wibble"; return "bar" ; }});
117 } 117 }
118 PASS tests[i](nativeJSON) is tests[i](JSON) 118 PASS tests[i](nativeJSON) is tests[i](JSON)
119 function (jsonObject) { 119 function (jsonObject){
120 var count = 0; 120 var count = 0;
121 jsonObject.stringify({get Foo() { count++; return "bar"; }}); 121 jsonObject.stringify({get Foo() { count++; return "bar"; }});
122 return count; 122 return count;
123 } 123 }
124 PASS tests[i](nativeJSON) is tests[i](JSON) 124 PASS tests[i](nativeJSON) is tests[i](JSON)
125 function (jsonObject) { 125 function (jsonObject){
126 var count = 0; 126 var count = 0;
127 return jsonObject.stringify({get Foo() { count++; delete this.bar; retur n "bar"; }, bar: "wibble"}); 127 return jsonObject.stringify({get Foo() { count++; delete this.bar; retur n "bar"; }, bar: "wibble"});
128 } 128 }
129 PASS tests[i](nativeJSON) is tests[i](JSON) 129 PASS tests[i](nativeJSON) is tests[i](JSON)
130 function (jsonObject) { 130 function (jsonObject){
131 var count = 0; 131 var count = 0;
132 return jsonObject.stringify({a:"1", b:"2", c:"3", 5:4, 4:5, 2:6, 1:7}); 132 return jsonObject.stringify({a:"1", b:"2", c:"3", 5:4, 4:5, 2:6, 1:7});
133 } 133 }
134 PASS tests[i](nativeJSON) is tests[i](JSON) 134 PASS tests[i](nativeJSON) is tests[i](JSON)
135 function (jsonObject) { 135 function (jsonObject){
136 var allString = true; 136 var allString = true;
137 jsonObject.stringify({a:"1", b:"2", c:"3", 5:4, 4:5, 2:6, 1:7}, function (k,v){allString = allString && (typeof k == "string"); return v}); 137 jsonObject.stringify({a:"1", b:"2", c:"3", 5:4, 4:5, 2:6, 1:7}, function (k,v){allString = allString && (typeof k == "string"); return v});
138 return allString; 138 return allString;
139 } 139 }
140 PASS tests[i](nativeJSON) is tests[i](JSON) 140 PASS tests[i](nativeJSON) is tests[i](JSON)
141 function (jsonObject) { 141 function (jsonObject){
142 var allString = true; 142 var allString = true;
143 jsonObject.stringify([1,2,3,4,5], function(k,v){allString = allString && (typeof k == "string"); return v}); 143 jsonObject.stringify([1,2,3,4,5], function(k,v){allString = allString && (typeof k == "string"); return v});
144 return allString; 144 return allString;
145 } 145 }
146 PASS tests[i](nativeJSON) is tests[i](JSON) 146 FAIL tests[i](nativeJSON) should be false. Was true.
147 function (jsonObject) { 147 function (jsonObject){
148 var allString = true; 148 var allString = true;
149 var array = []; 149 var array = [];
150 return jsonObject.stringify({a:"1", b:"2", c:"3", 5:4, 4:5, 2:6, 1:7}, a rray); 150 return jsonObject.stringify({a:"1", b:"2", c:"3", 5:4, 4:5, 2:6, 1:7}, a rray);
151 } 151 }
152 PASS tests[i](nativeJSON) is tests[i](JSON) 152 PASS tests[i](nativeJSON) is tests[i](JSON)
153 function (jsonObject) { 153 function (jsonObject){
154 var allString = true; 154 var allString = true;
155 var array = ["a"]; 155 var array = ["a"];
156 return jsonObject.stringify({get a(){return 1;array[1]="b";array[2]="c"} , b:"2", c:"3"}, array); 156 return jsonObject.stringify({get a(){return 1;array[1]="b";array[2]="c"} , b:"2", c:"3"}, array);
157 } 157 }
158 PASS tests[i](nativeJSON) is tests[i](JSON) 158 PASS tests[i](nativeJSON) is tests[i](JSON)
159 function (jsonObject) { 159 function (jsonObject){
160 var allString = true; 160 var allString = true;
161 var array = [{toString:function(){array[0]='a'; array[1]='c'; array[2]=' b'; return 'a'}}]; 161 var array = [{toString:function(){array[0]='a'; array[1]='c'; array[2]=' b'; return 'a'}}];
162 return jsonObject.stringify(simpleObject, array); 162 return jsonObject.stringify(simpleObject, array);
163 } 163 }
164 PASS tests[i](nativeJSON) is tests[i](JSON) 164 FAIL tests[i](nativeJSON) should be {}. Threw exception illegal access
165 function (jsonObject) { 165 function (jsonObject){
166 var allString = true; 166 var allString = true;
167 var array = [{toString:function(){array[0]='a'; array[1]='c'; array[2]=' b'; return 'a'}}]; 167 var array = [{toString:function(){array[0]='a'; array[1]='c'; array[2]=' b'; return 'a'}}];
168 return jsonObject.stringify(simpleObjectWithProto, array); 168 return jsonObject.stringify(simpleObjectWithProto, array);
169 } 169 }
170 PASS tests[i](nativeJSON) is tests[i](JSON) 170 FAIL tests[i](nativeJSON) should be {}. Threw exception illegal access
171 function (jsonObject) { 171 function (jsonObject){
172 var allString = true; 172 var allString = true;
173 var array = [1, new Number(2), NaN, Infinity, -Infinity, new String("str ")]; 173 var array = [1, new Number(2), NaN, Infinity, -Infinity, new String("str ")];
174 return jsonObject.stringify({"1":"1","2":"2","NaN":"NaN","Infinity":"Inf inity","-Infinity":"-Infinity","str":"str"}, array); 174 return jsonObject.stringify({"1":"1","2":"2","NaN":"NaN","Infinity":"Inf inity","-Infinity":"-Infinity","str":"str"}, array);
175 } 175 }
176 PASS tests[i](nativeJSON) is tests[i].expected 176 FAIL tests[i](nativeJSON) should be {"1":"1","2":"2","NaN":"NaN","Infinity":"Inf inity","-Infinity":"-Infinity","str":"str"}. Threw exception illegal access
177 function (jsonObject) { 177 function (jsonObject){
178 var allString = true; 178 var allString = true;
179 var array = ["1","2","3"]; 179 var array = ["1","2","3"];
180 return jsonObject.stringify({1:'a', 2:'b', 3:'c'}, array); 180 return jsonObject.stringify({1:'a', 2:'b', 3:'c'}, array);
181 } 181 }
182 PASS tests[i](nativeJSON) is tests[i](JSON) 182 PASS tests[i](nativeJSON) is tests[i](JSON)
183 function (jsonObject) { 183 function (jsonObject){
184 var allString = true; 184 var allString = true;
185 var array = ["1","2","3"]; 185 var array = ["1","2","3"];
186 return jsonObject.stringify(simpleArray, array); 186 return jsonObject.stringify(simpleArray, array);
187 } 187 }
188 PASS tests[i](nativeJSON) is tests[i](JSON) 188 PASS tests[i](nativeJSON) is tests[i](JSON)
189 function (jsonObject) { 189 function (jsonObject){
190 return jsonObject.stringify(simpleArray, null, " "); 190 return jsonObject.stringify(simpleArray, null, " ");
191 } 191 }
192 PASS tests[i](nativeJSON) is tests[i](JSON) 192 PASS tests[i](nativeJSON) is tests[i](JSON)
193 function (jsonObject) { 193 function (jsonObject){
194 return jsonObject.stringify(simpleArray, null, 4); 194 return jsonObject.stringify(simpleArray, null, 4);
195 } 195 }
196 PASS tests[i](nativeJSON) is tests[i](JSON) 196 PASS tests[i](nativeJSON) is tests[i](JSON)
197 function (jsonObject) { 197 function (jsonObject){
198 return jsonObject.stringify(simpleArray, null, "ab"); 198 return jsonObject.stringify(simpleArray, null, "ab");
199 } 199 }
200 PASS tests[i](nativeJSON) is tests[i](JSON) 200 PASS tests[i](nativeJSON) is tests[i](JSON)
201 function (jsonObject) { 201 function (jsonObject){
202 return jsonObject.stringify(simpleArray, null, 4); 202 return jsonObject.stringify(simpleArray, null, 4);
203 } 203 }
204 PASS tests[i](nativeJSON) is tests[i](JSON) 204 PASS tests[i](nativeJSON) is tests[i](JSON)
205 function (jsonObject) { 205 function (jsonObject){
206 return jsonObject.stringify(simpleObject, null, " "); 206 return jsonObject.stringify(simpleObject, null, " ");
207 } 207 }
208 PASS tests[i](nativeJSON) is tests[i](JSON) 208 PASS tests[i](nativeJSON) is tests[i](JSON)
209 function (jsonObject) { 209 function (jsonObject){
210 return jsonObject.stringify(simpleObject, null, 4); 210 return jsonObject.stringify(simpleObject, null, 4);
211 } 211 }
212 PASS tests[i](nativeJSON) is tests[i](JSON) 212 PASS tests[i](nativeJSON) is tests[i](JSON)
213 function (jsonObject) { 213 function (jsonObject){
214 return jsonObject.stringify(simpleObject, null, "ab"); 214 return jsonObject.stringify(simpleObject, null, "ab");
215 } 215 }
216 PASS tests[i](nativeJSON) is tests[i](JSON) 216 PASS tests[i](nativeJSON) is tests[i](JSON)
217 function (jsonObject) { 217 function (jsonObject){
218 return jsonObject.stringify(simpleObject, null, 4); 218 return jsonObject.stringify(simpleObject, null, 4);
219 } 219 }
220 PASS tests[i](nativeJSON) is tests[i](JSON) 220 PASS tests[i](nativeJSON) is tests[i](JSON)
221 function (jsonObject) { 221 function (jsonObject){
222 return jsonObject.stringify(simpleObject, null, 10); 222 return jsonObject.stringify(simpleObject, null, 10);
223 } 223 }
224 PASS tests[i](nativeJSON) is tests[i](JSON) 224 PASS tests[i](nativeJSON) is tests[i](JSON)
225 function (jsonObject) { 225 function (jsonObject){
226 return jsonObject.stringify(simpleObject, null, 11); 226 return jsonObject.stringify(simpleObject, null, 11);
227 } 227 }
228 PASS tests[i](nativeJSON) is tests[i].expected 228 PASS tests[i](nativeJSON) is tests[i].expected
229 function (jsonObject) { 229 function (jsonObject){
230 return jsonObject.stringify(simpleObject, null, " "); 230 return jsonObject.stringify(simpleObject, null, " ");
231 } 231 }
232 PASS tests[i](nativeJSON) is tests[i].expected 232 PASS tests[i](nativeJSON) is tests[i].expected
233 function (jsonObject) { 233 function (jsonObject){
234 return jsonObject.stringify(simpleObject, null, " "); 234 return jsonObject.stringify(simpleObject, null, " ");
235 } 235 }
236 PASS tests[i](nativeJSON) is tests[i].expected 236 PASS tests[i](nativeJSON) is tests[i].expected
237 function (jsonObject) { 237 function (jsonObject){
238 return jsonObject.stringify(complexArray, null, " "); 238 return jsonObject.stringify(complexArray, null, " ");
239 } 239 }
240 PASS tests[i](nativeJSON) is tests[i](JSON) 240 PASS tests[i](nativeJSON) is tests[i](JSON)
241 function (jsonObject) { 241 function (jsonObject){
242 return jsonObject.stringify(complexArray, null, 4); 242 return jsonObject.stringify(complexArray, null, 4);
243 } 243 }
244 PASS tests[i](nativeJSON) is tests[i](JSON) 244 PASS tests[i](nativeJSON) is tests[i](JSON)
245 function (jsonObject) { 245 function (jsonObject){
246 return jsonObject.stringify(complexArray, null, "ab"); 246 return jsonObject.stringify(complexArray, null, "ab");
247 } 247 }
248 PASS tests[i](nativeJSON) is tests[i](JSON) 248 PASS tests[i](nativeJSON) is tests[i](JSON)
249 function (jsonObject) { 249 function (jsonObject){
250 return jsonObject.stringify(complexArray, null, 4); 250 return jsonObject.stringify(complexArray, null, 4);
251 } 251 }
252 PASS tests[i](nativeJSON) is tests[i](JSON) 252 PASS tests[i](nativeJSON) is tests[i](JSON)
253 function (jsonObject) { 253 function (jsonObject){
254 return jsonObject.stringify(complexObject, null, " "); 254 return jsonObject.stringify(complexObject, null, " ");
255 } 255 }
256 PASS tests[i](nativeJSON) is tests[i](JSON) 256 PASS tests[i](nativeJSON) is tests[i](JSON)
257 function (jsonObject) { 257 function (jsonObject){
258 return jsonObject.stringify(complexObject, null, 4); 258 return jsonObject.stringify(complexObject, null, 4);
259 } 259 }
260 PASS tests[i](nativeJSON) is tests[i](JSON) 260 PASS tests[i](nativeJSON) is tests[i](JSON)
261 function (jsonObject) { 261 function (jsonObject){
262 return jsonObject.stringify(complexObject, null, "ab"); 262 return jsonObject.stringify(complexObject, null, "ab");
263 } 263 }
264 PASS tests[i](nativeJSON) is tests[i](JSON) 264 PASS tests[i](nativeJSON) is tests[i](JSON)
265 function (jsonObject) { 265 function (jsonObject){
266 return jsonObject.stringify(complexObject, null, 4); 266 return jsonObject.stringify(complexObject, null, 4);
267 } 267 }
268 PASS tests[i](nativeJSON) is tests[i](JSON) 268 PASS tests[i](nativeJSON) is tests[i](JSON)
269 function (jsonObject) { 269 function (jsonObject){
270 var allString = true; 270 var allString = true;
271 var array = ["1","2","3"]; 271 var array = ["1","2","3"];
272 return jsonObject.stringify(simpleArrayWithProto, array); 272 return jsonObject.stringify(simpleArrayWithProto, array);
273 } 273 }
274 PASS tests[i](nativeJSON) is tests[i](JSON) 274 PASS tests[i](nativeJSON) is tests[i](JSON)
275 function (jsonObject) { 275 function (jsonObject){
276 return jsonObject.stringify(simpleArrayWithProto, null, " "); 276 return jsonObject.stringify(simpleArrayWithProto, null, " ");
277 } 277 }
278 PASS tests[i](nativeJSON) is tests[i](JSON) 278 PASS tests[i](nativeJSON) is tests[i](JSON)
279 function (jsonObject) { 279 function (jsonObject){
280 return jsonObject.stringify(simpleArrayWithProto, null, 4); 280 return jsonObject.stringify(simpleArrayWithProto, null, 4);
281 } 281 }
282 PASS tests[i](nativeJSON) is tests[i](JSON) 282 PASS tests[i](nativeJSON) is tests[i](JSON)
283 function (jsonObject) { 283 function (jsonObject){
284 return jsonObject.stringify(simpleArrayWithProto, null, "ab"); 284 return jsonObject.stringify(simpleArrayWithProto, null, "ab");
285 } 285 }
286 PASS tests[i](nativeJSON) is tests[i](JSON) 286 PASS tests[i](nativeJSON) is tests[i](JSON)
287 function (jsonObject) { 287 function (jsonObject){
288 return jsonObject.stringify(simpleArrayWithProto, null, 4); 288 return jsonObject.stringify(simpleArrayWithProto, null, 4);
289 } 289 }
290 PASS tests[i](nativeJSON) is tests[i](JSON) 290 PASS tests[i](nativeJSON) is tests[i](JSON)
291 function (jsonObject) { 291 function (jsonObject){
292 return jsonObject.stringify(simpleObjectWithProto, null, " "); 292 return jsonObject.stringify(simpleObjectWithProto, null, " ");
293 } 293 }
294 PASS tests[i](nativeJSON) is tests[i](JSON) 294 PASS tests[i](nativeJSON) is tests[i](JSON)
295 function (jsonObject) { 295 function (jsonObject){
296 return jsonObject.stringify(simpleObjectWithProto, null, 4); 296 return jsonObject.stringify(simpleObjectWithProto, null, 4);
297 } 297 }
298 PASS tests[i](nativeJSON) is tests[i](JSON) 298 PASS tests[i](nativeJSON) is tests[i](JSON)
299 function (jsonObject) { 299 function (jsonObject){
300 return jsonObject.stringify(simpleObjectWithProto, null, "ab"); 300 return jsonObject.stringify(simpleObjectWithProto, null, "ab");
301 } 301 }
302 PASS tests[i](nativeJSON) is tests[i](JSON) 302 PASS tests[i](nativeJSON) is tests[i](JSON)
303 function (jsonObject) { 303 function (jsonObject){
304 return jsonObject.stringify(simpleObjectWithProto, null, 4); 304 return jsonObject.stringify(simpleObjectWithProto, null, 4);
305 } 305 }
306 PASS tests[i](nativeJSON) is tests[i](JSON) 306 PASS tests[i](nativeJSON) is tests[i](JSON)
307 function (jsonObject) { 307 function (jsonObject){
308 return jsonObject.stringify(simpleObjectWithProto, null, 10); 308 return jsonObject.stringify(simpleObjectWithProto, null, 10);
309 } 309 }
310 PASS tests[i](nativeJSON) is tests[i](JSON) 310 PASS tests[i](nativeJSON) is tests[i](JSON)
311 function (jsonObject) { 311 function (jsonObject){
312 return jsonObject.stringify(simpleObjectWithProto, null, 11); 312 return jsonObject.stringify(simpleObjectWithProto, null, 11);
313 } 313 }
314 PASS tests[i](nativeJSON) is tests[i].expected 314 PASS tests[i](nativeJSON) is tests[i].expected
315 function (jsonObject) { 315 function (jsonObject){
316 return jsonObject.stringify(simpleObjectWithProto, null, " "); 316 return jsonObject.stringify(simpleObjectWithProto, null, " ");
317 } 317 }
318 PASS tests[i](nativeJSON) is tests[i].expected 318 PASS tests[i](nativeJSON) is tests[i].expected
319 function (jsonObject) { 319 function (jsonObject){
320 return jsonObject.stringify(simpleObjectWithProto, null, " "); 320 return jsonObject.stringify(simpleObjectWithProto, null, " ");
321 } 321 }
322 PASS tests[i](nativeJSON) is tests[i].expected 322 PASS tests[i](nativeJSON) is tests[i].expected
323 function (jsonObject) { 323 function (jsonObject){
324 return jsonObject.stringify(complexArrayWithProto, null, " "); 324 return jsonObject.stringify(complexArrayWithProto, null, " ");
325 } 325 }
326 PASS tests[i](nativeJSON) is tests[i](JSON) 326 PASS tests[i](nativeJSON) is tests[i](JSON)
327 function (jsonObject) { 327 function (jsonObject){
328 return jsonObject.stringify(complexArrayWithProto, null, 4); 328 return jsonObject.stringify(complexArrayWithProto, null, 4);
329 } 329 }
330 PASS tests[i](nativeJSON) is tests[i](JSON) 330 PASS tests[i](nativeJSON) is tests[i](JSON)
331 function (jsonObject) { 331 function (jsonObject){
332 return jsonObject.stringify(complexArrayWithProto, null, "ab"); 332 return jsonObject.stringify(complexArrayWithProto, null, "ab");
333 } 333 }
334 PASS tests[i](nativeJSON) is tests[i](JSON) 334 PASS tests[i](nativeJSON) is tests[i](JSON)
335 function (jsonObject) { 335 function (jsonObject){
336 return jsonObject.stringify(complexArrayWithProto, null, 4); 336 return jsonObject.stringify(complexArrayWithProto, null, 4);
337 } 337 }
338 PASS tests[i](nativeJSON) is tests[i](JSON) 338 PASS tests[i](nativeJSON) is tests[i](JSON)
339 function (jsonObject) { 339 function (jsonObject){
340 return jsonObject.stringify(complexObjectWithProto, null, " "); 340 return jsonObject.stringify(complexObjectWithProto, null, " ");
341 } 341 }
342 PASS tests[i](nativeJSON) is tests[i](JSON) 342 PASS tests[i](nativeJSON) is tests[i](JSON)
343 function (jsonObject) { 343 function (jsonObject){
344 return jsonObject.stringify(complexObjectWithProto, null, 4); 344 return jsonObject.stringify(complexObjectWithProto, null, 4);
345 } 345 }
346 PASS tests[i](nativeJSON) is tests[i](JSON) 346 PASS tests[i](nativeJSON) is tests[i](JSON)
347 function (jsonObject) { 347 function (jsonObject){
348 return jsonObject.stringify(complexObjectWithProto, null, "ab"); 348 return jsonObject.stringify(complexObjectWithProto, null, "ab");
349 } 349 }
350 PASS tests[i](nativeJSON) is tests[i](JSON) 350 PASS tests[i](nativeJSON) is tests[i](JSON)
351 function (jsonObject) { 351 function (jsonObject){
352 return jsonObject.stringify(complexObjectWithProto, null, 4); 352 return jsonObject.stringify(complexObjectWithProto, null, 4);
353 } 353 }
354 PASS tests[i](nativeJSON) is tests[i](JSON) 354 PASS tests[i](nativeJSON) is tests[i](JSON)
355 function (jsonObject) { 355 function (jsonObject){
356 return jsonObject.stringify(objectWithSideEffectGetter); 356 return jsonObject.stringify(objectWithSideEffectGetter);
357 } 357 }
358 FAIL tests[i](nativeJSON) should be {"foo":1}. Was {}. 358 FAIL tests[i](nativeJSON) should be {"foo":1}. Was {}.
359 function (jsonObject) { 359 function (jsonObject){
360 return jsonObject.stringify(objectWithSideEffectGetterAndProto); 360 return jsonObject.stringify(objectWithSideEffectGetterAndProto);
361 } 361 }
362 FAIL tests[i](nativeJSON) should be {"foo":1}. Was {}. 362 FAIL tests[i](nativeJSON) should be {"foo":1}. Was {}.
363 function (jsonObject) { 363 function (jsonObject){
364 return jsonObject.stringify(arrayWithSideEffectGetter); 364 return jsonObject.stringify(arrayWithSideEffectGetter);
365 } 365 }
366 PASS tests[i](nativeJSON) is tests[i](JSON) 366 PASS tests[i](nativeJSON) is tests[i](JSON)
367 function (jsonObject) { 367 function (jsonObject){
368 return jsonObject.stringify(arrayWithSideEffectGetterAndProto); 368 return jsonObject.stringify(arrayWithSideEffectGetterAndProto);
369 } 369 }
370 PASS tests[i](nativeJSON) is tests[i](JSON) 370 PASS tests[i](nativeJSON) is tests[i](JSON)
371 function (jsonObject) { 371 function (jsonObject){
372 replaceTracker = ""; 372 replaceTracker = "";
373 jsonObject.stringify([1,2,3,,,,4,5,6], replaceFunc); 373 jsonObject.stringify([1,2,3,,,,4,5,6], replaceFunc);
374 return replaceTracker; 374 return replaceTracker;
375 } 375 }
376 PASS tests[i](nativeJSON) is tests[i].expected 376 FAIL tests[i](nativeJSON) should be (string)[1,2,3,null,null,null,4,5,6];0(numbe r)1;1(number)2;2(number)3;3(number)undefined;4(number)undefined;5(number)undefin ed;6(number)4;7(number)5;8(number)6;. Was (string)[1,2,3,null,null,null,4,5,6];0 (string)1;1(string)2;2(string)3;3(string)undefined;4(string)undefined;5(string)u ndefined;6(string)4;7(string)5;8(string)6;.
377 function (jsonObject) { 377 function (jsonObject){
378 replaceTracker = ""; 378 replaceTracker = "";
379 jsonObject.stringify({a:"a", b:"b", c:"c", 3: "d", 2: "e", 1: "f"}, repl aceFunc); 379 jsonObject.stringify({a:"a", b:"b", c:"c", 3: "d", 2: "e", 1: "f"}, repl aceFunc);
380 return replaceTracker; 380 return replaceTracker;
381 } 381 }
382 PASS tests[i](nativeJSON) is tests[i].expected 382 PASS tests[i](nativeJSON) is tests[i].expected
383 function (jsonObject) { 383 function (jsonObject){
384 var count = 0; 384 var count = 0;
385 var array = [{toString:function(){count++; array[0]='a'; array[1]='c'; a rray[2]='b'; return 'a'}}]; 385 var array = [{toString:function(){count++; array[0]='a'; array[1]='c'; a rray[2]='b'; return 'a'}}];
386 jsonObject.stringify(simpleObject, array); 386 jsonObject.stringify(simpleObject, array);
387 return count; 387 return count;
388 } 388 }
389 PASS tests[i](nativeJSON) is tests[i](JSON) 389 FAIL tests[i](nativeJSON) should be 0. Threw exception illegal access
390 function (jsonObject) { 390 function (jsonObject){
391 var allString = true; 391 var allString = true;
392 var array = [{toString:function(){array[0]='a'; array[1]='c'; array[2]=' b'; return 'a'}}, 'b', 'c']; 392 var array = [{toString:function(){array[0]='a'; array[1]='c'; array[2]=' b'; return 'a'}}, 'b', 'c'];
393 return jsonObject.stringify(simpleObject, array); 393 return jsonObject.stringify(simpleObject, array);
394 } 394 }
395 PASS tests[i](nativeJSON) is tests[i](JSON) 395 FAIL tests[i](nativeJSON) should be {"b":"2","c":"3"}. Threw exception illegal a ccess
396 function (jsonObject) { 396 function (jsonObject){
397 var count = 0; 397 var count = 0;
398 var array = [{toString:function(){count++; array[0]='a'; array[1]='c'; a rray[2]='b'; return 'a'}}, 'b', 'c']; 398 var array = [{toString:function(){count++; array[0]='a'; array[1]='c'; a rray[2]='b'; return 'a'}}, 'b', 'c'];
399 jsonObject.stringify(simpleObject, array); 399 jsonObject.stringify(simpleObject, array);
400 return count; 400 return count;
401 } 401 }
402 PASS tests[i](nativeJSON) is tests[i](JSON) 402 FAIL tests[i](nativeJSON) should be 0. Threw exception illegal access
403 function (jsonObject) { 403 function (jsonObject){
404 return jsonObject.stringify({a:"1", get b() { this.a="foo"; return "gett er"; }, c:"3"}); 404 return jsonObject.stringify({a:"1", get b() { this.a="foo"; return "gett er"; }, c:"3"});
405 } 405 }
406 PASS tests[i](nativeJSON) is tests[i](JSON) 406 PASS tests[i](nativeJSON) is tests[i](JSON)
407 function (jsonObject) { 407 function (jsonObject){
408 return jsonObject.stringify({a:"1", get b() { this.c="foo"; return "gett er"; }, c:"3"}); 408 return jsonObject.stringify({a:"1", get b() { this.c="foo"; return "gett er"; }, c:"3"});
409 } 409 }
410 PASS tests[i](nativeJSON) is tests[i](JSON) 410 PASS tests[i](nativeJSON) is tests[i](JSON)
411 function (jsonObject) { 411 function (jsonObject){
412 var setterCalled = false; 412 var setterCalled = false;
413 jsonObject.stringify({a:"1", set b(s) { setterCalled = true; return "set ter"; }, c:"3"}); 413 jsonObject.stringify({a:"1", set b(s) { setterCalled = true; return "set ter"; }, c:"3"});
414 return setterCalled; 414 return setterCalled;
415 } 415 }
416 PASS tests[i](nativeJSON) is tests[i](JSON) 416 PASS tests[i](nativeJSON) is tests[i](JSON)
417 function (jsonObject) { 417 function (jsonObject){
418 return jsonObject.stringify({a:"1", get b(){ return "getter"; }, set b(s ) { return "setter"; }, c:"3"}); 418 return jsonObject.stringify({a:"1", get b(){ return "getter"; }, set b(s ) { return "setter"; }, c:"3"});
419 } 419 }
420 PASS tests[i](nativeJSON) is tests[i](JSON) 420 PASS tests[i](nativeJSON) is tests[i](JSON)
421 function (jsonObject) { 421 function (jsonObject){
422 return jsonObject.stringify(new Array(10)); 422 return jsonObject.stringify(new Array(10));
423 } 423 }
424 PASS tests[i](nativeJSON) is tests[i](JSON) 424 PASS tests[i](nativeJSON) is tests[i](JSON)
425 function (jsonObject) { 425 function (jsonObject){
426 return jsonObject.stringify([undefined,,null,0,false]); 426 return jsonObject.stringify([undefined,,null,0,false]);
427 } 427 }
428 PASS tests[i](nativeJSON) is tests[i](JSON) 428 PASS tests[i](nativeJSON) is tests[i](JSON)
429 function (jsonObject) { 429 function (jsonObject){
430 return jsonObject.stringify({p1:undefined,p2:null,p3:0,p4:false}); 430 return jsonObject.stringify({p1:undefined,p2:null,p3:0,p4:false});
431 } 431 }
432 PASS tests[i](nativeJSON) is tests[i](JSON) 432 PASS tests[i](nativeJSON) is tests[i](JSON)
433 function (jsonObject) { 433 function (jsonObject){
434 cycleTracker = ""; 434 cycleTracker = "";
435 return jsonObject.stringify(cyclicObject); 435 return jsonObject.stringify(cyclicObject);
436 } 436 }
437 PASS tests[i](nativeJSON) threw exception TypeError: JSON.stringify cannot seria lize cyclic structures.. 437 PASS tests[i](nativeJSON) threw exception TypeError: Converting circular structu re to JSON.
438 function (jsonObject) { 438 function (jsonObject){
439 cycleTracker = ""; 439 cycleTracker = "";
440 try { jsonObject.stringify(cyclicObject); } catch(e) { cycleTracker += " -> exception" } 440 try { jsonObject.stringify(cyclicObject); } catch(e) { cycleTracker += " -> exception" }
441 return cycleTracker; 441 return cycleTracker;
442 } 442 }
443 PASS tests[i](nativeJSON) is tests[i].expected 443 PASS tests[i](nativeJSON) is tests[i].expected
444 function (jsonObject) { 444 function (jsonObject){
445 cycleTracker = ""; 445 cycleTracker = "";
446 return jsonObject.stringify(cyclicArray); 446 return jsonObject.stringify(cyclicArray);
447 } 447 }
448 PASS tests[i](nativeJSON) threw exception TypeError: JSON.stringify cannot seria lize cyclic structures.. 448 PASS tests[i](nativeJSON) threw exception TypeError: Converting circular structu re to JSON.
449 function (jsonObject) { 449 function (jsonObject){
450 cycleTracker = ""; 450 cycleTracker = "";
451 try { jsonObject.stringify(cyclicArray); } catch(e) { cycleTracker += " -> exception" } 451 try { jsonObject.stringify(cyclicArray); } catch(e) { cycleTracker += " -> exception" }
452 return cycleTracker; 452 return cycleTracker;
453 } 453 }
454 PASS tests[i](nativeJSON) is tests[i].expected 454 FAIL tests[i](nativeJSON) should be 0(number):[object Object]first, -> exception . Was 0(string):[object Object]first, -> exception.
455 function (jsonObject) { 455 function (jsonObject){
456 getterCalls = 0; 456 getterCalls = 0;
457 return jsonObject.stringify(magicObject) + " :: getter calls = " + gette rCalls; 457 return jsonObject.stringify(magicObject) + " :: getter calls = " + gette rCalls;
458 } 458 }
459 PASS tests[i](nativeJSON) is tests[i](JSON) 459 PASS tests[i](nativeJSON) is tests[i](JSON)
460 function (jsonObject) { 460 function (jsonObject){
461 return jsonObject.stringify(undefined); 461 return jsonObject.stringify(undefined);
462 } 462 }
463 PASS tests[i](nativeJSON) is tests[i](JSON) 463 PASS tests[i](nativeJSON) is tests[i](JSON)
464 function (jsonObject) { 464 function (jsonObject){
465 return jsonObject.stringify(null); 465 return jsonObject.stringify(null);
466 } 466 }
467 PASS tests[i](nativeJSON) is tests[i](JSON) 467 PASS tests[i](nativeJSON) is tests[i](JSON)
468 function (jsonObject) { 468 function (jsonObject){
469 return jsonObject.stringify({toJSON:function(){ return undefined; }}); 469 return jsonObject.stringify({toJSON:function(){ return undefined; }});
470 } 470 }
471 PASS tests[i](nativeJSON) is tests[i](JSON) 471 PASS tests[i](nativeJSON) is tests[i](JSON)
472 function (jsonObject) { 472 function (jsonObject){
473 return jsonObject.stringify({toJSON:function(){ return null; }}); 473 return jsonObject.stringify({toJSON:function(){ return null; }});
474 } 474 }
475 PASS tests[i](nativeJSON) is tests[i](JSON) 475 PASS tests[i](nativeJSON) is tests[i](JSON)
476 function (jsonObject) { 476 function (jsonObject){
477 return jsonObject.stringify([{toJSON:function(){ return undefined; }}]); 477 return jsonObject.stringify([{toJSON:function(){ return undefined; }}]);
478 } 478 }
479 PASS tests[i](nativeJSON) is tests[i](JSON) 479 PASS tests[i](nativeJSON) is tests[i](JSON)
480 function (jsonObject) { 480 function (jsonObject){
481 return jsonObject.stringify([{toJSON:function(){ return null; }}]); 481 return jsonObject.stringify([{toJSON:function(){ return null; }}]);
482 } 482 }
483 PASS tests[i](nativeJSON) is tests[i](JSON) 483 PASS tests[i](nativeJSON) is tests[i](JSON)
484 function (jsonObject) { 484 function (jsonObject){
485 return jsonObject.stringify({a:{toJSON:function(){ return undefined; }}} ); 485 return jsonObject.stringify({a:{toJSON:function(){ return undefined; }}} );
486 } 486 }
487 PASS tests[i](nativeJSON) is tests[i](JSON) 487 PASS tests[i](nativeJSON) is tests[i](JSON)
488 function (jsonObject) { 488 function (jsonObject){
489 return jsonObject.stringify({a:{toJSON:function(){ return null; }}}); 489 return jsonObject.stringify({a:{toJSON:function(){ return null; }}});
490 } 490 }
491 PASS tests[i](nativeJSON) is tests[i](JSON) 491 PASS tests[i](nativeJSON) is tests[i](JSON)
492 function (jsonObject) { 492 function (jsonObject){
493 return jsonObject.stringify({a:{toJSON:function(){ return function(){}; }}}); 493 return jsonObject.stringify({a:{toJSON:function(){ return function(){}; }}});
494 } 494 }
495 PASS tests[i](nativeJSON) is tests[i](JSON) 495 PASS tests[i](nativeJSON) is tests[i](JSON)
496 function (jsonObject) { 496 function (jsonObject){
497 return jsonObject.stringify({a:function(){}}); 497 return jsonObject.stringify({a:function(){}});
498 } 498 }
499 PASS tests[i](nativeJSON) is tests[i](JSON) 499 PASS tests[i](nativeJSON) is tests[i](JSON)
500 function (jsonObject) { 500 function (jsonObject){
501 var deepObject = {}; 501 var deepObject = {};
502 for (var i = 0; i < 2048; i++) 502 for (var i = 0; i < 2048; i++)
503 deepObject = {next:deepObject}; 503 deepObject = {next:deepObject};
504 return jsonObject.stringify(deepObject); 504 return jsonObject.stringify(deepObject);
505 } 505 }
506 PASS tests[i](nativeJSON) is tests[i](JSON) 506 PASS tests[i](nativeJSON) is tests[i](JSON)
507 function (jsonObject) { 507 function (jsonObject){
508 var deepArray = []; 508 var deepArray = [];
509 for (var i = 0; i < 2048; i++) 509 for (var i = 0; i < 2048; i++)
510 deepArray = [deepArray]; 510 deepArray = [deepArray];
511 return jsonObject.stringify(deepArray); 511 return jsonObject.stringify(deepArray);
512 } 512 }
513 PASS tests[i](nativeJSON) is tests[i](JSON) 513 PASS tests[i](nativeJSON) is tests[i](JSON)
514 function (jsonObject) { 514 function (jsonObject){
515 var depth = 0; 515 var depth = 0;
516 function toDeepVirtualJSONObject() { 516 function toDeepVirtualJSONObject() {
517 if (++depth >= 2048) 517 if (++depth >= 2048)
518 return {}; 518 return {};
519 var r = {}; 519 var r = {};
520 r.toJSON = toDeepVirtualJSONObject; 520 r.toJSON = toDeepVirtualJSONObject;
521 return {recurse: r}; 521 return {recurse: r};
522 } 522 }
523 return jsonObject.stringify(toDeepVirtualJSONObject()); 523 return jsonObject.stringify(toDeepVirtualJSONObject());
524 } 524 }
525 PASS tests[i](nativeJSON) is tests[i](JSON) 525 PASS tests[i](nativeJSON) is tests[i](JSON)
526 function (jsonObject) { 526 function (jsonObject){
527 var depth = 0; 527 var depth = 0;
528 function toDeepVirtualJSONArray() { 528 function toDeepVirtualJSONArray() {
529 if (++depth >= 2048) 529 if (++depth >= 2048)
530 return []; 530 return [];
531 var r = []; 531 var r = [];
532 r.toJSON = toDeepJSONArray; 532 r.toJSON = toDeepJSONArray;
533 return [r]; 533 return [r];
534 } 534 }
535 return jsonObject.stringify(toDeepVirtualJSONArray()); 535 return jsonObject.stringify(toDeepVirtualJSONArray());
536 } 536 }
537 function (jsonObject) { 537 function (jsonObject){
538 return jsonObject.stringify(fullCharsetString); 538 return jsonObject.stringify(fullCharsetString);
539 } 539 }
540 PASS tests[i](nativeJSON) is tests[i](JSON) 540 PASS tests[i](nativeJSON) is tests[i](JSON)
541 PASS successfullyParsed is true 541 PASS successfullyParsed is true
542 542
543 TEST COMPLETE 543 TEST COMPLETE
544 544
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698