Files: 65191f9a9664f013ebe726bb95a1a54b086e1bd5 / test / test-79-npm / v8flags / v8flags@2.1.1.js
669 bytesRaw
1 | /* eslint-disable no-underscore-dangle */ |
2 | |
3 | 'use strict'; |
4 | |
5 | var cp = require('child_process'); |
6 | |
7 | require('module')._extensions['.json'] = function () { |
8 | throw new Error('prevent loading json cache'); |
9 | }; |
10 | |
11 | var execFileCalled = false; |
12 | var execFileSave = cp.execFile; |
13 | |
14 | cp.execFile = function () { |
15 | execFileCalled = true; |
16 | execFileSave.apply(cp, arguments); // eslint-disable-line prefer-rest-params |
17 | }; |
18 | |
19 | setTimeout(function () { |
20 | var v8flags = require('v8flags'); |
21 | v8flags(function (error, results) { |
22 | if (error) return; |
23 | if (!Array.isArray(results)) return; |
24 | if (results.length < 6) return; |
25 | if (!execFileCalled) return; |
26 | console.log('ok'); |
27 | }); |
28 | }, 500); |
29 |
Built with git-ssb-web