]>
git.saurik.com Git - apple/javascriptcore.git/blob - tests/stress/symbol-with-json.js
1 // This tests JSON correctly behaves with Symbol.
3 if (JSON
.stringify(Symbol('Cocoa')) !== undefined)
4 throw "Error: bad value " + JSON
.stringify(Symbol('Cocoa'));
7 var symbol
= Symbol("Cocoa");
9 object
['Cappuccino'] = 42;
10 if (JSON
.stringify(object
) !== '{"Cappuccino":42}')
11 throw "Error: bad value " + JSON
.stringify(object
);
13 if (JSON
.stringify(object
, [ Symbol('Cocoa') ]) !== "{}")
14 throw "Error: bad value " + JSON
.stringify(object
, [ Symbol('Cocoa') ]);