> Le 24 août 2016 à 03:35, /#!/JoePea <[email protected]> a écrit :
> 
> > if you want to revert to the default behavior set the value of B or C’s 
> > [Symbol.hasInstance] own property to undefined.
> 
> That just causes errors. In my environment (Babel),
> 
> ```js
> Object.defineProperty(SomeClass, Symbol.hasInstance, {
>     value: undefined
> })
> 
>  // ...
> 
> someClass instanceof SomeClass // error
> ```
> 
> results in 
> 
> ```js
> Uncaught TypeError: Cannot read property 'call' of undefined
> ```
> 

If that’s the case, it's a bug (or limitation?) of Babel, as the spec is clear, 
see: https://tc39.github.io/ecma262/#sec-instanceofoperator

Also, reading the message of your TypeError, I wonder if Babel may also fail 
unexpectedly in case SomeClass does not inherit the standard `Function#call`, 
as in: ```class SomeClass { static call() { throw "Pwnd!" } }```.

—Claude
_______________________________________________
es-discuss mailing list
[email protected]
https://mail.mozilla.org/listinfo/es-discuss

Reply via email to