From 69972820c809453061d46831bbdfd7de81772789 Mon Sep 17 00:00:00 2001 From: Denis Demchenko Date: Fri, 12 Apr 2019 21:04:58 +0300 Subject: [PATCH] Fix the bug with unset alias for a browser fix #313 --- src/parser.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/parser.js b/src/parser.js index 88706a8..f7ec7e9 100644 --- a/src/parser.js +++ b/src/parser.js @@ -402,12 +402,13 @@ class Parser { return undefined; } - isBrowser(browserName, loosely = false) { + isBrowser(browserName, includingAlias = false) { const defaultBrowserName = this.getBrowserName(); const possibleNames = [defaultBrowserName.toLowerCase()]; + const alias = Utils.getBrowserAlias(defaultBrowserName); - if (loosely) { - possibleNames.push(Utils.getBrowserAlias(defaultBrowserName).toLowerCase()); + if (includingAlias && typeof alias !== 'undefined') { + possibleNames.push(alias.toLowerCase()); } return possibleNames.indexOf(browserName.toLowerCase()) !== -1;