Lines Matching refs:function
33 n1.toISOString = function () { return "foo"; };
37 assertThrows(function () { n2.toJSON(); }, TypeError);
39 n4.toISOString = function () {
49 //Test Date.prototype.toJSON as generic function.
51 toISOString: function() { return 42; }};
55 valueOf: function() { return Infinity; },
56 toISOString: function() { return 42; }};
61 toString: function() { return Infinity; },
62 toISOString: function() { return 42; }};
69 toISOString: function() { return 42; }};
74 toString: function() { return "Infinity"; },
75 toISOString: function() { return 42; }};
79 toISOString: function() { return ["not primitive"]; }};
132 function GetFilter(name) {
133 function Filter(key, value) {
147 function DoubleNumbers(key, value) {
157 function TestInvalid(str) {
158 assertThrows(function () { JSON.parse(str); }, SyntaxError);
165 TestInvalid('function () { return 0; }');
228 function TestStringify(expected, input) {
236 TestStringify("false", {toJSON: function () { return false; }});
266 b : function() { 1 },
268 d : function() { 2 } });
270 [1, function() { 1 }, true, function() { 2 }]);
272 { toJSON : function() { return 'toJSON 123'; } });
274 { a : { toJSON : function() { return 321; } } });
294 b.__proto__ = { toJSON : function() { return 321;} };
309 assertThrows(function () { JSON.stringify(circular); }, TypeError);
310 assertThrows(function () { JSON.stringify(circular, null, 0); }, TypeError);
325 checker.toJSON = function(key) { return 1 + key; };
338 function newx(k, v) { return (k == "x") ? new v(42) : v; }
344 TestStringify(undefined, function () { });
345 // Arrays with missing, undefined or function elements have those elements
347 TestStringify("[null,null,null]", [undefined,,function(){}]);
349 // Objects with undefined or function properties (including replaced properties)
352 JSON.stringify({a: undefined, b: function(){}, c: 42, d: 42},
353 function(k, v) { if (k == "c") return undefined;
354 if (k == "d") return function(){};
364 var o = { toString: function() { return "42"; } };
372 // Following the ES5 specification of the abstraction function Quote.
399 num37.valueOf = function() { return 37; };
403 numFoo.toString = function() { return "foo"; };
406 numTrue.valueOf = function() { return true; }
409 strFoo.toString = function() { return "foo"; };
413 str37.valueOf = function() { return 37; };
416 strTrue.toString = function() { return true; }
418 var func = function() { /* Is callable */ };
420 var funcJSON = function() { /* Is callable */ };
421 funcJSON.toJSON = function() { return "has toJSON"; };
426 reJSON.toJSON = function() { return "has toJSON"; };
435 oddball.__proto__ = { __proto__: null, toString: function() { return true; } };
441 return function() { callCount++;
454 valueOf: function() { return true; } };
456 toJSON: function () { return oddball3; } }
462 falseNum.toString = function() { return 42; };