Escape __dirname before generating regexp

This commit is contained in:
Matteo Collina 2018-10-19 15:22:14 +02:00
parent 04d119a7be
commit 9727c01f84
2 changed files with 3 additions and 1 deletions

View File

@ -4,8 +4,9 @@ const { spawnSync } = require('child_process')
const { join } = require('path')
const debug = require('debug')('0x: ticks-to-tree')
const assert = require('assert')
const escape = require('escape-string-regexp')
const preloadDirRx = RegExp(join(__dirname, 'preload'))
const preloadDirRx = RegExp(join(escape(__dirname), 'preload'))
const internalModuleRegExp = /^.?(?:\(anonymous\)|internalBinding|NativeModule[^ ]*) [^/\\][a-zA-Z0-9_/\\-]+\.js:\d+:\d+$/
const nodeBootstrapRegExp = / internal\/bootstrap.+\.js:\d+:\d+$/

View File

@ -32,6 +32,7 @@
"debug": "^4.0.1",
"end-of-stream": "^1.1.0",
"env-string": "^1.0.0",
"escape-string-regexp": "^1.0.5",
"execspawn": "^1.0.1",
"has-unicode": "^2.0.1",
"hsl-to-rgb-for-reals": "^1.1.0",