From 53d2ef172c6c59f89ecbd43f7ab674c1ca3fac64 Mon Sep 17 00:00:00 2001 From: Yadd Date: Fri, 12 Apr 2024 12:05:59 +0200 Subject: [PATCH] fix typescript Forwarded: no Last-Update: 2024-04-05 Gbp-Pq: Name fix-typescript.patch --- llhttp/bin/build_wasm.ts | 1 + llparse/src/implementation/c/code/base.ts | 2 +- llparse/src/implementation/c/node/base.ts | 12 ++++++------ llparse/src/implementation/c/node/error.ts | 2 +- 4 files changed, 9 insertions(+), 8 deletions(-) diff --git a/llhttp/bin/build_wasm.ts b/llhttp/bin/build_wasm.ts index d6183b5..f8be3d2 100644 --- a/llhttp/bin/build_wasm.ts +++ b/llhttp/bin/build_wasm.ts @@ -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`; diff --git a/llparse/src/implementation/c/code/base.ts b/llparse/src/implementation/c/code/base.ts index 888330d..cb8cf24 100644 --- a/llparse/src/implementation/c/code/base.ts +++ b/llparse/src/implementation/c/code/base.ts @@ -3,7 +3,7 @@ import * as frontend from 'llparse-frontend'; import { Compilation } from '../compilation'; export abstract class Code { - protected cachedDecl: string | undefined; + public cachedDecl: string | undefined; constructor(public readonly ref: T) { } diff --git a/llparse/src/implementation/c/node/base.ts b/llparse/src/implementation/c/node/base.ts index 51f90bb..83992e7 100644 --- a/llparse/src/implementation/c/node/base.ts +++ b/llparse/src/implementation/c/node/base.ts @@ -13,8 +13,8 @@ export interface INodeEdge { } export abstract class 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 { 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 { 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); diff --git a/llparse/src/implementation/c/node/error.ts b/llparse/src/implementation/c/node/error.ts index 29dce63..8055081 100644 --- a/llparse/src/implementation/c/node/error.ts +++ b/llparse/src/implementation/c/node/error.ts @@ -5,7 +5,7 @@ import { STATE_ERROR } from '../constants'; import { Node } from './base'; class ErrorNode extends Node { - protected storeError(out: string[]): void { + public storeError(out: string[]): void { const ctx = this.compilation; let hexCode: string; -- 2.30.2