mirror of
https://github.com/nodejs/node.git
synced 2025-05-17 12:42:09 +00:00

The custom linting rule for argument alignment in multi-line function calls previously ignored template strings in an effort to avoid false positives. This isn't really necessary. Enforce for template strings and adjust whitespace in three tests to abide. (Insert "The test abides" joke of your choosing here.) PR-URL: https://github.com/nodejs/node/pull/6720 Reviewed-By: Roman Reiss <me@silverwind.io> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
61 lines
1.9 KiB
JavaScript
61 lines
1.9 KiB
JavaScript
'use strict';
|
|
var fs = require('fs');
|
|
var assert = require('assert');
|
|
var cp = require('child_process');
|
|
var common = require('../common');
|
|
|
|
// TODO(mhdawson) Currently the test-tick-processor functionality in V8
|
|
// depends on addresses being smaller than a full 64 bits. Aix supports
|
|
// the full 64 bits and the result is that it does not process the
|
|
// addresses correctly and runs out of memory
|
|
// Disabling until we get a fix upstreamed into V8
|
|
if (common.isAix) {
|
|
common.skip('Aix address range too big for scripts.');
|
|
return;
|
|
}
|
|
|
|
common.refreshTmpDir();
|
|
process.chdir(common.tmpDir);
|
|
// Unknown checked for to prevent flakiness, if pattern is not found,
|
|
// then a large number of unknown ticks should be present
|
|
runTest(/LazyCompile.*\[eval\]:1|.*% UNKNOWN/,
|
|
`function f() {
|
|
for (var i = 0; i < 1000000; i++) {
|
|
i++;
|
|
}
|
|
setImmediate(function() { f(); });
|
|
};
|
|
setTimeout(function() { process.exit(0); }, 2000);
|
|
f();`);
|
|
if (common.isWindows ||
|
|
common.isSunOS ||
|
|
common.isAix ||
|
|
common.isLinuxPPCBE ||
|
|
common.isFreeBSD) {
|
|
common.skip('C++ symbols are not mapped for this os.');
|
|
return;
|
|
}
|
|
runTest(/RunInDebugContext/,
|
|
`function f() {
|
|
require(\'vm\').runInDebugContext(\'Debug\');
|
|
setImmediate(function() { f(); });
|
|
};
|
|
setTimeout(function() { process.exit(0); }, 2000);
|
|
f();`);
|
|
|
|
function runTest(pattern, code) {
|
|
cp.execFileSync(process.execPath, ['-prof', '-pe', code]);
|
|
var matches = fs.readdirSync(common.tmpDir).filter(function(file) {
|
|
return /^isolate-/.test(file);
|
|
});
|
|
if (matches.length != 1) {
|
|
assert.fail(null, null, 'There should be a single log file.');
|
|
}
|
|
var log = matches[0];
|
|
var out = cp.execSync(process.execPath +
|
|
' --prof-process --call-graph-size=10 ' + log,
|
|
{encoding: 'utf8'});
|
|
assert(pattern.test(out));
|
|
fs.unlinkSync(log);
|
|
}
|