DescriptionIDL: Fix exception handling when converting V8 value to union/dictionary
The toImpl() functions generated for union and dictionary types should
report exceptions via their ExceptionState argument. But internally, they
were doing value conversions using the TONATIVE_VOID_EXCEPTIONSTATE(),
TONATIVE_VOID_EXCEPTIONSTATE_ARGINTERNAL() and TOSTRING_VOID() macros,
that always throw exceptions all the way to V8 (in the TONATIVE_*() cases
by calling exceptionState.throwIfNeeded().)
To fix this, introduce _NOTHROW variants of the TONATIVE_*() macros, that
end with
if (exceptionState.hadException())
return;
instead of
if (exceptionState.throwIfNeeded())
return;
and use those instead, and use TOSTRING_VOID_EXCEPTIONSTATE() instead of
TOSTRING_VOID(). TOSTRING_VOID_EXCEPTIONSTATE(), unlike the
TONATIVE_*_EXCEPTIONSTATE() macros, does not throw exceptions all the way
to V8, but rather leaves them in the ExceptionState object.
BUG=240176, 321462
Patch Set 1 #
Messages
Total messages: 3 (1 generated)
|