Searched refs:toJSON (Results 1 - 8 of 8) sorted by relevance

/external/webkit/SunSpider/hosted/
H A Djson2.js38 When an object value is found, if the object contains a toJSON
39 method, its toJSON method will be called and the result will be
40 stringified. A toJSON method does not serialize: it returns the
42 or undefined if nothing should be serialized. The toJSON method
48 Date.prototype.toJSON = function (key) {
155 test, toJSON, toString, valueOf
173 if (typeof Date.prototype.toJSON !== 'function') {
175 Date.prototype.toJSON = function (key) {
186 String.prototype.toJSON =
187 Number.prototype.toJSON
[all...]
/external/v8/test/mjsunit/
H A Djson.js31 assertEquals(alternative, n1.toJSON());
34 assertThrows(function () { n2.toJSON(); }, TypeError);
37 assertThrows(function () { n3.toJSON(); }, TypeError, 'result_not_primitive');
44 assertEquals(null, n4.toJSON());
47 // Number toJSON
48 assertEquals(3, (3).toJSON());
49 assertEquals(3, (3).toJSON(true));
50 assertEquals(4, (new Number(4)).toJSON());
53 // Boolean toJSON
54 assertEquals(true, (true).toJSON());
[all...]
/external/webkit/LayoutTests/fast/js/resources/
H A Djson2-es5-compat.js30 When an object value is found, if the object contains a toJSON
31 method, its toJSON method will be called and the result will be
32 stringified. A toJSON method does not serialize: it returns the
34 or undefined if nothing should be serialized. The toJSON method
40 Date.prototype.toJSON = function (key) {
155 test, toJSON, toString, valueOf
171 if (typeof Date.prototype.toJSON !== 'function') {
173 Date.prototype.toJSON = function (key) {
230 // If the value has a toJSON method, call it to obtain a replacement value.
233 typeof value.toJSON
[all...]
H A DJSON-stringify.js88 return jsonObject.stringify({toJSON: Date.prototype.toJSON});
92 return jsonObject.stringify({toJSON: Date.prototype.toJSON, toISOString: function(){ return "custom toISOString"; }});
95 return jsonObject.stringify({toJSON: Date.prototype.toJSON, toISOString: function(){ return {}; }});
99 return jsonObject.stringify({toJSON: Date.prototype.toJSON, toISOString: function(){ throw "An exception"; }});
110 d.toJSON = undefined;
380 preSelf2: {toJSON
[all...]
/external/webkit/JavaScriptCore/runtime/
H A DCommonIdentifiers.h75 macro(toJSON) \
H A DJSONObject.cpp95 JSValue toJSON(JSValue, const PropertyNameForFunctionCall&);
332 inline JSValue Stringifier::toJSON(JSValue value, const PropertyNameForFunctionCall& propertyName) function in class:JSC::Stringifier
335 if (!value.isObject() || !asObject(value)->hasProperty(m_exec, m_exec->globalData().propertyNames->toJSON))
338 JSValue toJSONFunction = asObject(value)->get(m_exec, m_exec->globalData().propertyNames->toJSON);
358 // Call the toJSON function.
359 value = toJSON(value, propertyName);
/external/webkit/SunSpider/tests/parse-only/
H A Dprototype-1.6.0.3.js124 toJSON: function(object) {
134 if (object.toJSON) return object.toJSON();
139 var value = Object.toJSON(object[property]);
141 results.push(property.toJSON() + ': ' + value);
261 Date.prototype.toJSON = function() {
487 toJSON: function() {
914 toJSON: function() {
917 var value = Object.toJSON(object);
985 toJSON
[all...]
H A Dconcat-jquery-mootools-prototype.js7329 toJSON: function(){
8503 toJSON: function(object) {
8513 if (object.toJSON) return object.toJSON();
8518 var value = Object.toJSON(object[property]);
8520 results.push(property.toJSON() + ': ' + value);
8640 Date.prototype.toJSON = function() {
8866 toJSON: function() {
9293 toJSON: function() {
9296 var value = Object.toJSON(objec
[all...]

Completed in 182 milliseconds