mirror of https://github.com/tc39/test262.git
20 lines
434 B
JavaScript
20 lines
434 B
JavaScript
// Reviewed
|
|
function test() {
|
|
|
|
var a = {}, b = {}, c = {};
|
|
var passed = 0;
|
|
a[Symbol.toPrimitive] = function(hint) { passed += hint === "number"; return 0; };
|
|
b[Symbol.toPrimitive] = function(hint) { passed += hint === "string"; return 0; };
|
|
c[Symbol.toPrimitive] = function(hint) { passed += hint === "default"; return 0; };
|
|
|
|
a >= 0;
|
|
b in {};
|
|
c == 0;
|
|
return passed === 3;
|
|
|
|
}
|
|
|
|
if (!test())
|
|
throw new Error("Test failed");
|
|
|