try {
fs.writeFileSync(this._blobFilename, blobToStore);
fs.writeFileSync(this._mapFilename, mapToStore);
- } catch (error) {
- throw error;
} finally {
fs.unlinkSync(this._lockFilename);
}
'\x00': 'z0',
'z': 'zZ',
};
- return str.replace(/[\\:\/\x00z]/g, match => (ESCAPE_LOOKUP[match]));
+ const ESCAPE_REGEX = /[\\:/\x00z]/g; // eslint-disable-line no-control-regex
+ return str.replace(ESCAPE_REGEX, match => ESCAPE_LOOKUP[match]);
}
function supportsCachedData() {
}
function getCacheDir() {
+ const v8_compile_cache_cache_dir = process.env.V8_COMPILE_CACHE_CACHE_DIR;
+ if (v8_compile_cache_cache_dir) {
+ return v8_compile_cache_cache_dir;
+ }
+
// Avoid cache ownership issues on POSIX systems.
const dirname = typeof process.getuid === 'function'
? 'v8-compile-cache-' + process.getuid()
nativeCompileCache.setCacheStore(blobStore);
nativeCompileCache.install();
- process.once('exit', code => {
+ process.once('exit', () => {
if (blobStore.isDirty()) {
blobStore.save();
}