mirror of
https://github.com/nodejs/node.git
synced 2024-11-30 23:43:09 +01:00
a4f4909f3d
PR-URL: https://github.com/nodejs/io.js/pull/2013 Reviewed-By: Rod Vagg <rod@vagg.org> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
24 lines
639 B
JavaScript
24 lines
639 B
JavaScript
'use strict';
|
|
const common = require('../common');
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
// make a path that is more than 260 chars long.
|
|
const dirNameLen = Math.max(260 - common.tmpDir.length, 1);
|
|
const dirName = path.join(common.tmpDir, 'x'.repeat(dirNameLen));
|
|
const fullDirPath = path.resolve(dirName);
|
|
|
|
const indexFile = path.join(fullDirPath, 'index.js');
|
|
const otherFile = path.join(fullDirPath, 'other.js');
|
|
|
|
common.refreshTmpDir();
|
|
|
|
fs.mkdirSync(fullDirPath);
|
|
fs.writeFileSync(indexFile, 'require("./other");');
|
|
fs.writeFileSync(otherFile, '');
|
|
|
|
require(indexFile);
|
|
require(otherFile);
|
|
|
|
common.refreshTmpDir();
|