Home | History | Annotate | Download | only in es6

Lines Matching refs:hasInstance

5 // Make sure it's an error if @@hasInstance isn't a function.
8 F[Symbol.hasInstance] = null;
15 F[Symbol.hasInstance] = function() { return undefined; };
17 F[Symbol.hasInstance] = function() { return null; };
19 F[Symbol.hasInstance] = function() { return true; };
23 // Make sure if @@hasInstance throws, we catch it.
26 F[Symbol.hasInstance] = function() { throw new Error("always throws"); }
34 // @@hasInstance works for bound functions.
39 assertEquals(bound[Symbol.hasInstance](bc), true);
40 assertEquals(bound[Symbol.hasInstance]([]), false);
44 assertEquals(Function.prototype[Symbol.hasInstance].call(Array, []), true);
45 assertEquals(Function.prototype[Symbol.hasInstance].call({}, {}), false);
48 assertEquals(Function.prototype[Symbol.hasInstance].call(Array, 0), false);
50 // Cannot assign to @@hasInstance with %FunctionPrototype%.
54 assertThrows(function() { F[Symbol.hasInstance] = (v) => v }, TypeError);
57 // Check correct invocation of @@hasInstance handler on function instance.
63 F[Symbol.hasInstance] = function(v) { ++counter; return true };