-
-
Save devsnek/dd77b256d50a80570541dd4ab74bfc27 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Is(constructor, value) { | |
if (constructor == null || value == null) { | |
return false; | |
} | |
let C = value.[[Constructor]]; | |
if (C === undefined) { | |
return false; | |
} | |
do { | |
if (C === constructor) { | |
return true; | |
} | |
if (C.[[ConstructorKind]] !== 'derived') { | |
return false; | |
} | |
C = C.[[ConstructorParent]]; | |
} while (C); | |
return false; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment