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

Side by Side Diff: test/mjsunit/json.js

Issue 11185050: Make sure the fast case of ScanJsonString bails out to the slow case correctly. (Closed) Base URL: https://v8.googlecode.com/svn/branches/bleeding_edge
Patch Set: Created 8 years, 2 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
« no previous file with comments | « src/json-parser.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2009 the V8 project authors. All rights reserved. 1 // Copyright 2009 the V8 project authors. All rights reserved.
2 // Redistribution and use in source and binary forms, with or without 2 // Redistribution and use in source and binary forms, with or without
3 // modification, are permitted provided that the following conditions are 3 // modification, are permitted provided that the following conditions are
4 // met: 4 // met:
5 // 5 //
6 // * Redistributions of source code must retain the above copyright 6 // * Redistributions of source code must retain the above copyright
7 // notice, this list of conditions and the following disclaimer. 7 // notice, this list of conditions and the following disclaimer.
8 // * Redistributions in binary form must reproduce the above 8 // * Redistributions in binary form must reproduce the above
9 // copyright notice, this list of conditions and the following 9 // copyright notice, this list of conditions and the following
10 // disclaimer in the documentation and/or other materials provided 10 // disclaimer in the documentation and/or other materials provided
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after
421 // objects in JSON.parse. Instead we read them as we would JS object 421 // objects in JSON.parse. Instead we read them as we would JS object
422 // literals. If we change that, this test should change with it. 422 // literals. If we change that, this test should change with it.
423 // 423 //
424 // Parse a non-object value as __proto__. This must not create a 424 // Parse a non-object value as __proto__. This must not create a
425 // __proto__ property different from the original, and should not 425 // __proto__ property different from the original, and should not
426 // change the original. 426 // change the original.
427 var o = JSON.parse('{"__proto__":5}'); 427 var o = JSON.parse('{"__proto__":5}');
428 assertEquals(Object.prototype, o.__proto__); // __proto__ isn't changed. 428 assertEquals(Object.prototype, o.__proto__); // __proto__ isn't changed.
429 assertEquals(0, Object.keys(o).length); // __proto__ isn't added as enumerable. 429 assertEquals(0, Object.keys(o).length); // __proto__ isn't added as enumerable.
430 430
431 431 var json = '{"stuff before slash\\\\stuff after slash":"whatever"}';
432 432 assertEquals(json, JSON.stringify(JSON.parse(json)));
OLDNEW
« no previous file with comments | « src/json-parser.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698