MCPcopy Create free account
hub / github.com/nodejs/node / createTests

Function createTests

deps/v8/test/webkit/resources/JSON-stringify.js:25–523  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

23
24
25function createTests() {
26 var simpleArray = ['a', 'b', 'c'];
27 var simpleObject = {a:"1", b:"2", c:"3"};
28 var complexArray = ['a', 'b', 'c',,,simpleObject, simpleArray, [simpleObject,simpleArray]];
29 var complexObject = {a:"1", b:"2", c:"3", d:undefined, e:null, "":12, get f(){ return simpleArray; }, array: complexArray};
30 var simpleArrayWithProto = ['d', 'e', 'f'];
31 simpleArrayWithProto.__proto__ = simpleObject;
32 var simpleObjectWithProto = {d:"4", e:"5", f:"6", __proto__:simpleObject};
33 var complexArrayWithProto = ['d', 'e', 'f',,,simpleObjectWithProto, simpleArrayWithProto, [simpleObjectWithProto,simpleArrayWithProto]];
34 complexArrayWithProto.__proto__ = simpleObjectWithProto;
35 var complexObjectWithProto = {d:"4", e:"5", f:"6", g:undefined, h:null, "":12, get i(){ return simpleArrayWithProto; }, array2: complexArrayWithProto, __proto__:complexObject};
36 var objectWithSideEffectGetter = {get b() {this.foo=1;}};
37 var objectWithSideEffectGetterAndProto = {__proto__:{foo:"bar"}, get b() {this.foo=1;}};
38 var arrayWithSideEffectGetter = [];
39 arrayWithSideEffectGetter.__defineGetter__("b", function(){this.foo=1;});
40 var arrayWithSideEffectGetterAndProto = [];
41 arrayWithSideEffectGetterAndProto.__defineGetter__("b", function(){this.foo=1;});
42 arrayWithSideEffectGetterAndProto.__proto__ = {foo:"bar"};
43 var result = [];
44 result.push(function (jsonObject){
45 return jsonObject.stringify(1);
46 });
47 result.push(function (jsonObject){
48 return jsonObject.stringify(1.5);
49 });
50 result.push(function (jsonObject){
51 return jsonObject.stringify(-1);
52 });
53 result.push(function (jsonObject){
54 return jsonObject.stringify(-1.5);
55 });
56 result.push(function (jsonObject){
57 return jsonObject.stringify(null);
58 });
59 result.push(function (jsonObject){
60 return jsonObject.stringify("string");
61 });
62 result.push(function (jsonObject){
63 return jsonObject.stringify(new Number(0));
64 });
65 result.push(function (jsonObject){
66 return jsonObject.stringify(new Number(1));
67 });
68 result.push(function (jsonObject){
69 return jsonObject.stringify(new Number(1.5));
70 });
71 result.push(function (jsonObject){
72 return jsonObject.stringify(new Number(-1));
73 });
74 result.push(function (jsonObject){
75 return jsonObject.stringify(new Number(-1.5));
76 });
77 result.push(function (jsonObject){
78 return jsonObject.stringify(new String("a string object"));
79 });
80 result.push(function (jsonObject){
81 return jsonObject.stringify(new Boolean(true));
82 });

Callers 1

JSON-stringify.jsFile · 0.85

Calls 4

toDeepVirtualJSONObjectFunction · 0.85
toDeepVirtualJSONArrayFunction · 0.85
createArrayFunction · 0.70
pushMethod · 0.45

Tested by

no test coverage detected