Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

environment-v8-version.js 886B

12345678910111213141516171819202122232425262728
  1. 'use strict';
  2. var globalThis = require('../internals/global-this');
  3. var userAgent = require('../internals/environment-user-agent');
  4. var process = globalThis.process;
  5. var Deno = globalThis.Deno;
  6. var versions = process && process.versions || Deno && Deno.version;
  7. var v8 = versions && versions.v8;
  8. var match, version;
  9. if (v8) {
  10. match = v8.split('.');
  11. // in old Chrome, versions of V8 isn't V8 = Chrome / 10
  12. // but their correct versions are not interesting for us
  13. version = match[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1]);
  14. }
  15. // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
  16. // so check `userAgent` even if `.v8` exists, but 0
  17. if (!version && userAgent) {
  18. match = userAgent.match(/Edge\/(\d+)/);
  19. if (!match || match[1] >= 74) {
  20. match = userAgent.match(/Chrome\/(\d+)/);
  21. if (match) version = +match[1];
  22. }
  23. }
  24. module.exports = version;