Skip to content

Commit f68e855

Browse files
committed
FIX: DO script with error should throw the error and not just pass it as a result
fixes: Oldes/Rebol-issues#2425 related to: Oldes/Rebol-issues#2375
1 parent 2b1449b commit f68e855

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/mezz/sys-base.reb

+1
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@ do*: func [
9898
]
9999
; Restore system/script and the dir
100100
all [system/script: :scr dir change-dir dir]
101+
if error? :value [ do :value ]
101102
:value
102103
]
103104
]

src/tests/units/evaluation-test.r3

+2-1
Original file line numberDiff line numberDiff line change
@@ -81,8 +81,9 @@ Rebol [
8181
===start-group=== "do script"
8282
--test-- "script with error"
8383
;@@ https://github.com/Oldes/Rebol-issues/issues/2374
84+
;@@ https://github.com/Oldes/Rebol-issues/issues/2425
8485
dir: what-dir
85-
--assert error? do %units/files/error.r3
86+
--assert error? try [do %units/files/error.r3]
8687
--assert dir = what-dir
8788

8889
--test-- "script returning UNSET value"

0 commit comments

Comments
 (0)