Skip to content
This repository has been archived by the owner on Dec 1, 2024. It is now read-only.

Commit

Permalink
run hhast-migrate --ref-to-inout
Browse files Browse the repository at this point in the history
  • Loading branch information
jjergus committed Sep 16, 2019
1 parent 2352c87 commit bb3446a
Show file tree
Hide file tree
Showing 7 changed files with 14 additions and 7 deletions.
2 changes: 1 addition & 1 deletion bin/hhast-inspect.hack
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function hhast_inspect_main_async(): Awaitable<noreturn> {
break;
}
$parts = \explode('/', $root);
\array_pop(&$parts);
\array_pop(inout $parts);
$root = \implode('/', $parts);
}

Expand Down
2 changes: 1 addition & 1 deletion bin/hhast-lint.hack
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function hhast_lint_main_async(): Awaitable<noreturn> {
break;
}
$parts = \explode('/', $root);
\array_pop(&$parts);
\array_pop(inout $parts);
$root = \implode('/', $parts);
}

Expand Down
2 changes: 1 addition & 1 deletion bin/hhast-migrate.hack
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ async function hhast_migrate_main_async(): Awaitable<noreturn> {
break;
}
$parts = \explode('/', $root);
\array_pop(&$parts);
\array_pop(inout $parts);
$root = \implode('/', $parts);
}

Expand Down
2 changes: 1 addition & 1 deletion src/Migrations/RefToInoutMigration.hack
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ final class RefToInoutMigration extends BaseMigration {

// special cases
'array_multisort' => $n ==>
C\count($n['args']) < 1 || C\count($n['args']) > 9
C\is_empty($n['args']) || C\count($n['args']) > 9
? $n['root']
: (
self::renameImpl($n, 'array_multisort'.C\count($n['args']))
Expand Down
2 changes: 1 addition & 1 deletion src/__Private/execute_async.hack
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ async function execute_async(string ...$args): Awaitable<vec<string>> {
$spec = [0 => ['pipe', 'r'], 1 => ['pipe', 'w'], 2 => ['pipe', 'w']];
$pipes = [];

$proc = \proc_open($command, $spec, &$pipes);
$proc = \proc_open($command, $spec, inout $pipes);
invariant($proc, "Failed to execute: %s", $command);

list($stdin, $stdout, $stderr) = $pipes;
Expand Down
9 changes: 8 additions & 1 deletion src/__Private/get_typechecker_errors.hack
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,14 @@ function get_typechecker_errors(string $path): vec<TTypecheckerError> {
\escapeshellarg($path),
];
$output = \tempnam(\sys_get_temp_dir(), 'hhast-temp');
\exec(Str\join($command, ' ').' >/dev/null 2>'.\escapeshellarg($output));

$_stdout = null;
$_exit_code = null;
\exec(
Str\join($command, ' ').' >/dev/null 2>'.\escapeshellarg($output),
inout $_stdout,
inout $_exit_code,
);
// Exit code is unstable, so not checking it

$lines = \file_get_contents($output);
Expand Down
2 changes: 1 addition & 1 deletion tests/TestLib/TemporaryProject.hack
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ final class TemporaryProject implements \IAsyncDisposable {
$this->hhServer = \proc_open(
'hh_server '.\escapeshellarg($path).' >/dev/null 2>/dev/null',
[],
&$pipes,
inout $pipes,
);
\file_put_contents($path.'/test.php', \file_get_contents($source_path));
}
Expand Down

0 comments on commit bb3446a

Please sign in to comment.