use instanceof operator for class comparison

This commit is contained in:
marija
2016-02-05 16:56:19 +01:00
parent 52198e2a7a
commit 3d23cce4b1

View File

@@ -55,7 +55,7 @@ var Parser = function Parser(context, imports, fileInfo) {
function expect(arg, msg, index) {
// some older browsers return typeof 'function' for RegExp
var result = (Object.prototype.toString.call(arg) === '[object Function]') ? arg.call(parsers) : parserInput.$re(arg);
var result = (arg instanceof Function || Object.prototype.toString.call(arg) === '[object Function]') ? arg.call(parsers) : parserInput.$re(arg);
if (result) {
return result;
}