timed-automata-analyzer 1.0.7 → 1.0.9

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 CHANGED
@@ -5,7 +5,7 @@
5
5
  "luth1um"
6
6
  ],
7
7
  "description": "An analyzer for Timed Automata written in Rust",
8
- "version": "1.0.7",
8
+ "version": "1.0.9",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",
@@ -28,25 +28,31 @@ export enum ClockComparator {
28
28
  }
29
29
  export class Clause {
30
30
  free(): void;
31
+ [Symbol.dispose](): void;
31
32
  constructor(lhs: Clock, op: ClockComparator, rhs: number);
32
33
  }
33
34
  export class Clock {
34
35
  free(): void;
36
+ [Symbol.dispose](): void;
35
37
  constructor(name: string);
36
38
  }
37
39
  export class ClockConstraint {
38
40
  free(): void;
41
+ [Symbol.dispose](): void;
39
42
  constructor(clauses: Clause[]);
40
43
  }
41
44
  export class Location {
42
45
  free(): void;
46
+ [Symbol.dispose](): void;
43
47
  constructor(name: string, is_initial: boolean, invariant?: ClockConstraint | null);
44
48
  }
45
49
  export class Switch {
46
50
  free(): void;
51
+ [Symbol.dispose](): void;
47
52
  constructor(source: Location, guard: ClockConstraint | null | undefined, action: string, reset: Clock[], target: Location);
48
53
  }
49
54
  export class TimedAutomaton {
50
55
  free(): void;
56
+ [Symbol.dispose](): void;
51
57
  constructor(locations: Location[], clocks: Clock[], switches: Switch[]);
52
58
  }
@@ -13,9 +13,7 @@ function getUint8ArrayMemory0() {
13
13
  return cachedUint8ArrayMemory0;
14
14
  }
15
15
 
16
- const lTextDecoder = typeof TextDecoder === 'undefined' ? (0, module.require)('util').TextDecoder : TextDecoder;
17
-
18
- let cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
16
+ let cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
19
17
 
20
18
  cachedTextDecoder.decode();
21
19
 
@@ -24,7 +22,7 @@ let numBytesDecoded = 0;
24
22
  function decodeText(ptr, len) {
25
23
  numBytesDecoded += len;
26
24
  if (numBytesDecoded >= MAX_SAFARI_DECODE_BYTES) {
27
- cachedTextDecoder = new lTextDecoder('utf-8', { ignoreBOM: true, fatal: true });
25
+ cachedTextDecoder = new TextDecoder('utf-8', { ignoreBOM: true, fatal: true });
28
26
  cachedTextDecoder.decode();
29
27
  numBytesDecoded = len;
30
28
  }
@@ -38,22 +36,18 @@ function getStringFromWasm0(ptr, len) {
38
36
 
39
37
  let WASM_VECTOR_LEN = 0;
40
38
 
41
- const lTextEncoder = typeof TextEncoder === 'undefined' ? (0, module.require)('util').TextEncoder : TextEncoder;
42
-
43
- const cachedTextEncoder = new lTextEncoder('utf-8');
39
+ const cachedTextEncoder = new TextEncoder();
44
40
 
45
- const encodeString = (typeof cachedTextEncoder.encodeInto === 'function'
46
- ? function (arg, view) {
47
- return cachedTextEncoder.encodeInto(arg, view);
41
+ if (!('encodeInto' in cachedTextEncoder)) {
42
+ cachedTextEncoder.encodeInto = function (arg, view) {
43
+ const buf = cachedTextEncoder.encode(arg);
44
+ view.set(buf);
45
+ return {
46
+ read: arg.length,
47
+ written: buf.length
48
+ };
49
+ }
48
50
  }
49
- : function (arg, view) {
50
- const buf = cachedTextEncoder.encode(arg);
51
- view.set(buf);
52
- return {
53
- read: arg.length,
54
- written: buf.length
55
- };
56
- });
57
51
 
58
52
  function passStringToWasm0(arg, malloc, realloc) {
59
53
 
@@ -84,7 +78,7 @@ function passStringToWasm0(arg, malloc, realloc) {
84
78
  }
85
79
  ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
86
80
  const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
87
- const ret = encodeString(arg, view);
81
+ const ret = cachedTextEncoder.encodeInto(arg, view);
88
82
 
89
83
  offset += ret.written;
90
84
  ptr = realloc(ptr, len, offset, 1) >>> 0;
@@ -216,6 +210,7 @@ export class Clause {
216
210
  return this;
217
211
  }
218
212
  }
213
+ if (Symbol.dispose) Clause.prototype[Symbol.dispose] = Clause.prototype.free;
219
214
 
220
215
  const ClockFinalization = (typeof FinalizationRegistry === 'undefined')
221
216
  ? { register: () => {}, unregister: () => {} }
@@ -253,6 +248,7 @@ export class Clock {
253
248
  return this;
254
249
  }
255
250
  }
251
+ if (Symbol.dispose) Clock.prototype[Symbol.dispose] = Clock.prototype.free;
256
252
 
257
253
  const ClockConstraintFinalization = (typeof FinalizationRegistry === 'undefined')
258
254
  ? { register: () => {}, unregister: () => {} }
@@ -283,6 +279,7 @@ export class ClockConstraint {
283
279
  return this;
284
280
  }
285
281
  }
282
+ if (Symbol.dispose) ClockConstraint.prototype[Symbol.dispose] = ClockConstraint.prototype.free;
286
283
 
287
284
  const LocationFinalization = (typeof FinalizationRegistry === 'undefined')
288
285
  ? { register: () => {}, unregister: () => {} }
@@ -327,6 +324,7 @@ export class Location {
327
324
  return this;
328
325
  }
329
326
  }
327
+ if (Symbol.dispose) Location.prototype[Symbol.dispose] = Location.prototype.free;
330
328
 
331
329
  const SwitchFinalization = (typeof FinalizationRegistry === 'undefined')
332
330
  ? { register: () => {}, unregister: () => {} }
@@ -377,6 +375,7 @@ export class Switch {
377
375
  return this;
378
376
  }
379
377
  }
378
+ if (Symbol.dispose) Switch.prototype[Symbol.dispose] = Switch.prototype.free;
380
379
 
381
380
  const TimedAutomatonFinalization = (typeof FinalizationRegistry === 'undefined')
382
381
  ? { register: () => {}, unregister: () => {} }
@@ -413,6 +412,7 @@ export class TimedAutomaton {
413
412
  return this;
414
413
  }
415
414
  }
415
+ if (Symbol.dispose) TimedAutomaton.prototype[Symbol.dispose] = TimedAutomaton.prototype.free;
416
416
 
417
417
  export function __wbg_clause_unwrap(arg0) {
418
418
  const ret = Clause.__unwrap(arg0);
@@ -434,7 +434,7 @@ export function __wbg_switch_unwrap(arg0) {
434
434
  return ret;
435
435
  };
436
436
 
437
- export function __wbg_wbindgenthrow_4c11a24fca429ccf(arg0, arg1) {
437
+ export function __wbg_wbindgenthrow_451ec1a8469d7eb6(arg0, arg1) {
438
438
  throw new Error(getStringFromWasm0(arg0, arg1));
439
439
  };
440
440
 
Binary file