fix typescript
authorYadd <yadd@debian.org>
Fri, 12 Apr 2024 10:05:59 +0000 (12:05 +0200)
committerJérémy Lal <kapouer@melix.org>
Fri, 12 Apr 2024 10:05:59 +0000 (12:05 +0200)
Forwarded: no
Last-Update: 2024-04-05

Gbp-Pq: Name fix-typescript.patch

llhttp/bin/build_wasm.ts
llparse/src/implementation/c/code/base.ts
llparse/src/implementation/c/node/base.ts
llparse/src/implementation/c/node/error.ts

index d6183b58501cd4d183612aa7ea60da66c61f6888..f8be3d2b2f5767ea19fcad70c4dcbe80494d0c90 100644 (file)
@@ -40,6 +40,7 @@ if (process.argv[2] === '--docker') {
   // It will work flawessly if uid === gid === 1000
   // there will be some warnings otherwise.
   if (process.platform === 'linux') {
+// @ts-ignore
     cmd += ` --user ${process.getuid!()}:${process.getegid!()}`;
   }
   cmd += ` --mount type=bind,source=${WASM_SRC}/build,target=/home/node/llhttp/build llhttp_wasm_builder npm run wasm`;
index 888330df3c21dac038d96f1241f2786c0cf5a788..cb8cf24fe94bd7da63a0ca599d7f10067863ea08 100644 (file)
@@ -3,7 +3,7 @@ import * as frontend from 'llparse-frontend';
 import { Compilation } from '../compilation';
 
 export abstract class Code<T extends frontend.code.Code> {
-  protected cachedDecl: string | undefined;
+  public cachedDecl: string | undefined;
 
   constructor(public readonly ref: T) {
   }
index 51f90bbef52592e997163afeb2ea56daaccca62b..83992e71b9ace8818b7bc2700d7702ab38ce99ac 100644 (file)
@@ -13,8 +13,8 @@ export interface INodeEdge {
 }
 
 export abstract class Node<T extends frontend.node.Node> {
-  protected cachedDecl: string | undefined;
-  protected privCompilation: Compilation | undefined;
+  public cachedDecl: string | undefined;
+  public privCompilation: Compilation | undefined;
 
   constructor(public readonly ref: T) {
   }
@@ -39,12 +39,12 @@ export abstract class Node<T extends frontend.node.Node> {
     return res;
   }
 
-  protected get compilation(): Compilation {
+  public get compilation(): Compilation {
     assert(this.privCompilation !== undefined);
     return this.privCompilation!;
   }
 
-  protected prologue(out: string[]): void {
+  public prologue(out: string[]): void {
     const ctx = this.compilation;
 
     out.push(`if (${ctx.posArg()} == ${ctx.endPosArg()}) {`);
@@ -56,11 +56,11 @@ export abstract class Node<T extends frontend.node.Node> {
     out.push('}');
   }
 
-  protected pause(out: string[]): void {
+  public pause(out: string[]): void {
     out.push(`return ${this.cachedDecl};`);
   }
 
-  protected tailTo(out: string[], edge: INodeEdge): void {
+  public tailTo(out: string[], edge: INodeEdge): void {
     const ctx = this.compilation;
     const target = ctx.unwrapNode(edge.node).build(ctx);
 
index 29dce6305e051399d00a1cd70b7d41baac37fa62..8055081a1737317a389a51c9e4d35a4fee4d4d28 100644 (file)
@@ -5,7 +5,7 @@ import { STATE_ERROR } from '../constants';
 import { Node } from './base';
 
 class ErrorNode<T extends frontend.node.Error> extends Node<T> {
-  protected storeError(out: string[]): void {
+  public storeError(out: string[]): void {
     const ctx = this.compilation;
 
     let hexCode: string;