mirror of
https://github.com/zebrajr/node.git
synced 2025-12-07 00:20:38 +01:00
Adds an option (NODE_COMPILE_CACHE_PORTABLE) for the built-in compile cache to encode the hashes with relative file paths. On enabling the option, the source directory along with cache directory can be bundled and moved, and the cache continues to work. When enabled, paths encoded in hash are relative to compile cache directory. PR-URL: https://github.com/nodejs/node/pull/58797 Fixes: https://github.com/nodejs/node/issues/58755 Refs: https://github.com/nodejs/node/issues/52696 Reviewed-By: Joyee Cheung <joyeec9h3@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
12 lines
363 B
JavaScript
12 lines
363 B
JavaScript
'use strict';
|
|
|
|
// This tests module.enableCompileCache() throws when an invalid argument is passed.
|
|
|
|
require('../common');
|
|
const { enableCompileCache } = require('module');
|
|
const assert = require('assert');
|
|
|
|
for (const invalid of [0, null, false, 1, NaN, true, Symbol(0)]) {
|
|
assert.throws(() => enableCompileCache(invalid), { code: 'ERR_INVALID_ARG_TYPE' });
|
|
}
|