Skip to content

Commit fcb5962

Browse files
committed
Add additional JSON.stringify test for object Symbol values
1 parent a960011 commit fcb5962

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

test/json.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,12 @@ describe('JSON', function () {
1010
expect(JSON.stringify([Symbol('foo')])).to.eql('[null]');
1111
});
1212

13-
ifSymbolsIt('skips symbol properties in an object', function () {
13+
ifSymbolsIt('skips symbol properties and values in an object', function () {
1414
var obj = {};
1515
var enumSym = Symbol('enumerable');
1616
var nonenum = Symbol('non-enumerable');
1717
obj[enumSym] = true;
18+
obj.sym = enumSym;
1819
Object.defineProperty(obj, nonenum, { enumerable: false, value: true });
1920
expect(Object.getOwnPropertySymbols(obj)).to.eql([enumSym, nonenum]);
2021
expect(JSON.stringify(obj)).to.eql('{}');

0 commit comments

Comments
 (0)