@@ -520,6 +520,7 @@ abstract class JsRuntime {
520520 bool isJobPending();
521521 bool executePendingJob();
522522 MemoryUsage memoryUsage();
523+ void setDumpFlags({required BigInt flags});
523524 void setMemoryLimit({required BigInt limit});
524525 void setGcThreshold({required BigInt threshold});
525526 void setMaxStackSize({required BigInt limit});
@@ -541,7 +542,7 @@ abstract class JsContext {
541542### JsEngine
542543
543544``` dart
544- class JsEngine {
545+ abstract class JsEngine {
545546 static Future<JsEngine> create({
546547 JsBuiltinOptions? builtins,
547548 List<JsModule>? modules,
@@ -568,21 +569,43 @@ class JsEngine {
568569 Future<JsValue> evaluateBytecodeModule({required JsModuleBytecode module});
569570 Future<JsValue> evaluateScriptBytecode({required JsScriptBytecode script});
570571
572+ Future<bool> executePendingJob();
573+ Future<void> idle();
574+ Future<bool> isJobPending();
575+ Future<MemoryUsage> memoryUsage();
576+ Future<void> runGc();
577+ Future<void> setGcThreshold({required BigInt threshold});
578+ Future<void> setInfo({required String info});
579+ Future<void> setMaxStackSize({required BigInt limit});
580+ Future<void> setMemoryLimit({required BigInt limit});
571581 Future<void> close(); // drains pending runtime work, then runs GC
572582 bool get running;
573583 bool get closed;
574584}
575585```
576586
587+ ### JsEngineRuntimeOptions
588+
589+ ``` dart
590+ sealed class JsEngineRuntimeOptions {
591+ const factory JsEngineRuntimeOptions({
592+ BigInt? memoryLimit,
593+ BigInt? gcThreshold,
594+ BigInt? maxStackSize,
595+ String? info,
596+ });
597+ }
598+ ```
599+
577600### MemoryUsage
578601
579602``` dart
580603abstract class MemoryUsage {
581- int get totalMemory;
582- int get totalAllocations;
583- int get mallocSize;
584- int get objCount;
585- int get strCount;
604+ PlatformInt64 get totalMemory;
605+ PlatformInt64 get totalAllocations;
606+ PlatformInt64 get mallocSize;
607+ PlatformInt64 get objCount;
608+ PlatformInt64 get strCount;
586609 String summary();
587610}
588611```
@@ -615,6 +638,7 @@ sealed class JsValue {
615638``` dart
616639sealed class JsBuiltinOptions {
617640 const factory JsBuiltinOptions({
641+ bool? assert_,
618642 bool? console,
619643 bool? fetch,
620644 bool? timers,
@@ -680,7 +704,7 @@ sealed class JsScriptBytecode {
680704 factory JsScriptBytecode({required String name, required List<int> bytes});
681705}
682706
683- class JsBytecode {
707+ abstract class JsBytecode {
684708 static JsModuleBytecode compileSync({
685709 required JsModule module,
686710 JsModuleBytecodeOptions? options,
@@ -801,7 +825,7 @@ Some builtin options expose importable modules, and some install globals directl
801825| Option | Description |
802826| --------| -------------|
803827| ` abort ` | ` AbortController ` and abort-related globals |
804- | ` assert ` | Assertion helpers |
828+ | ` assert_ ` | Assertion helpers |
805829| ` asyncHooks ` | Async lifecycle tracking |
806830| ` buffer ` | Buffer utilities for binary data |
807831| ` childProcess ` | Child process spawning |
0 commit comments