Bug Report
Current Behavior
When the object has specified a [Symbol.hasInstance] method, helpers.instanceof does not cast the return result to boolean
Input Code
- REPL or Repo link if applicable: The REPL can not load
@babel/[email protected] due to a 404 error.
var qux = {};
qux[Symbol.hasInstance]= function () { return NaN };
helpers.instanceof(0, qux);
// actual: returns NaN;
// expected: returns false;
Expected behavior/code
Per 12.10.4Runtime Semantics: InstanceofOperator ( V, target ), we should cast the return result to boolean.
Environment
- Babel version(s): 7.5.0
- Node/npm version: npm 5
- OS: macOS 10.14.5
- Monorepo: N.A.
- How you are using Babel: Reading the source code
Possible Solution
An PR is on the way.
Additional context/Screenshots
N.A.
Bug Report
Current Behavior
When the object has specified a
[Symbol.hasInstance]method,helpers.instanceofdoes not cast the return result to booleanInput Code
@babel/[email protected]due to a 404 error.Expected behavior/code
Per 12.10.4Runtime Semantics: InstanceofOperator ( V, target ), we should cast the return result to boolean.
Environment
Possible Solution
An PR is on the way.
Additional context/Screenshots
N.A.