windmill-parser-wasm-csharp 1.510.1 → 1.880.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/windmill_parser_wasm.d.ts +13 -13
- package/windmill_parser_wasm.js +19 -3
- package/windmill_parser_wasm_bg.wasm +0 -0
package/package.json
CHANGED
|
@@ -7,26 +7,26 @@ export type InitInput = RequestInfo | URL | Response | BufferSource | WebAssembl
|
|
|
7
7
|
export interface InitOutput {
|
|
8
8
|
readonly memory: WebAssembly.Memory;
|
|
9
9
|
readonly parse_csharp: (a: number, b: number) => [number, number];
|
|
10
|
+
readonly __assert_fail: (a: number, b: number, c: number, d: number) => void;
|
|
10
11
|
readonly abort: () => void;
|
|
11
|
-
readonly malloc: (a: number) => number;
|
|
12
12
|
readonly calloc: (a: number, b: number) => number;
|
|
13
|
-
readonly realloc: (a: number, b: number) => number;
|
|
14
|
-
readonly free: (a: number) => void;
|
|
15
|
-
readonly strncmp: (a: number, b: number, c: number) => number;
|
|
16
|
-
readonly iswspace: (a: number) => number;
|
|
17
|
-
readonly iswalnum: (a: number) => number;
|
|
18
13
|
readonly clock: () => bigint;
|
|
19
|
-
readonly
|
|
14
|
+
readonly clock_gettime: (a: number, b: number) => void;
|
|
15
|
+
readonly fclose: (a: number) => number;
|
|
16
|
+
readonly fdopen: (a: number, b: number) => number;
|
|
20
17
|
readonly fprintf: (a: number, b: number, c: number) => number;
|
|
21
|
-
readonly fputs: (a: number, b: number) => number;
|
|
22
18
|
readonly fputc: (a: number, b: number) => number;
|
|
23
|
-
readonly
|
|
24
|
-
readonly
|
|
19
|
+
readonly fputs: (a: number, b: number) => number;
|
|
20
|
+
readonly free: (a: number) => void;
|
|
25
21
|
readonly fwrite: (a: number, b: number, c: number, d: number) => number;
|
|
26
|
-
readonly
|
|
27
|
-
readonly
|
|
22
|
+
readonly isprint: (a: number) => number;
|
|
23
|
+
readonly iswalnum: (a: number) => number;
|
|
24
|
+
readonly iswspace: (a: number) => number;
|
|
25
|
+
readonly malloc: (a: number) => number;
|
|
26
|
+
readonly realloc: (a: number, b: number) => number;
|
|
28
27
|
readonly snprintf: () => void;
|
|
29
|
-
readonly
|
|
28
|
+
readonly strncmp: (a: number, b: number, c: number) => number;
|
|
29
|
+
readonly vsnprintf: (a: number, b: number, c: number, d: number) => number;
|
|
30
30
|
readonly __wbindgen_export_0: WebAssembly.Table;
|
|
31
31
|
readonly __wbindgen_malloc: (a: number, b: number) => number;
|
|
32
32
|
readonly __wbindgen_realloc: (a: number, b: number, c: number, d: number) => number;
|
package/windmill_parser_wasm.js
CHANGED
|
@@ -65,13 +65,25 @@ function passStringToWasm0(arg, malloc, realloc) {
|
|
|
65
65
|
return ptr;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
|
-
|
|
68
|
+
let cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
69
69
|
|
|
70
70
|
if (typeof TextDecoder !== 'undefined') { cachedTextDecoder.decode(); };
|
|
71
71
|
|
|
72
|
+
const MAX_SAFARI_DECODE_BYTES = 2146435072;
|
|
73
|
+
let numBytesDecoded = 0;
|
|
74
|
+
function decodeText(ptr, len) {
|
|
75
|
+
numBytesDecoded += len;
|
|
76
|
+
if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
|
|
77
|
+
cachedTextDecoder = (typeof TextDecoder !== 'undefined' ? new TextDecoder('utf-8', { ignoreBOM: true, fatal: true }) : { decode: () => { throw Error('TextDecoder not available') } } );
|
|
78
|
+
cachedTextDecoder.decode();
|
|
79
|
+
numBytesDecoded = len;
|
|
80
|
+
}
|
|
81
|
+
return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
|
|
82
|
+
}
|
|
83
|
+
|
|
72
84
|
function getStringFromWasm0(ptr, len) {
|
|
73
85
|
ptr = ptr >>> 0;
|
|
74
|
-
return
|
|
86
|
+
return decodeText(ptr, len);
|
|
75
87
|
}
|
|
76
88
|
/**
|
|
77
89
|
* @param {string} code
|
|
@@ -92,6 +104,8 @@ export function parse_csharp(code) {
|
|
|
92
104
|
}
|
|
93
105
|
}
|
|
94
106
|
|
|
107
|
+
const EXPECTED_RESPONSE_TYPES = new Set(['basic', 'cors', 'default']);
|
|
108
|
+
|
|
95
109
|
async function __wbg_load(module, imports) {
|
|
96
110
|
if (typeof Response === 'function' && module instanceof Response) {
|
|
97
111
|
if (typeof WebAssembly.instantiateStreaming === 'function') {
|
|
@@ -99,7 +113,9 @@ async function __wbg_load(module, imports) {
|
|
|
99
113
|
return await WebAssembly.instantiateStreaming(module, imports);
|
|
100
114
|
|
|
101
115
|
} catch (e) {
|
|
102
|
-
|
|
116
|
+
const validResponse = module.ok && EXPECTED_RESPONSE_TYPES.has(module.type);
|
|
117
|
+
|
|
118
|
+
if (validResponse && module.headers.get('Content-Type') !== 'application/wasm') {
|
|
103
119
|
console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve Wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e);
|
|
104
120
|
|
|
105
121
|
} else {
|
|
Binary file
|