test262/implementation-contributed/javascriptcore/es6/well-known_symbols_Symbol.t...

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");