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
Some checks failed
Test, Build, and Deploy / test-build-deploy (push) Failing after 42s
This commit is contained in:
@@ -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))))
|
||||
|
||||
Reference in New Issue
Block a user