Skip to content

Commit 9338759

Browse files
aduh95targos
authored andcommitted
lib: remove v8_prof_polyfill from eslint ignore list
PR-URL: #36537 Reviewed-By: Rich Trott <rtrott@gmail.com> Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com>
1 parent dcd221c commit 9338759

2 files changed

Lines changed: 16 additions & 15 deletions

File tree

‎.eslintignore‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
node_modules
2-
lib/internal/v8_prof_polyfill.js
32
lib/punycode.js
43
test/addons/??_*
54
test/fixtures

‎lib/internal/v8_prof_polyfill.js‎

Lines changed: 16 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,10 @@
2525
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
2626
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2727

28-
/* eslint-disable no-restricted-globals */
28+
'use strict';
29+
30+
/* eslint-disable node-core/prefer-primordials */
31+
/* global Buffer, console */
2932

3033
module.exports={ versionCheck };
3134

@@ -37,7 +40,7 @@ if (module.id === 'internal/v8_prof_polyfill') return;
3740
// Node polyfill
3841
constfs=require('fs');
3942
constcp=require('child_process');
40-
constos={
43+
constos={// eslint-disable-line no-unused-vars
4144
system: function(name,args){
4245
if(process.platform==='linux'&&name==='nm'){
4346
// Filter out vdso and vsyscall entries.
@@ -51,28 +54,29 @@ const os = {
5154
letout=cp.spawnSync(name,args).stdout.toString();
5255
// Auto c++filt names, but not [iItT]
5356
if(process.platform==='darwin'&&name==='nm'){
54-
// nm prints an error along the lines of "Run xcodebuild -license" and
57+
// `nm` prints an error along the lines of "Run xcodebuild -license" and
5558
// exits when Xcode hasn't been properly installed or when its license
5659
// hasn't been accepted yet. Basically any mention of xcodebuild in
5760
// the output means the nm command is non-functional.
5861
constmatch=out.match(/(?:^|\n)([^\n]*xcodebuild[^\n]*)(?:\n|$)/);
62+
// eslint-disable-next-line no-restricted-syntax
5963
if(match)thrownewError(match[1]);
6064
out=macCppfiltNm(out);
6165
}
6266
returnout;
6367
}
6468
};
65-
constprint=console.log;
66-
functionread(fileName){
69+
constprint=console.log;// eslint-disable-line no-unused-vars
70+
functionread(fileName){// eslint-disable-line no-unused-vars
6771
returnfs.readFileSync(fileName,'utf8');
6872
}
69-
constquit=process.exit;
73+
constquit=process.exit;// eslint-disable-line no-unused-vars
7074

7175
// Polyfill "readline()".
72-
constlogFile=arguments[arguments.length-1];
76+
constlogFile=arguments[arguments.length-1];// eslint-disable-line no-undef
7377
try{
7478
fs.accessSync(logFile);
75-
}catch(e){
79+
}catch{
7680
console.error('Please provide a valid isolate file as the final argument.');
7781
process.exit(1);
7882
}
@@ -121,8 +125,8 @@ function versionCheck(firstLine, expected) {
121125
// whereas process.versions.v8 is either "$major.$minor.$build-$embedder" or
122126
// "$major.$minor.$build.$patch-$embedder".
123127
firstLine=firstLine.split(',');
124-
constcurVer=expected.split(/[.\-]/);
125-
if(firstLine.length!==6&&firstLine.length!==7||
128+
constcurVer=expected.split(/[.-]/);
129+
if((firstLine.length!==6&&firstLine.length!==7)||
126130
firstLine[0]!=='v8-version'){
127131
return'Unable to read v8-version from log file.';
128132
}
@@ -140,13 +144,11 @@ function macCppfiltNm(out) {
140144
if(entries===null)
141145
returnout;
142146

143-
entries=entries.map((entry)=>{
144-
returnentry.replace(CLEAN_RE,'')
145-
});
147+
entries=entries.map((entry)=>entry.replace(CLEAN_RE,''));
146148

147149
letfiltered;
148150
try{
149-
filtered=cp.spawnSync('c++filt',['-p','-i'],{
151+
filtered=cp.spawnSync('c++filt',['-p','-i'],{
150152
input: entries.join('\n')
151153
}).stdout.toString();
152154
}catch{

0 commit comments

Comments
 (0)