From 7ea79afc2f5bce5c11deaf117d0cb2fa014d68a9 Mon Sep 17 00:00:00 2001 From: Faisal Salman Date: Mon, 22 Oct 2012 16:04:23 +0700 Subject: [PATCH] Fix issue #2 --- package.json | 2 +- ua-parser.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package.json b/package.json index dd288de..31ab415 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "title": "UA-Parser.JS", "name": "ua-parser-js", - "version": "0.4.3", + "version": "0.4.4", "author": "Faisal Salman (http://faisalman.com)", "description": "Lightweight JavaScript-based user-agent string parser", "keywords": [ diff --git a/ua-parser.js b/ua-parser.js index 4cf9ad0..82e5a9d 100644 --- a/ua-parser.js +++ b/ua-parser.js @@ -1,4 +1,4 @@ -// UA-Parser.JS v0.4.3 +// UA-Parser.JS v0.4.4 // Lightweight JavaScript-based User-Agent string parser // https://github.com/faisalman/ua-parser-js // @@ -45,7 +45,7 @@ if (typeof props[k] === 'object' && props[k].length === 2) { result[props[k][0]] = props[k][1]; } else if (typeof props[k] === 'object' && props[k].length === 3) { - if (typeof props[k][1] === 'function') { + if (typeof props[k][1] === 'function' && !(props[k][1].exec && props[k][1].test)) { result[props[k][0]] = m ? props[k][1].call(this, m, props[k][2]) : undefined; } else { result[props[k][0]] = m ? m.replace(props[k][1], props[k][2]) : undefined;