Skip to content
This repository has been archived by the owner on Sep 14, 2021. It is now read-only.

Commit

Permalink
Require ES5 compilation for Edge < 40.
Browse files Browse the repository at this point in the history
Fixes #161. Versions before 40 have a JIT bug where a constructor can
return the class instead of an instance.

See chakra-core/ChakraCore#2532 and
chakra-core/ChakraCore#2532.

Tested with http://jsfiddle.net/0k59gbL8/5/. Fails on 38, passes on 40.
  • Loading branch information
aomarks committed Apr 11, 2017
1 parent 1814569 commit cf199ac
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/compile-middleware.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ function needCompilation(uaParser: UAParser): boolean {
const supportsES2015 = (browser.name === 'Chrome' && majorVersion >= 49) ||
(browser.name === 'Chromium' && majorVersion >= 49) ||
(browser.name === 'Safari' && majorVersion >= 10) ||
(browser.name === 'Edge' && majorVersion >= 14) ||
(browser.name === 'Edge' && majorVersion >= 40) ||
(browser.name === 'Firefox' && majorVersion >= 51);
return !supportsES2015;
}

0 comments on commit cf199ac

Please sign in to comment.