Lines Matching defs:toJSON
81 // Test toJSON function.
82 var tojson_obj = { toJSON: function() {
90 // Test that we don't recursively look for the toJSON function.
92 tojson_proto_obj.__proto__ = { toJSON: function() {
98 // Test toJSON produced by a getter.
99 var tojson_via_getter = { get toJSON() {
109 JSON.stringify({ get toJSON() { throw "error"; } });
112 // Test toJSON with key.
113 tojson_obj = { toJSON: function(key) { return key + key; } };
119 // Test toJSON with exception.
120 var tojson_ex = { toJSON: function(key) { throw "123" } };
124 // Test toJSON with access to this.
125 var obj = { toJSON: function(key) { return this.a + key; }, a: "x" };