Last change
on this file since bdd6491 was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
595 bytes
|
Rev | Line | |
---|
[6a3a178] | 1 | var global = require('../internals/global');
|
---|
| 2 | var userAgent = require('../internals/engine-user-agent');
|
---|
| 3 |
|
---|
| 4 | var process = global.process;
|
---|
| 5 | var Deno = global.Deno;
|
---|
| 6 | var versions = process && process.versions || Deno && Deno.version;
|
---|
| 7 | var v8 = versions && versions.v8;
|
---|
| 8 | var match, version;
|
---|
| 9 |
|
---|
| 10 | if (v8) {
|
---|
| 11 | match = v8.split('.');
|
---|
| 12 | version = match[0] < 4 ? 1 : match[0] + match[1];
|
---|
| 13 | } else if (userAgent) {
|
---|
| 14 | match = userAgent.match(/Edge\/(\d+)/);
|
---|
| 15 | if (!match || match[1] >= 74) {
|
---|
| 16 | match = userAgent.match(/Chrome\/(\d+)/);
|
---|
| 17 | if (match) version = match[1];
|
---|
| 18 | }
|
---|
| 19 | }
|
---|
| 20 |
|
---|
| 21 | module.exports = version && +version;
|
---|
Note:
See
TracBrowser
for help on using the repository browser.