1 2 3 4 5 6 7
var map = new WeakMap(); var sym = Symbol(); try { map.set(sym, 1); } catch (e) { assertEq(!!e.message.match(/an unregistered symbol/), false); }