swc_ecma_compat_es2015Function instance_of
source pub fn instance_of() -> impl Pass
Expand description
@babel/plugin-transform-instanceof
§Example
§Out
function _instanceof(left, right) {
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
return !!right[Symbol.hasInstance](left);
} else {
return left instanceof right;
}
}
_instanceof(foo, Bar);