Skip to content
This repository was archived by the owner on Aug 25, 2025. It is now read-only.

Commit 3112cd5

Browse files
committed
Allow strict-mode executables
1 parent d6e8ac4 commit 3112cd5

File tree

1 file changed

+0
-10
lines changed

1 file changed

+0
-10
lines changed

src/CodegenFile.hack

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -301,19 +301,11 @@ final class CodegenFile {
301301
return $this->setPseudoMainFooter(\vsprintf($format, $args));
302302
}
303303

304-
private function assertNotHackStrictForExecutable(): void {
305-
invariant(
306-
$this->fileType !== CodegenFileType::HACK_STRICT,
307-
"Hack Strict can't be used for executables",
308-
);
309-
}
310-
311304
public function render(): string {
312305
$builder = new HackBuilder($this->config);
313306

314307
$shebang = $this->shebang;
315308
if ($shebang !== null) {
316-
$this->assertNotHackStrictForExecutable();
317309
$builder->addLine($shebang);
318310
}
319311

@@ -417,7 +409,6 @@ final class CodegenFile {
417409

418410
$header = $this->pseudoMainHeader;
419411
if ($header !== null) {
420-
$this->assertNotHackStrictForExecutable();
421412
$builder->ensureNewLine()->add($header)->ensureNewLine();
422413
}
423414

@@ -453,7 +444,6 @@ final class CodegenFile {
453444

454445
$footer = $this->pseudoMainFooter;
455446
if ($footer !== null) {
456-
$this->assertNotHackStrictForExecutable();
457447
$builder->ensureEmptyLine()->add($footer)->ensureNewLine();
458448
}
459449
return $builder->getCode();

0 commit comments

Comments
 (0)