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

Unified Diff: test/mjsunit/mirror-object.js

Issue 113399: Use JSON.stringify to serialize debugger messages (Closed) Base URL: http://v8.googlecode.com/svn/branches/bleeding_edge/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/mjsunit/mirror-number.js ('k') | test/mjsunit/mirror-regexp.js » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/mjsunit/mirror-object.js
===================================================================
--- test/mjsunit/mirror-object.js (revision 1956)
+++ test/mjsunit/mirror-object.js (working copy)
@@ -44,8 +44,9 @@
// Create mirror and JSON representation.
var mirror = debug.MakeMirror(obj);
var serializer = debug.MakeMirrorSerializer();
- var json = serializer.serializeValue(mirror);
- var refs = new MirrorRefCache(serializer.serializeReferencedObjects());
+ var json = JSON.stringify(serializer.serializeValue(mirror));
+ var refs = new MirrorRefCache(
+ JSON.stringify(serializer.serializeReferencedObjects()));
// Check the mirror hierachy.
assertTrue(mirror instanceof debug.Mirror, 'Unexpected mirror hierachy');
@@ -105,7 +106,7 @@
assertEquals(names.length, fromJSON.properties.length, 'Some properties missing in JSON');
for (var i = 0; i < fromJSON.properties.length; i++) {
var name = fromJSON.properties[i].name;
- if (!name) name = fromJSON.properties[i].index;
+ if (typeof name == 'undefined') name = fromJSON.properties[i].index;
var found = false;
for (var j = 0; j < names.length; j++) {
if (names[j] == name) {
@@ -157,7 +158,6 @@
this.y_ = y;
}
-
// Test a number of different objects.
testObjectMirror({}, 'Object', 'Object');
testObjectMirror({'a':1,'b':2}, 'Object', 'Object');
« no previous file with comments | « test/mjsunit/mirror-number.js ('k') | test/mjsunit/mirror-regexp.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698