| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
1 parent 24a35f9 commit bc07612
3 files changed
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -642,9 +642,11 @@ | |||
| 642 | 642 | for (const [ from, expansion ] of aliases) { | |
| 643 | 643 | let isAccepted = true; | |
| 644 | 644 | for (const to of expansion) { | |
| 645 | - if (!to.startsWith('-')) continue; | ||
| 645 | + if (!to.startsWith('-') || to === '--') continue; | ||
| 646 | 646 | const recursiveExpansion = aliases.get(to); | |
| 647 | 647 | if (recursiveExpansion) { | |
| 648 | + if (recursiveExpansion[0] === to) | ||
| 649 | + recursiveExpansion.splice(0, 1); | ||
| 648 | 650 | expansion.push(...recursiveExpansion); | |
| 649 | 651 | continue; | |
| 650 | 652 | } | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -108,6 +108,8 @@ EnvironmentOptionsParser::EnvironmentOptionsParser() { | |||
| 108 | 108 | AddOption("--prof-process", | |
| 109 | 109 | "process V8 profiler output generated using --prof", | |
| 110 | 110 | &EnvironmentOptions::prof_process); | |
| 111 | + // Options after --prof-process are passed through to the prof processor. | ||
| 112 | + AddAlias("--prof-process", { "--prof-process", "--" }); | ||
| 111 | 113 | AddOption("--redirect-warnings", | |
| 112 | 114 | "write warnings to file instead of stderr", | |
| 113 | 115 | &EnvironmentOptions::redirect_warnings, | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
@@ -0,0 +1,34 @@ | |||
| 1 | + 'use strict'; | ||
| 2 | + const common = require('../common'); | ||
| 3 | + const tmpdir = require('../common/tmpdir'); | ||
| 4 | + const fs = require('fs'); | ||
| 5 | + const assert = require('assert'); | ||
| 6 | + const { spawnSync } = require('child_process'); | ||
| 7 | + | ||
| 8 | + if (!common.isMainThread) | ||
| 9 | + common.skip('chdir not available in workers'); | ||
| 10 | + if (!common.enoughTestMem) | ||
| 11 | + common.skip('skipped due to memory requirements'); | ||
| 12 | + if (common.isAIX) | ||
| 13 | + common.skip('does not work on AIX'); | ||
| 14 | + | ||
| 15 | + tmpdir.refresh(); | ||
| 16 | + process.chdir(tmpdir.path); | ||
| 17 | + | ||
| 18 | + // Generate log file. | ||
| 19 | + spawnSync(process.execPath, [ '--prof', '-p', '42' ]); | ||
| 20 | + | ||
| 21 | + const logfile = fs.readdirSync('.').filter((name) => name.endsWith('.log'))[0]; | ||
| 22 | + assert(logfile); | ||
| 23 | + | ||
| 24 | + // Make sure that the --preprocess argument is passed through correctly, | ||
| 25 | + // as an example flag listed in deps/v8/tools/tickprocessor.js. | ||
| 26 | + // Any of the other flags there should work for this test too, if --preprocess | ||
| 27 | + // is ever removed. | ||
| 28 | + const { stdout } = spawnSync( | ||
| 29 | + process.execPath, | ||
| 30 | + [ '--prof-process', '--preprocess', logfile ], | ||
| 31 | + { encoding: 'utf8' }); | ||
| 32 | + | ||
| 33 | + // Make sure that the result is valid JSON. | ||
| 34 | + JSON.parse(stdout); | ||
| Back | FazBrowse Home | New Git URL |
0 commit comments