summaryrefslogtreecommitdiffstats
path: root/js/src/tests/js1_8_5/extensions/object-toSource-with-symbol-keys.js
blob: cbd019e1ef0f5d31daf4c869d2bc06423730c896 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
/* Any copyright is dedicated to the Public Domain.
 * http://creativecommons.org/licenses/publicdomain/ */

var obj = {};
obj[Symbol.iterator] = 1;
assertEq(obj.toSource(), "({[Symbol.iterator]:1})");
obj[Symbol(undefined)] = 2;
obj[Symbol('ponies')] = 3;
obj[Symbol.for('ponies')] = 4;
assertEq(obj.toSource(),
         '({[Symbol.iterator]:1, [Symbol()]:2, [Symbol("ponies")]:3, [Symbol.for("ponies")]:4})');

if (typeof reportCompare === "function")
    reportCompare(0, 0);