Skip to content

Commit

Permalink
chore: run standard
Browse files Browse the repository at this point in the history
  • Loading branch information
MarshallOfSound committed Dec 5, 2022
1 parent bd0fd3d commit 0d722d1
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion lib/format.js
Expand Up @@ -126,7 +126,7 @@ function readCVRecord (buf, { rva, data_size: dataSize }) {
debug_file_id: debugIdFromGuidAndAge(guid, age)
}
} else {
return {cv_signature: cvSignature}
return { cv_signature: cvSignature }
}
}

Expand Down
16 changes: 8 additions & 8 deletions lib/minidump.js
Expand Up @@ -14,9 +14,9 @@ const commands = {
}

function execute (command, args, callback) {
var stdout = Buffer.alloc(0)
var stderr = Buffer.alloc(0)
var child = spawn(command, args)
let stdout = Buffer.alloc(0)
let stderr = Buffer.alloc(0)
const child = spawn(command, args)
child.stdout.on('data', function (chunk) {
stdout = Buffer.concat([stdout, chunk])
})
Expand All @@ -35,7 +35,7 @@ function execute (command, args, callback) {
})
}

var globalSymbolPaths = []
const globalSymbolPaths = []
module.exports.addSymbolPath = Array.prototype.push.bind(globalSymbolPaths)

module.exports.moduleList = function (minidump, callback) {
Expand Down Expand Up @@ -65,13 +65,13 @@ module.exports.walkStack = function (minidump, symbolPaths, callback, commandArg
symbolPaths = []
}

var stackwalk = commands.minidump_stackwalk
const stackwalk = commands.minidump_stackwalk
if (!stackwalk) {
callback(new Error('Unable to find "minidump_stackwalk"'))
return
}

var args = [minidump].concat(symbolPaths, globalSymbolPaths)
let args = [minidump].concat(symbolPaths, globalSymbolPaths)
args = commandArgs ? [...commandArgs].concat(args) : args
execute(stackwalk, args, callback)
}
Expand All @@ -81,14 +81,14 @@ module.exports.dump = function (minidump, callback, commandArgs) {
}

module.exports.dumpSymbol = function (binary, callback) {
var dumpsyms = commands.dump_syms
const dumpsyms = commands.dump_syms
if (!dumpsyms) {
callback(new Error('Unable to find "dump_syms"'))
return
}

// Search for binary.dSYM on OS X.
var dsymPath = binary + '.dSYM'
const dsymPath = binary + '.dSYM'
if (process.platform === 'darwin' && fs.existsSync(dsymPath)) {
binary = dsymPath
}
Expand Down
32 changes: 16 additions & 16 deletions test/minidump-test.js
@@ -1,13 +1,13 @@
var assert = require('assert')
var path = require('path')
const assert = require('assert')
const path = require('path')

var minidump = require('..')
var electronDownload = require('electron-download')
var extractZip = require('extract-zip')
var temp = require('temp').track()
const minidump = require('..')
const electronDownload = require('electron-download')
const extractZip = require('extract-zip')
const temp = require('temp').track()

var describe = global.describe
var it = global.it
const describe = global.describe
const it = global.it

describe('minidump', function () {
this.timeout(3 * 60 * 1000)
Expand All @@ -18,7 +18,7 @@ describe('minidump', function () {
downloadElectronSymbols('darwin', function (error, symbolsPath) {
if (error) return done(error)

var dumpPath = path.join(__dirname, 'fixtures', 'mac.dmp')
const dumpPath = path.join(__dirname, 'fixtures', 'mac.dmp')
minidump.walkStack(dumpPath, symbolsPath, function (error, report) {
if (error) return done(error)

Expand All @@ -38,7 +38,7 @@ describe('minidump', function () {
downloadElectronSymbols('win32', function (error, symbolsPath) {
if (error) return done(error)

var dumpPath = path.join(__dirname, 'fixtures', 'windows.dmp')
const dumpPath = path.join(__dirname, 'fixtures', 'windows.dmp')
minidump.walkStack(dumpPath, symbolsPath, function (error, report) {
if (error) return done(error)

Expand All @@ -58,7 +58,7 @@ describe('minidump', function () {
downloadElectronSymbols('linux', function (error, symbolsPath) {
if (error) return done(error)

var dumpPath = path.join(__dirname, 'fixtures', 'linux.dmp')
const dumpPath = path.join(__dirname, 'fixtures', 'linux.dmp')
minidump.walkStack(dumpPath, symbolsPath, function (error, report) {
if (error) return done(error)

Expand Down Expand Up @@ -140,7 +140,7 @@ describe('minidump', function () {
})
})

var downloadElectron = function (callback) {
function downloadElectron (callback) {
electronDownload({
version: '1.4.3',
arch: 'x64',
Expand All @@ -149,7 +149,7 @@ var downloadElectron = function (callback) {
}, function (error, zipPath) {
if (error) return callback(error)

var electronPath = temp.mkdirSync('node-minidump-')
const electronPath = temp.mkdirSync('node-minidump-')
extractZip(zipPath, { dir: electronPath }, function (error) {
if (error) return callback(error)

Expand All @@ -162,17 +162,17 @@ var downloadElectron = function (callback) {
})
}

var downloadElectronSymbols = function (platform, callback) {
function downloadElectronSymbols (platform, callback) {
electronDownload({
version: '1.4.3', // Dumps were generated with Electron 1.4.3 x64
arch: 'x64',
platform: platform,
platform,
symbols: true,
quiet: true
}, function (error, zipPath) {
if (error) return callback(error)

var symbolsPath = temp.mkdirSync('node-minidump-')
const symbolsPath = temp.mkdirSync('node-minidump-')
extractZip(zipPath, { dir: symbolsPath }, function (error) {
if (error) return callback(error)
callback(null, path.join(symbolsPath, 'electron.breakpad.syms'))
Expand Down

0 comments on commit 0d722d1

Please sign in to comment.