diff --git a/lib/hyperscript/compiler.sx b/lib/hyperscript/compiler.sx index 67188e5e..ada765d4 100644 --- a/lib/hyperscript/compiler.sx +++ b/lib/hyperscript/compiler.sx @@ -1547,7 +1547,17 @@ (emit-set tgt (list (quote hs-empty-like) (hs-to-sx tgt)))) - (true (list (quote hs-empty-target!) (hs-to-sx tgt)))))) + (true + (if + (and (list? tgt) (= (first tgt) (quote query))) + (list + (quote for-each) + (list + (quote fn) + (list (quote _el)) + (list (quote hs-empty-target!) (quote _el))) + (list (quote hs-query-all) (nth tgt 1))) + (list (quote hs-empty-target!) (hs-to-sx tgt))))))) ((= head (quote open-element)) (list (quote hs-open!) (hs-to-sx (nth ast 1)))) ((= head (quote close-element)) diff --git a/shared/static/wasm/sx/hs-compiler.sx b/shared/static/wasm/sx/hs-compiler.sx index 67188e5e..ada765d4 100644 --- a/shared/static/wasm/sx/hs-compiler.sx +++ b/shared/static/wasm/sx/hs-compiler.sx @@ -1547,7 +1547,17 @@ (emit-set tgt (list (quote hs-empty-like) (hs-to-sx tgt)))) - (true (list (quote hs-empty-target!) (hs-to-sx tgt)))))) + (true + (if + (and (list? tgt) (= (first tgt) (quote query))) + (list + (quote for-each) + (list + (quote fn) + (list (quote _el)) + (list (quote hs-empty-target!) (quote _el))) + (list (quote hs-query-all) (nth tgt 1))) + (list (quote hs-empty-target!) (hs-to-sx tgt))))))) ((= head (quote open-element)) (list (quote hs-open!) (hs-to-sx (nth ast 1)))) ((= head (quote close-element))