// 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`;
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) {
}
}
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) {
}
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()}) {`);
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);
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;