Use 'exceptionCode' when converting to DOMString.

This change allows us to use the code even in cases where we return a
Result type rather than a JSBool. Interface, primitive and union types
already get this right.
This commit is contained in:
Ms2ger 2014-04-18 14:34:47 +02:00
parent 58efe0bf75
commit 8e596d142e

View file

@ -670,8 +670,8 @@ def getJSToNativeConversionTemplate(type, descriptorProvider, failureCode=None,
conversionCode = (
"match FromJSValConvertible::from_jsval(cx, ${val}, %s) {\n"
" Ok(strval) => ${declName} = %s,\n"
" Err(_) => return 0,\n"
"}" % (nullBehavior, strval))
" Err(_) => { %s },\n"
"}" % (nullBehavior, strval, exceptionCode))
if defaultValue is None:
return conversionCode