blob: 932ecf7bc0b80490f030c4be1e027ad917a15ead [file] [log] [blame]
function test() {
// Date.prototype.toJSON -> ToPrimitive -> Get -> [[Get]]
// Date.prototype.toJSON -> Invoke -> GetMethod -> GetV -> [[Get]]
var get = [];
var p = new Proxy({toString:Function(),toISOString:Function()}, { get: function(o, k) { get.push(k); return o[k]; }});
Date.prototype.toJSON.call(p);
return get[0] === Symbol.toPrimitive && get.slice(1) + '' === "valueOf,toString,toISOString";
}
if (!test())
throw new Error("Test failed");