Skip to content

Commit 51343b0

Browse files
sadym-chromiumMaksim Sadym
andauthored
Unify invalid script processing. (#242)
In case of invalid script, `script.callFunction` behaves as `script.evaluate` and returns successfull `ScriptEvaluateResultException` response with `exceptionDetails`. Co-authored-by: Maksim Sadym <[email protected]>
1 parent 50d5abe commit 51343b0

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

index.bs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4286,8 +4286,15 @@ The [=remote end steps=] with |command parameters| are:
42864286
1. Let |function body evaluation status| be the result of [=evaluate function body=]
42874287
(|function declaration|, |environment settings|, |base URL|, and |options|).
42884288

4289-
1. If |function body evaluation status|.\[[Type]] is <code>throw</code>, return [=error=] with
4290-
[=error code=] [=invalid argument=].
4289+
1. If |function body evaluation status|.\[[Type]] is <code>throw</code>:
4290+
4291+
1. Let |exception details| be the result of [=get exception details=] given
4292+
|realm|, |function body evaluation status| as |record| and |result ownership|
4293+
as |ownership type|.
4294+
4295+
1. Return a new map matching the <code>ScriptEvaluateResultException</code>
4296+
production, with the <code>exceptionDetails</code> field set to
4297+
|exception details|.
42914298

42924299
1. Let |function object| be |function body evaluation status|.\[[Value]].
42934300

0 commit comments

Comments
 (0)