mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
lib: remove v8_prof_polyfill from eslint ignore list
PR-URL: https://github.com/nodejs/node/pull/36537 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
This commit is contained in:
parent
dcd221ce69
commit
9338759b01
|
|
@ -1,5 +1,4 @@
|
||||||
node_modules
|
node_modules
|
||||||
lib/internal/v8_prof_polyfill.js
|
|
||||||
lib/punycode.js
|
lib/punycode.js
|
||||||
test/addons/??_*
|
test/addons/??_*
|
||||||
test/fixtures
|
test/fixtures
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,10 @@
|
||||||
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
||||||
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||||
|
|
||||||
/* eslint-disable no-restricted-globals */
|
'use strict';
|
||||||
|
|
||||||
|
/* eslint-disable node-core/prefer-primordials */
|
||||||
|
/* global Buffer, console */
|
||||||
|
|
||||||
module.exports = { versionCheck };
|
module.exports = { versionCheck };
|
||||||
|
|
||||||
|
|
@ -37,7 +40,7 @@ if (module.id === 'internal/v8_prof_polyfill') return;
|
||||||
// Node polyfill
|
// Node polyfill
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const cp = require('child_process');
|
const cp = require('child_process');
|
||||||
const os = {
|
const os = { // eslint-disable-line no-unused-vars
|
||||||
system: function(name, args) {
|
system: function(name, args) {
|
||||||
if (process.platform === 'linux' && name === 'nm') {
|
if (process.platform === 'linux' && name === 'nm') {
|
||||||
// Filter out vdso and vsyscall entries.
|
// Filter out vdso and vsyscall entries.
|
||||||
|
|
@ -51,28 +54,29 @@ const os = {
|
||||||
let out = cp.spawnSync(name, args).stdout.toString();
|
let out = cp.spawnSync(name, args).stdout.toString();
|
||||||
// Auto c++filt names, but not [iItT]
|
// Auto c++filt names, but not [iItT]
|
||||||
if (process.platform === 'darwin' && name === 'nm') {
|
if (process.platform === 'darwin' && name === 'nm') {
|
||||||
// nm prints an error along the lines of "Run xcodebuild -license" and
|
// `nm` prints an error along the lines of "Run xcodebuild -license" and
|
||||||
// exits when Xcode hasn't been properly installed or when its license
|
// exits when Xcode hasn't been properly installed or when its license
|
||||||
// hasn't been accepted yet. Basically any mention of xcodebuild in
|
// hasn't been accepted yet. Basically any mention of xcodebuild in
|
||||||
// the output means the nm command is non-functional.
|
// the output means the nm command is non-functional.
|
||||||
const match = out.match(/(?:^|\n)([^\n]*xcodebuild[^\n]*)(?:\n|$)/);
|
const match = out.match(/(?:^|\n)([^\n]*xcodebuild[^\n]*)(?:\n|$)/);
|
||||||
|
// eslint-disable-next-line no-restricted-syntax
|
||||||
if (match) throw new Error(match[1]);
|
if (match) throw new Error(match[1]);
|
||||||
out = macCppfiltNm(out);
|
out = macCppfiltNm(out);
|
||||||
}
|
}
|
||||||
return out;
|
return out;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
const print = console.log;
|
const print = console.log; // eslint-disable-line no-unused-vars
|
||||||
function read(fileName) {
|
function read(fileName) { // eslint-disable-line no-unused-vars
|
||||||
return fs.readFileSync(fileName, 'utf8');
|
return fs.readFileSync(fileName, 'utf8');
|
||||||
}
|
}
|
||||||
const quit = process.exit;
|
const quit = process.exit; // eslint-disable-line no-unused-vars
|
||||||
|
|
||||||
// Polyfill "readline()".
|
// Polyfill "readline()".
|
||||||
const logFile = arguments[arguments.length - 1];
|
const logFile = arguments[arguments.length - 1]; // eslint-disable-line no-undef
|
||||||
try {
|
try {
|
||||||
fs.accessSync(logFile);
|
fs.accessSync(logFile);
|
||||||
} catch(e) {
|
} catch {
|
||||||
console.error('Please provide a valid isolate file as the final argument.');
|
console.error('Please provide a valid isolate file as the final argument.');
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
|
@ -121,8 +125,8 @@ function versionCheck(firstLine, expected) {
|
||||||
// whereas process.versions.v8 is either "$major.$minor.$build-$embedder" or
|
// whereas process.versions.v8 is either "$major.$minor.$build-$embedder" or
|
||||||
// "$major.$minor.$build.$patch-$embedder".
|
// "$major.$minor.$build.$patch-$embedder".
|
||||||
firstLine = firstLine.split(',');
|
firstLine = firstLine.split(',');
|
||||||
const curVer = expected.split(/[.\-]/);
|
const curVer = expected.split(/[.-]/);
|
||||||
if (firstLine.length !== 6 && firstLine.length !== 7 ||
|
if ((firstLine.length !== 6 && firstLine.length !== 7) ||
|
||||||
firstLine[0] !== 'v8-version') {
|
firstLine[0] !== 'v8-version') {
|
||||||
return 'Unable to read v8-version from log file.';
|
return 'Unable to read v8-version from log file.';
|
||||||
}
|
}
|
||||||
|
|
@ -140,9 +144,7 @@ function macCppfiltNm(out) {
|
||||||
if (entries === null)
|
if (entries === null)
|
||||||
return out;
|
return out;
|
||||||
|
|
||||||
entries = entries.map((entry) => {
|
entries = entries.map((entry) => entry.replace(CLEAN_RE, ''));
|
||||||
return entry.replace(CLEAN_RE, '')
|
|
||||||
});
|
|
||||||
|
|
||||||
let filtered;
|
let filtered;
|
||||||
try {
|
try {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user