diff --git a/rune/Rune.test.ts b/rune/Rune.test.ts index 07d46e7bf..c2e8df93e 100644 --- a/rune/Rune.test.ts +++ b/rune/Rune.test.ts @@ -265,7 +265,7 @@ Deno.test("match abc", async () => { .when(is("a"), (x) => x.access("a")) .when(is("b"), (x) => x.access("b")) .else((x) => x.access("c")) - ).run() + ).run(new Scope()) assertEquals(+result, 0) } }) @@ -285,7 +285,7 @@ Deno.test("match u", async () => { ) ) .rehandle(is(String)) - .run(), + .run(new Scope()), "hello", ) }) diff --git a/rune/ValueRune.ts b/rune/ValueRune.ts index af26940de..ea5331835 100644 --- a/rune/ValueRune.ts +++ b/rune/ValueRune.ts @@ -181,14 +181,14 @@ class RunMatch extends Run { value conditions constructor( - batch: Batch, + scope: Scope, child: Rune, conditions: [(x: M) => boolean, ValueRune][], ) { - super(batch) - this.value = batch.prime(child, this.signal) + super(scope) + this.value = scope.prime(child, this.signal) this.conditions = conditions.map(([cond, val]) => - [cond, batch.prime(val, this.signal)] as const + [cond, scope.prime(val, this.signal)] as const ) }