js-on-sx: fix RegExp test/exec calling nil when platform impl missing
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 42s

This commit is contained in:
2026-05-09 01:01:39 +00:00
parent 7c63fd8a7f
commit c8ab505c32
2 changed files with 10 additions and 8 deletions

View File

@@ -5391,10 +5391,10 @@
(= (len args) 0)
""
(js-to-string (nth args 0)))))
(if
(js-undefined? impl)
(js-regex-stub-test rx arg)
(impl rx arg))))
(cond
((or (js-undefined? impl) (= impl nil))
(js-regex-stub-test rx arg))
(else (impl rx arg)))))
((= name "exec")
(let
((impl (get __js_regex_platform__ "exec"))
@@ -5403,10 +5403,10 @@
(= (len args) 0)
""
(js-to-string (nth args 0)))))
(if
(js-undefined? impl)
(js-regex-stub-exec rx arg)
(impl rx arg))))
(cond
((or (js-undefined? impl) (= impl nil))
(js-regex-stub-exec rx arg))
(else (impl rx arg)))))
((= name "toString")
(str "/" (get rx "source") "/" (get rx "flags")))
(else js-undefined))))