From 978786462acf4956e6bc57cb4a497b1bda229522 Mon Sep 17 00:00:00 2001 From: Dmitry Iv Date: Sun, 12 Nov 2023 21:26:02 -0500 Subject: [PATCH] Fix example --- test/subscript.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test/subscript.js b/test/subscript.js index c221fe5..d6fc024 100644 --- a/test/subscript.js +++ b/test/subscript.js @@ -446,12 +446,15 @@ test('ext: justin', async t => { test('ext: assignment', async t => { binary('=', 10, true) - operator('=', (a, b) => ctx => ctx[a] = ctx[b]) + operator('=', (a, b) => { + const calc = compile(b); + return ctx => (ctx[a] = calc(ctx)) + }) - const fn = subscript('a = b') + const fn = subscript('a = b * 2') let state = { b: 1 } fn(state) - is(state, { a: 1, b: 1 }) + is(state, { a: 2, b: 1 }) }) test('ext: comments', t => {