I notice that you use instanceofa few times in your strong typing code.
Unfortunately, instanceof will not work correctly when dealing with multiple frames in a window. The MDN docs take note of this. There are those who consider instanceofto be ultimately worthless for that reason.
From what I've read on the subject Object.prototype.toString() is the current best replacement for instanceof.
I notice that you use
instanceof
a few times in your strong typing code.Unfortunately,
instanceof
will not work correctly when dealing with multiple frames in a window. The MDN docs take note of this. There are those who considerinstanceof
to be ultimately worthless for that reason.From what I've read on the subject
Object.prototype.toString()
is the current best replacement forinstanceof
.For example, validator.js uses it.