access scope in liquidjs filter

HTML

<script src="https://cdn.jsdelivr.net/npm/liquidjs/dist/liquid.browser.min.js"></script>
<div id="log"></div>

JavaScript

const { Liquid, Hash } = liquidjs
const engine = new Liquid()

engine.registerTag('random', {
	parse(tagToken) {
    this.args = new Hash(tagToken.args)
  },
  * render(context, emitter) {
    const {from, to} = yield this.args.render(context)
    const toValue = yield this.liquid._evalValue(to, context)
    const length = toValue - from + 1
    const value = from + Math.floor(length * Math.random())
  	emitter.write([toValue,from,value].join())
  }
})

const tpl = `{% random from:2, to:'max|minus:2' %}`
const scope = { max: 10 }

engine.parseAndRender(tpl, scope).then(html => log(html))

function log(text) {
   document.querySelector("#log").innerText += text + '\n';
}