is-what
is-what copied to clipboard
More edge-case tests
Example for things like isString()
:
-
Object.create(String.prototype)
-
new String()
-
new class extends String {}
-
new iframe.contentWindow.String()
-
{ [Symbol.toStringTag]: "String" }
-
new class String {}
-
new class String { [Symbol.toStringTag] = "String" }
-
new (iframe.contentWindow.eval("class String { [Symbol.toStringTag] = 'String' }"))()
@mesqueeb Thoughts on what each of these edge-cases should return?
this is literally all JavaScript i've never used in my life so I don't really know or care too much tbh XD
Whatever you think is best is probably OK. I have no strong feelings as I use pretty basic JavaScript syntax in my code. Readability ftw.