warpo 2.4.0 → 2.5.0-alpha-2
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/dist/debug_server/dapServer.d.ts +1 -0
- package/dist/debug_server/dapServer.js +27 -0
- package/dist/debug_server/dapServer.js.map +1 -0
- package/dist/debug_server/debugSession.d.ts +19 -0
- package/dist/debug_server/debugSession.js +71 -0
- package/dist/debug_server/debugSession.js.map +1 -0
- package/dist/debug_server/tests/debugSession.test.d.ts +1 -0
- package/dist/debug_server/tests/debugSession.test.js +61 -0
- package/dist/debug_server/tests/debugSession.test.js.map +1 -0
- package/dist/debug_server/tests/launcher.d.ts +10 -0
- package/dist/debug_server/tests/launcher.js +21 -0
- package/dist/debug_server/tests/launcher.js.map +1 -0
- package/dist/scripts/lib.d.ts +7 -0
- package/dist/{lib.js → scripts/lib.js} +20 -6
- package/dist/scripts/lib.js.map +1 -0
- package/dist/test_runner/cli.d.ts +2 -0
- package/dist/test_runner/cli.js +85 -0
- package/dist/test_runner/cli.js.map +1 -0
- package/dist/test_runner/core/analyze.d.ts +13 -0
- package/dist/test_runner/core/analyze.js +58 -0
- package/dist/test_runner/core/analyze.js.map +1 -0
- package/dist/test_runner/core/compile.d.ts +4 -0
- package/dist/test_runner/core/compile.js +23 -0
- package/dist/test_runner/core/compile.js.map +1 -0
- package/dist/test_runner/core/compiler.d.ts +11 -0
- package/dist/test_runner/core/compiler.js +47 -0
- package/dist/test_runner/core/compiler.js.map +1 -0
- package/dist/test_runner/core/covRecorder.d.ts +5 -0
- package/dist/test_runner/core/covRecorder.js +26 -0
- package/dist/test_runner/core/covRecorder.js.map +1 -0
- package/dist/test_runner/core/execute.d.ts +4 -0
- package/dist/test_runner/core/execute.js +76 -0
- package/dist/test_runner/core/execute.js.map +1 -0
- package/dist/test_runner/core/executionRecorder.d.ts +52 -0
- package/dist/test_runner/core/executionRecorder.js +164 -0
- package/dist/test_runner/core/executionRecorder.js.map +1 -0
- package/dist/test_runner/core/mockStatusRecorder.d.ts +10 -0
- package/dist/test_runner/core/mockStatusRecorder.js +62 -0
- package/dist/test_runner/core/mockStatusRecorder.js.map +1 -0
- package/dist/test_runner/executionResult.d.ts +11 -0
- package/dist/test_runner/executionResult.js +112 -0
- package/dist/test_runner/executionResult.js.map +1 -0
- package/dist/test_runner/generator/html-generator/genCode.d.ts +2 -0
- package/dist/test_runner/generator/html-generator/genCode.js +124 -0
- package/dist/test_runner/generator/html-generator/genCode.js.map +1 -0
- package/dist/test_runner/generator/html-generator/genFolder.d.ts +2 -0
- package/dist/test_runner/generator/html-generator/genFolder.js +155 -0
- package/dist/test_runner/generator/html-generator/genFolder.js.map +1 -0
- package/dist/test_runner/generator/html-generator/index.d.ts +2 -0
- package/dist/test_runner/generator/html-generator/index.js +33 -0
- package/dist/test_runner/generator/html-generator/index.js.map +1 -0
- package/dist/test_runner/generator/index.d.ts +9 -0
- package/dist/test_runner/generator/index.js +30 -0
- package/dist/test_runner/generator/index.js.map +1 -0
- package/dist/test_runner/generator/json-generator/index.d.ts +2 -0
- package/dist/test_runner/generator/json-generator/index.js +45 -0
- package/dist/test_runner/generator/json-generator/index.js.map +1 -0
- package/dist/test_runner/generator/table-generator/index.d.ts +2 -0
- package/dist/test_runner/generator/table-generator/index.js +85 -0
- package/dist/test_runner/generator/table-generator/index.js.map +1 -0
- package/dist/test_runner/index.d.ts +3 -0
- package/dist/test_runner/index.js +70 -0
- package/dist/test_runner/index.js.map +1 -0
- package/dist/test_runner/interface.d.ts +36 -0
- package/dist/test_runner/interface.js +12 -0
- package/dist/test_runner/interface.js.map +1 -0
- package/dist/test_runner/parser/index.d.ts +35 -0
- package/dist/test_runner/parser/index.js +146 -0
- package/dist/test_runner/parser/index.js.map +1 -0
- package/dist/test_runner/parser/singleFileAnalysis.d.ts +8 -0
- package/dist/test_runner/parser/singleFileAnalysis.js +51 -0
- package/dist/test_runner/parser/singleFileAnalysis.js.map +1 -0
- package/dist/test_runner/parser/singleFunctionAnalysis.d.ts +16 -0
- package/dist/test_runner/parser/singleFunctionAnalysis.js +97 -0
- package/dist/test_runner/parser/singleFunctionAnalysis.js.map +1 -0
- package/dist/test_runner/testOption.d.ts +16 -0
- package/dist/test_runner/testOption.js +2 -0
- package/dist/test_runner/testOption.js.map +1 -0
- package/dist/test_runner/utils/errorTraceHandler.d.ts +12 -0
- package/dist/test_runner/utils/errorTraceHandler.js +87 -0
- package/dist/test_runner/utils/errorTraceHandler.js.map +1 -0
- package/dist/test_runner/utils/escape.d.ts +1 -0
- package/dist/test_runner/utils/escape.js +14 -0
- package/dist/test_runner/utils/escape.js.map +1 -0
- package/dist/test_runner/utils/index.d.ts +14 -0
- package/dist/test_runner/utils/index.js +88 -0
- package/dist/test_runner/utils/index.js.map +1 -0
- package/dist/test_runner/utils/interface.d.ts +100 -0
- package/dist/test_runner/utils/interface.js +86 -0
- package/dist/test_runner/utils/interface.js.map +1 -0
- package/dist/test_runner/utils/name.d.ts +2 -0
- package/dist/test_runner/utils/name.js +3 -0
- package/dist/test_runner/utils/name.js.map +1 -0
- package/dist/test_runner/utils/pathResolver.d.ts +6 -0
- package/dist/test_runner/utils/pathResolver.js +98 -0
- package/dist/test_runner/utils/pathResolver.js.map +1 -0
- package/dist/test_runner/utils/projectRoot.d.ts +1 -0
- package/dist/test_runner/utils/projectRoot.js +4 -0
- package/dist/test_runner/utils/projectRoot.js.map +1 -0
- package/dist/test_runner/utils/wasm.d.ts +12 -0
- package/dist/test_runner/utils/wasm.js +45 -0
- package/dist/test_runner/utils/wasm.js.map +1 -0
- package/dist/warpo.js +10 -3
- package/dist/warpo.js.map +1 -0
- package/dist/warpo_internal.d.ts +7 -0
- package/dist/warpo_internal.js +74 -0
- package/dist/warpo_internal.js.map +1 -0
- package/package.json +37 -9
- package/types/std/index.d.ts +8 -261
- package/types/warpo/index.d.ts +94 -0
- package/dist/lib.d.ts +0 -5
package/types/std/index.d.ts
CHANGED
|
@@ -112,8 +112,6 @@ declare const ASC_FEATURE_NONTRAPPING_F2I: bool;
|
|
|
112
112
|
declare const ASC_FEATURE_BULK_MEMORY: bool;
|
|
113
113
|
/** Whether the SIMD feature is enabled. */
|
|
114
114
|
declare const ASC_FEATURE_SIMD: bool;
|
|
115
|
-
/** Whether the threads feature is enabled. */
|
|
116
|
-
declare const ASC_FEATURE_THREADS: bool;
|
|
117
115
|
/** Whether the exception handling feature is enabled. */
|
|
118
116
|
declare const ASC_FEATURE_EXCEPTION_HANDLING: bool;
|
|
119
117
|
/** Whether the tail calls feature is enabled. */
|
|
@@ -283,44 +281,6 @@ declare function decodeURI(str: string): string;
|
|
|
283
281
|
/** Decodes a Uniform Resource Identifier (URI) component previously created by encodeURIComponent. */
|
|
284
282
|
declare function decodeURIComponent(str: string): string;
|
|
285
283
|
|
|
286
|
-
/** Atomic operations. */
|
|
287
|
-
declare namespace atomic {
|
|
288
|
-
/** Atomically loads an integer value from memory and returns it. */
|
|
289
|
-
export function load<T>(ptr: usize, immOffset?: usize): T;
|
|
290
|
-
/** Atomically stores an integer value to memory. */
|
|
291
|
-
export function store<T>(ptr: usize, value: T, immOffset?: usize): void;
|
|
292
|
-
/** Atomically adds an integer value in memory. */
|
|
293
|
-
export function add<T>(ptr: usize, value: T, immOffset?: usize): T;
|
|
294
|
-
/** Atomically subtracts an integer value in memory. */
|
|
295
|
-
export function sub<T>(ptr: usize, value: T, immOffset?: usize): T;
|
|
296
|
-
/** Atomically performs a bitwise AND operation on an integer value in memory. */
|
|
297
|
-
export function and<T>(ptr: usize, value: T, immOffset?: usize): T;
|
|
298
|
-
/** Atomically performs a bitwise OR operation on an integer value in memory. */
|
|
299
|
-
export function or<T>(ptr: usize, value: T, immOffset?: usize): T;
|
|
300
|
-
/** Atomically performs a bitwise XOR operation on an integer value in memory. */
|
|
301
|
-
export function xor<T>(ptr: usize, value: T, immOffset?: usize): T;
|
|
302
|
-
/** Atomically exchanges an integer value in memory. */
|
|
303
|
-
export function xchg<T>(ptr: usize, value: T, immOffset?: usize): T;
|
|
304
|
-
/** Atomically compares and exchanges an integer value in memory if the condition is met. */
|
|
305
|
-
export function cmpxchg<T>(ptr: usize, expected: T, replacement: T, immOffset?: usize): T;
|
|
306
|
-
/** Performs a wait operation on an address in memory suspending this agent if the integer condition is met. */
|
|
307
|
-
export function wait<T>(ptr: usize, expected: T, timeout?: i64): AtomicWaitResult;
|
|
308
|
-
/** Performs a notify operation on an address in memory waking up suspended agents. */
|
|
309
|
-
export function notify(ptr: usize, count?: i32): i32;
|
|
310
|
-
/** Performs a fence operation, preserving synchronization guarantees of higher level languages. */
|
|
311
|
-
export function fence(): void;
|
|
312
|
-
}
|
|
313
|
-
|
|
314
|
-
/** Describes the result of an atomic wait operation. */
|
|
315
|
-
declare enum AtomicWaitResult {
|
|
316
|
-
/** Woken by another agent. */
|
|
317
|
-
OK,
|
|
318
|
-
/** Loaded value did not match the expected value. */
|
|
319
|
-
NOT_EQUAL,
|
|
320
|
-
/** Not woken before the timeout expired. */
|
|
321
|
-
TIMED_OUT,
|
|
322
|
-
}
|
|
323
|
-
|
|
324
284
|
/** Converts any other numeric value to an 8-bit signed integer. */
|
|
325
285
|
declare function i8(value: any): i8;
|
|
326
286
|
declare namespace i8 {
|
|
@@ -396,73 +356,6 @@ declare namespace i32 {
|
|
|
396
356
|
export function rem_s(left: i32, right: i32): i32;
|
|
397
357
|
/** Computes the unsigned remainder of two 32-bit integers. */
|
|
398
358
|
export function rem_u(left: u32, right: u32): u32;
|
|
399
|
-
|
|
400
|
-
/** Atomic 32-bit integer operations. */
|
|
401
|
-
export namespace atomic {
|
|
402
|
-
/** Atomically loads an 8-bit unsigned integer value from memory and returns it as a 32-bit integer. */
|
|
403
|
-
export function load8_u(ptr: usize, immOffset?: usize): i32;
|
|
404
|
-
/** Atomically loads a 16-bit unsigned integer value from memory and returns it as a 32-bit integer. */
|
|
405
|
-
export function load16_u(ptr: usize, immOffset?: usize): i32;
|
|
406
|
-
/** Atomically loads a 32-bit integer value from memory and returns it. */
|
|
407
|
-
export function load(ptr: usize, immOffset?: usize): i32;
|
|
408
|
-
/** Atomically stores a 32-bit integer value to memory as an 8-bit integer. */
|
|
409
|
-
export function store8(ptr: usize, value: i32, immOffset?: usize): void;
|
|
410
|
-
/** Atomically stores a 32-bit integer value to memory as a 16-bit integer. */
|
|
411
|
-
export function store16(ptr: usize, value: i32, immOffset?: usize): void;
|
|
412
|
-
/** Atomically stores a 32-bit integer value to memory. */
|
|
413
|
-
export function store(ptr: usize, value: i32, immOffset?: usize): void;
|
|
414
|
-
/** Atomic 32-bit integer read-modify-write operations on 8-bit values. */
|
|
415
|
-
export namespace rmw8 {
|
|
416
|
-
/** Atomically adds an 8-bit unsigned integer value in memory. */
|
|
417
|
-
export function add_u(ptr: usize, value: i32, immOffset?: usize): i32;
|
|
418
|
-
/** Atomically subtracts an 8-bit unsigned integer value in memory. */
|
|
419
|
-
export function sub_u(ptr: usize, value: i32, immOffset?: usize): i32;
|
|
420
|
-
/** Atomically performs a bitwise AND operation an 8-bit unsigned integer value in memory. */
|
|
421
|
-
export function and_u(ptr: usize, value: i32, immOffset?: usize): i32;
|
|
422
|
-
/** Atomically performs a bitwise OR operation an 8-bit unsigned integer value in memory. */
|
|
423
|
-
export function or_u(ptr: usize, value: i32, immOffset?: usize): i32;
|
|
424
|
-
/** Atomically performs a bitwise XOR operation an 8-bit unsigned integer value in memory. */
|
|
425
|
-
export function xor_u(ptr: usize, value: i32, immOffset?: usize): i32;
|
|
426
|
-
/** Atomically exchanges an 8-bit unsigned integer value in memory. */
|
|
427
|
-
export function xchg_u(ptr: usize, value: i32, immOffset?: usize): i32;
|
|
428
|
-
/** Atomically compares and exchanges an 8-bit unsigned integer value in memory if the condition is met. */
|
|
429
|
-
export function cmpxchg_u(ptr: usize, expected: i32, replacement: i32, immOffset?: usize): i32;
|
|
430
|
-
}
|
|
431
|
-
/** Atomic 32-bit integer read-modify-write operations on 16-bit values. */
|
|
432
|
-
export namespace rmw16 {
|
|
433
|
-
/** Atomically adds a 16-bit unsigned integer value in memory. */
|
|
434
|
-
export function add_u(ptr: usize, value: i32, immOffset?: usize): i32;
|
|
435
|
-
/** Atomically adds a 16-bit unsigned integer value in memory. */
|
|
436
|
-
export function sub_u(ptr: usize, value: i32, immOffset?: usize): i32;
|
|
437
|
-
/** Atomically performs a bitwise AND operation a 16-bit unsigned integer value in memory. */
|
|
438
|
-
export function and_u(ptr: usize, value: i32, immOffset?: usize): i32;
|
|
439
|
-
/** Atomically performs a bitwise OR operation a 16-bit unsigned integer value in memory. */
|
|
440
|
-
export function or_u(ptr: usize, value: i32, immOffset?: usize): i32;
|
|
441
|
-
/** Atomically performs a bitwise XOR operation a 16-bit unsigned integer value in memory. */
|
|
442
|
-
export function xor_u(ptr: usize, value: i32, immOffset?: usize): i32;
|
|
443
|
-
/** Atomically exchanges a 16-bit unsigned integer value in memory. */
|
|
444
|
-
export function xchg_u(ptr: usize, value: i32, immOffset?: usize): i32;
|
|
445
|
-
/** Atomically compares and exchanges a 16-bit unsigned integer value in memory if the condition is met. */
|
|
446
|
-
export function cmpxchg_u(ptr: usize, expected: i32, replacement: i32, immOffset?: usize): i32;
|
|
447
|
-
}
|
|
448
|
-
/** Atomic 32-bit integer read-modify-write operations. */
|
|
449
|
-
export namespace rmw {
|
|
450
|
-
/** Atomically adds a 32-bit integer value in memory. */
|
|
451
|
-
export function add(ptr: usize, value: i32, immOffset?: usize): i32;
|
|
452
|
-
/** Atomically subtracts a 32-bit integer value in memory. */
|
|
453
|
-
export function sub(ptr: usize, value: i32, immOffset?: usize): i32;
|
|
454
|
-
/** Atomically performs a bitwise AND operation a 32-bit integer value in memory. */
|
|
455
|
-
export function and(ptr: usize, value: i32, immOffset?: usize): i32;
|
|
456
|
-
/** Atomically performs a bitwise OR operation a 32-bit integer value in memory. */
|
|
457
|
-
export function or(ptr: usize, value: i32, immOffset?: usize): i32;
|
|
458
|
-
/** Atomically performs a bitwise XOR operation a 32-bit integer value in memory. */
|
|
459
|
-
export function xor(ptr: usize, value: i32, immOffset?: usize): i32;
|
|
460
|
-
/** Atomically exchanges a 32-bit integer value in memory. */
|
|
461
|
-
export function xchg(ptr: usize, value: i32, immOffset?: usize): i32;
|
|
462
|
-
/** Atomically compares and exchanges a 32-bit integer value in memory if the condition is met. */
|
|
463
|
-
export function cmpxchg(ptr: usize, expected: i32, replacement: i32, immOffset?: usize): i32;
|
|
464
|
-
}
|
|
465
|
-
}
|
|
466
359
|
}
|
|
467
360
|
/** Converts any other numeric value to a 64-bit signed integer. */
|
|
468
361
|
declare function i64(value: any): i64;
|
|
@@ -525,94 +418,6 @@ declare namespace i64 {
|
|
|
525
418
|
export function rem_s(left: i64, right: i64): i64;
|
|
526
419
|
/** Computes the unsigned remainder of two 64-bit integers. */
|
|
527
420
|
export function rem_u(left: u64, right: u64): u64;
|
|
528
|
-
|
|
529
|
-
/** Atomic 64-bit integer operations. */
|
|
530
|
-
export namespace atomic {
|
|
531
|
-
/** Atomically loads an 8-bit unsigned integer value from memory and returns it as a 64-bit integer. */
|
|
532
|
-
export function load8_u(ptr: usize, immOffset?: usize): i64;
|
|
533
|
-
/** Atomically loads a 16-bit unsigned integer value from memory and returns it as a 64-bit integer. */
|
|
534
|
-
export function load16_u(ptr: usize, immOffset?: usize): i64;
|
|
535
|
-
/** Atomically loads a 32-bit unsigned integer value from memory and returns it as a 64-bit integer. */
|
|
536
|
-
export function load32_u(ptr: usize, immOffset?: usize): i64;
|
|
537
|
-
/** Atomically loads a 64-bit integer value from memory and returns it. */
|
|
538
|
-
export function load(ptr: usize, immOffset?: usize): i64;
|
|
539
|
-
/** Atomically stores a 64-bit integer value to memory as an 8-bit integer. */
|
|
540
|
-
export function store8(ptr: usize, value: i64, immOffset?: usize): void;
|
|
541
|
-
/** Atomically stores a 64-bit integer value to memory as a 16-bit integer. */
|
|
542
|
-
export function store16(ptr: usize, value: i64, immOffset?: usize): void;
|
|
543
|
-
/** Atomically stores a 64-bit integer value to memory as a 32-bit integer. */
|
|
544
|
-
export function store32(ptr: usize, value: i64, immOffset?: usize): void;
|
|
545
|
-
/** Atomically stores a 64-bit integer value to memory. */
|
|
546
|
-
export function store(ptr: usize, value: i64, immOffset?: usize): void;
|
|
547
|
-
/** Atomic 64-bit integer read-modify-write operations on 8-bit values. */
|
|
548
|
-
export namespace rmw8 {
|
|
549
|
-
/** Atomically adds an 8-bit unsigned integer value in memory. */
|
|
550
|
-
export function add_u(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
551
|
-
/** Atomically subtracts an 8-bit unsigned integer value in memory. */
|
|
552
|
-
export function sub_u(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
553
|
-
/** Atomically performs a bitwise AND operation on an 8-bit unsigned integer value in memory. */
|
|
554
|
-
export function and_u(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
555
|
-
/** Atomically performs a bitwise OR operation on an 8-bit unsigned integer value in memory. */
|
|
556
|
-
export function or_u(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
557
|
-
/** Atomically performs a bitwise XOR operation on an 8-bit unsigned integer value in memory. */
|
|
558
|
-
export function xor_u(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
559
|
-
/** Atomically exchanges an 8-bit unsigned integer value in memory. */
|
|
560
|
-
export function xchg_u(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
561
|
-
/** Atomically compares and exchanges an 8-bit unsigned integer value in memory if the condition is met. */
|
|
562
|
-
export function cmpxchg_u(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64;
|
|
563
|
-
}
|
|
564
|
-
/** Atomic 64-bit integer read-modify-write operations on 16-bit values. */
|
|
565
|
-
export namespace rmw16 {
|
|
566
|
-
/** Atomically adds a 16-bit unsigned integer value in memory. */
|
|
567
|
-
export function add_u(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
568
|
-
/** Atomically subtracts a 16-bit unsigned integer value in memory. */
|
|
569
|
-
export function sub_u(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
570
|
-
/** Atomically performs a bitwise AND operation on a 16-bit unsigned integer value in memory. */
|
|
571
|
-
export function and_u(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
572
|
-
/** Atomically performs a bitwise OR operation on a 16-bit unsigned integer value in memory. */
|
|
573
|
-
export function or_u(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
574
|
-
/** Atomically performs a bitwise XOR operation on a 16-bit unsigned integer value in memory. */
|
|
575
|
-
export function xor_u(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
576
|
-
/** Atomically exchanges a 16-bit unsigned integer value in memory. */
|
|
577
|
-
export function xchg_u(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
578
|
-
/** Atomically compares and exchanges a 16-bit unsigned integer value in memory if the condition is met. */
|
|
579
|
-
export function cmpxchg_u(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64;
|
|
580
|
-
}
|
|
581
|
-
/** Atomic 64-bit integer read-modify-write operations on 32-bit values. */
|
|
582
|
-
export namespace rmw32 {
|
|
583
|
-
/** Atomically adds a 32-bit unsigned integer value in memory. */
|
|
584
|
-
export function add_u(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
585
|
-
/** Atomically subtracts a 32-bit unsigned integer value in memory. */
|
|
586
|
-
export function sub_u(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
587
|
-
/** Atomically performs a bitwise AND operation on a 32-bit unsigned integer value in memory. */
|
|
588
|
-
export function and_u(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
589
|
-
/** Atomically performs a bitwise OR operation on a 32-bit unsigned integer value in memory. */
|
|
590
|
-
export function or_u(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
591
|
-
/** Atomically performs a bitwise XOR operation on a 32-bit unsigned integer value in memory. */
|
|
592
|
-
export function xor_u(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
593
|
-
/** Atomically exchanges a 32-bit unsigned integer value in memory. */
|
|
594
|
-
export function xchg_u(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
595
|
-
/** Atomically compares and exchanges a 32-bit unsigned integer value in memory if the condition is met. */
|
|
596
|
-
export function cmpxchg_u(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64;
|
|
597
|
-
}
|
|
598
|
-
/** Atomic 64-bit integer read-modify-write operations. */
|
|
599
|
-
export namespace rmw {
|
|
600
|
-
/** Atomically adds a 64-bit integer value in memory. */
|
|
601
|
-
export function add(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
602
|
-
/** Atomically subtracts a 64-bit integer value in memory. */
|
|
603
|
-
export function sub(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
604
|
-
/** Atomically performs a bitwise AND operation on a 64-bit integer value in memory. */
|
|
605
|
-
export function and(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
606
|
-
/** Atomically performs a bitwise OR operation on a 64-bit integer value in memory. */
|
|
607
|
-
export function or(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
608
|
-
/** Atomically performs a bitwise XOR operation on a 64-bit integer value in memory. */
|
|
609
|
-
export function xor(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
610
|
-
/** Atomically exchanges a 64-bit integer value in memory. */
|
|
611
|
-
export function xchg(ptr: usize, value: i64, immOffset?: usize): i64;
|
|
612
|
-
/** Atomically compares and exchanges a 64-bit integer value in memory if the condition is met. */
|
|
613
|
-
export function cmpxchg(ptr: usize, expected: i64, replacement: i64, immOffset?: usize): i64;
|
|
614
|
-
}
|
|
615
|
-
}
|
|
616
421
|
}
|
|
617
422
|
/** Converts any other numeric value to a 32-bit signed integer. */
|
|
618
423
|
declare let isize: typeof i32;
|
|
@@ -1716,6 +1521,10 @@ declare namespace f64x2 {
|
|
|
1716
1521
|
export function relaxed_max(a: v128, b: v128): v128;
|
|
1717
1522
|
}
|
|
1718
1523
|
|
|
1524
|
+
declare namespace ffi {
|
|
1525
|
+
function set_ffi_closure_env(value: i32): void;
|
|
1526
|
+
}
|
|
1527
|
+
|
|
1719
1528
|
declare abstract class i31 {
|
|
1720
1529
|
/** Creates a new 31-bit integer reference from the specified integer value. */
|
|
1721
1530
|
static new(value: i32): ref_i31;
|
|
@@ -1853,13 +1662,6 @@ declare namespace memory {
|
|
|
1853
1662
|
export function data(size: i32, align?: i32): usize;
|
|
1854
1663
|
/** Gets a pointer to a pre-initialized static chunk of memory. Alignment defaults to the size of `T`. Arguments must be compile-time constants. */
|
|
1855
1664
|
export function data<T>(values: T[], align?: i32): usize;
|
|
1856
|
-
|
|
1857
|
-
export namespace atomic {
|
|
1858
|
-
/** Performs a wait operation on a 32-bit integer value in memory suspending this agent if the condition is met. */
|
|
1859
|
-
export function wait32(ptr: usize, expected: i32, timeout?: i64): AtomicWaitResult;
|
|
1860
|
-
/** Performs a wait operation on a 64-bit integer value in memory suspending this agent if the condition is met. */
|
|
1861
|
-
export function wait64(ptr: usize, expected: i64, timeout?: i64): AtomicWaitResult;
|
|
1862
|
-
}
|
|
1863
1665
|
}
|
|
1864
1666
|
|
|
1865
1667
|
/** Heap memory interface. */
|
|
@@ -1882,63 +1684,6 @@ declare namespace table {
|
|
|
1882
1684
|
export function copy(dest: u32, src: u32, n: u32): void;
|
|
1883
1685
|
}
|
|
1884
1686
|
|
|
1885
|
-
declare namespace Atomics {
|
|
1886
|
-
export function load<T extends i8 | u8 | i16 | u16 | i32 | u32 | i64 | u64>(array: TypedArray<T>, index: i32): T;
|
|
1887
|
-
export function store<T extends i8 | u8 | i16 | u16 | i32 | u32 | i64 | u64>(
|
|
1888
|
-
array: TypedArray<T>,
|
|
1889
|
-
index: i32,
|
|
1890
|
-
value: T
|
|
1891
|
-
): void;
|
|
1892
|
-
export function add<T extends i8 | u8 | i16 | u16 | i32 | u32 | i64 | u64>(
|
|
1893
|
-
array: TypedArray<T>,
|
|
1894
|
-
index: i32,
|
|
1895
|
-
value: T
|
|
1896
|
-
): T;
|
|
1897
|
-
export function sub<T extends i8 | u8 | i16 | u16 | i32 | u32 | i64 | u64>(
|
|
1898
|
-
array: TypedArray<T>,
|
|
1899
|
-
index: i32,
|
|
1900
|
-
value: T
|
|
1901
|
-
): T;
|
|
1902
|
-
export function and<T extends i8 | u8 | i16 | u16 | i32 | u32 | i64 | u64>(
|
|
1903
|
-
array: TypedArray<T>,
|
|
1904
|
-
index: i32,
|
|
1905
|
-
value: T
|
|
1906
|
-
): T;
|
|
1907
|
-
export function or<T extends i8 | u8 | i16 | u16 | i32 | u32 | i64 | u64>(
|
|
1908
|
-
array: TypedArray<T>,
|
|
1909
|
-
index: i32,
|
|
1910
|
-
value: T
|
|
1911
|
-
): T;
|
|
1912
|
-
export function xor<T extends i8 | u8 | i16 | u16 | i32 | u32 | i64 | u64>(
|
|
1913
|
-
array: TypedArray<T>,
|
|
1914
|
-
index: i32,
|
|
1915
|
-
value: T
|
|
1916
|
-
): T;
|
|
1917
|
-
export function exchange<T extends i8 | u8 | i16 | u16 | i32 | u32 | i64 | u64>(
|
|
1918
|
-
array: TypedArray<T>,
|
|
1919
|
-
index: i32,
|
|
1920
|
-
value: T
|
|
1921
|
-
): T;
|
|
1922
|
-
export function compareExchange<T extends i8 | u8 | i16 | u16 | i32 | u32 | i64 | u64>(
|
|
1923
|
-
array: TypedArray<T>,
|
|
1924
|
-
index: i32,
|
|
1925
|
-
expectedValue: T,
|
|
1926
|
-
replacementValue: T
|
|
1927
|
-
): T;
|
|
1928
|
-
export function wait<T extends i8 | u8 | i16 | u16 | i32 | u32 | i64 | u64>(
|
|
1929
|
-
array: TypedArray<T>,
|
|
1930
|
-
value: T,
|
|
1931
|
-
timeout?: i64
|
|
1932
|
-
): AtomicWaitResult;
|
|
1933
|
-
export function notify<T extends i8 | u8 | i16 | u16 | i32 | u32 | i64 | u64>(
|
|
1934
|
-
array: TypedArray<T>,
|
|
1935
|
-
index: i32,
|
|
1936
|
-
count?: i32
|
|
1937
|
-
): i32;
|
|
1938
|
-
/** The static Atomics.isLockFree() method is used to determine whether to use locks or atomic operations. It returns true, if the given size is one of the BYTES_PER_ELEMENT */
|
|
1939
|
-
export function isLockFree(size: usize): bool;
|
|
1940
|
-
}
|
|
1941
|
-
|
|
1942
1687
|
/** Class representing a generic, fixed-length raw binary data buffer. */
|
|
1943
1688
|
declare class ArrayBuffer {
|
|
1944
1689
|
/** The size, in bytes, of the array. */
|
|
@@ -2253,12 +1998,12 @@ declare class String implements Iterable<string> {
|
|
|
2253
1998
|
charCodeAt(index: i32): i32;
|
|
2254
1999
|
codePointAt(index: i32): i32;
|
|
2255
2000
|
concat(other: string): string;
|
|
2256
|
-
endsWith(other: string): bool;
|
|
2001
|
+
endsWith(other: string, position?: i32): bool;
|
|
2257
2002
|
indexOf(other: string, fromIndex?: i32): i32;
|
|
2258
2003
|
lastIndexOf(other: string, fromIndex?: i32): i32;
|
|
2259
2004
|
localeCompare(other: string): i32;
|
|
2260
2005
|
includes(other: string): bool;
|
|
2261
|
-
startsWith(other: string): bool;
|
|
2006
|
+
startsWith(other: string, position?: i32): bool;
|
|
2262
2007
|
substr(start: i32, length?: i32): string;
|
|
2263
2008
|
substring(start: i32, end?: i32): string;
|
|
2264
2009
|
trim(): string;
|
|
@@ -2395,6 +2140,8 @@ declare class URIError extends Error {}
|
|
|
2395
2140
|
interface Function {
|
|
2396
2141
|
/** Function table index. */
|
|
2397
2142
|
readonly index: u32;
|
|
2143
|
+
/** Function closure environment pointer. */
|
|
2144
|
+
readonly env: usize;
|
|
2398
2145
|
/** Function name. Always an empty string. */
|
|
2399
2146
|
readonly name: string;
|
|
2400
2147
|
/** Number of expected parameters. */
|
package/types/warpo/index.d.ts
CHANGED
|
@@ -23,3 +23,97 @@ declare module "warpo/utf8/const_str" {
|
|
|
23
23
|
}
|
|
24
24
|
function build(s: string): ConstStr;
|
|
25
25
|
}
|
|
26
|
+
|
|
27
|
+
declare module "warpo/test" {
|
|
28
|
+
export class MockFn {
|
|
29
|
+
constructor(originalFunctionIndex: u32, mockFunctionIndex: u32);
|
|
30
|
+
get calls(): u32;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
export class Value<T> {
|
|
34
|
+
get not(): this;
|
|
35
|
+
|
|
36
|
+
isNull(): this;
|
|
37
|
+
notNull(): this;
|
|
38
|
+
|
|
39
|
+
equal(checkValue: T): this;
|
|
40
|
+
notEqual(checkValue: T): this;
|
|
41
|
+
|
|
42
|
+
greaterThan(checkValue: T): this;
|
|
43
|
+
greaterThanOrEqual(checkValue: T): this;
|
|
44
|
+
lessThan(checkValue: T): this;
|
|
45
|
+
lessThanOrEqual(checkValue: T): this;
|
|
46
|
+
|
|
47
|
+
closeTo(checkValue: T, delta: number): this;
|
|
48
|
+
|
|
49
|
+
isa<ExpectType>(): this;
|
|
50
|
+
|
|
51
|
+
isExactly<ExpectType>(): this;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* describe a test group
|
|
56
|
+
* @param description common description of each test inside
|
|
57
|
+
* @param testsFunction can call multi-time test
|
|
58
|
+
*/
|
|
59
|
+
export function describe(description: string, testsFunction: () => void): void;
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* run a test
|
|
63
|
+
* @param name test name
|
|
64
|
+
* @param testFunction main function of test
|
|
65
|
+
*/
|
|
66
|
+
export function test(name: string, testFunction: () => void): void;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* setup function before each test
|
|
70
|
+
* must be called inside describe block
|
|
71
|
+
* @example
|
|
72
|
+
* ```ts
|
|
73
|
+
* describe("test group", () => {
|
|
74
|
+
* beforeEach(() => {
|
|
75
|
+
* // setup code
|
|
76
|
+
* });
|
|
77
|
+
* test("test case", () => {
|
|
78
|
+
* // test code
|
|
79
|
+
* });
|
|
80
|
+
* });
|
|
81
|
+
*/
|
|
82
|
+
export function beforeEach(func: () => void): void;
|
|
83
|
+
|
|
84
|
+
/**
|
|
85
|
+
* teardown function after each test
|
|
86
|
+
* must be called inside describe block
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* describe("test group", () => {
|
|
90
|
+
* afterEach(() => {
|
|
91
|
+
* // teardown code
|
|
92
|
+
* });
|
|
93
|
+
* test("test case", () => {
|
|
94
|
+
* // test code
|
|
95
|
+
* });
|
|
96
|
+
* });
|
|
97
|
+
*/
|
|
98
|
+
export function afterEach(func: () => void): void;
|
|
99
|
+
|
|
100
|
+
/**
|
|
101
|
+
* mock some function
|
|
102
|
+
* @param originalFunction function you want to mock
|
|
103
|
+
* @param mockFunction the new function.
|
|
104
|
+
* @returns MockFn with call information (e.g. via its `calls` property)
|
|
105
|
+
*/
|
|
106
|
+
export function mock<T extends Function>(originalFunction: T, mockFunction: T): MockFn;
|
|
107
|
+
|
|
108
|
+
/**
|
|
109
|
+
* unmock this function, can only be used in mocked function
|
|
110
|
+
*/
|
|
111
|
+
export function unmock<T extends Function>(originalFunction: T): void;
|
|
112
|
+
|
|
113
|
+
/**
|
|
114
|
+
* remock this function, can only be used in mocked function. Pair of {unmock}
|
|
115
|
+
*/
|
|
116
|
+
export function remock<T extends Function>(originalFunction: T): void;
|
|
117
|
+
|
|
118
|
+
export function expect<T>(value: T): Value<T>;
|
|
119
|
+
}
|