<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[193101] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/193101">193101</a></dd>
<dt>Author</dt> <dd>beidson@apple.com</dd>
<dt>Date</dt> <dd>2015-12-03 10:46:51 -0800 (Thu, 03 Dec 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Add GetterRaisesExceptionWithMessage and SetterRaisesExceptionWithMessage to the code generator.
https://bugs.webkit.org/show_bug.cgi?id=151807
Reviewed by Alex Christensen.
No new tests (Covered by changes to existing bindings tests).
While we're at it, rework the existing 'RaisesExceptionWithMessage' concept to use a struct instead of
two separate variables to reduce complexity.
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateImplementation):
(GenerateImplementationFunctionCall):
(GenerateConstructorDefinition):
(GenerateParametersCheck): Deleted.
(GenerateReturnParameters): Deleted.
* bindings/scripts/IDLAttributes.txt:
* bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
(webkit_dom_test_obj_set_property):
(webkit_dom_test_obj_get_property):
(webkit_dom_test_obj_class_init):
(webkit_dom_test_obj_get_attr_with_getter_exception_with_message):
(webkit_dom_test_obj_set_attr_with_getter_exception_with_message):
(webkit_dom_test_obj_get_attr_with_setter_exception_with_message):
(webkit_dom_test_obj_set_attr_with_setter_exception_with_message):
* bindings/scripts/test/GObject/WebKitDOMTestObj.h:
* bindings/scripts/test/JS/JSTestObj.cpp:
(WebCore::jsTestObjAttrWithGetterExceptionWithMessage):
(WebCore::jsTestObjAttrWithSetterExceptionWithMessage):
(WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
(WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
(WebCore::jsTestObjPrototypeFunctionMethodWithExceptionWithMessage):
* bindings/scripts/test/ObjC/DOMTestObj.h:
* bindings/scripts/test/ObjC/DOMTestObj.mm:
(-[DOMTestObj attrWithGetterExceptionWithMessage]):
(-[DOMTestObj setAttrWithGetterExceptionWithMessage:]):
(-[DOMTestObj attrWithSetterExceptionWithMessage]):
(-[DOMTestObj setAttrWithSetterExceptionWithMessage:]):
* bindings/scripts/test/TestObj.idl:
* dom/ExceptionCode.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsIDLAttributestxt">trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestObjh">trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestObjCDOMTestObjh">trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestObjCDOMTestObjmm">trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestTestObjidl">trunk/Source/WebCore/bindings/scripts/test/TestObj.idl</a></li>
<li><a href="#trunkSourceWebCoredomExceptionCodeh">trunk/Source/WebCore/dom/ExceptionCode.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (193100 => 193101)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-12-03 18:46:48 UTC (rev 193100)
+++ trunk/Source/WebCore/ChangeLog        2015-12-03 18:46:51 UTC (rev 193101)
</span><span class="lines">@@ -1,3 +1,52 @@
</span><ins>+2015-12-03 Brady Eidson <beidson@apple.com>
+
+ Add GetterRaisesExceptionWithMessage and SetterRaisesExceptionWithMessage to the code generator.
+ https://bugs.webkit.org/show_bug.cgi?id=151807
+
+ Reviewed by Alex Christensen.
+
+ No new tests (Covered by changes to existing bindings tests).
+
+ While we're at it, rework the existing 'RaisesExceptionWithMessage' concept to use a struct instead of
+ two separate variables to reduce complexity.
+
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateImplementation):
+ (GenerateImplementationFunctionCall):
+ (GenerateConstructorDefinition):
+ (GenerateParametersCheck): Deleted.
+ (GenerateReturnParameters): Deleted.
+
+ * bindings/scripts/IDLAttributes.txt:
+
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.cpp:
+ (webkit_dom_test_obj_set_property):
+ (webkit_dom_test_obj_get_property):
+ (webkit_dom_test_obj_class_init):
+ (webkit_dom_test_obj_get_attr_with_getter_exception_with_message):
+ (webkit_dom_test_obj_set_attr_with_getter_exception_with_message):
+ (webkit_dom_test_obj_get_attr_with_setter_exception_with_message):
+ (webkit_dom_test_obj_set_attr_with_setter_exception_with_message):
+ * bindings/scripts/test/GObject/WebKitDOMTestObj.h:
+
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ (WebCore::jsTestObjAttrWithGetterExceptionWithMessage):
+ (WebCore::jsTestObjAttrWithSetterExceptionWithMessage):
+ (WebCore::setJSTestObjAttrWithGetterExceptionWithMessage):
+ (WebCore::setJSTestObjAttrWithSetterExceptionWithMessage):
+ (WebCore::jsTestObjPrototypeFunctionMethodWithExceptionWithMessage):
+ * bindings/scripts/test/ObjC/DOMTestObj.h:
+
+ * bindings/scripts/test/ObjC/DOMTestObj.mm:
+ (-[DOMTestObj attrWithGetterExceptionWithMessage]):
+ (-[DOMTestObj setAttrWithGetterExceptionWithMessage:]):
+ (-[DOMTestObj attrWithSetterExceptionWithMessage]):
+ (-[DOMTestObj setAttrWithSetterExceptionWithMessage:]):
+
+ * bindings/scripts/test/TestObj.idl:
+
+ * dom/ExceptionCode.h:
+
</ins><span class="cx"> 2015-12-03 Javier Fernandez <jfernandez@igalia.com>
</span><span class="cx">
</span><span class="cx"> [css-grid] margin-left:auto and margin-top:auto discards the margin on opposite side
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (193100 => 193101)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-12-03 18:46:48 UTC (rev 193100)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2015-12-03 18:46:51 UTC (rev 193101)
</span><span class="lines">@@ -2281,8 +2281,13 @@
</span><span class="cx"> $codeGenerator->AssertNotSequenceType($type);
</span><span class="cx"> my $getFunctionName = GetAttributeGetterName($interfaceName, $className, $interface, $attribute);
</span><span class="cx"> my $implGetterFunctionName = $codeGenerator->WK_lcfirst($attribute->signature->extendedAttributes->{"ImplementedAs"} || $name);
</span><del>- my $getterExceptions = $attribute->signature->extendedAttributes->{"GetterRaisesException"};
</del><ins>+ my $getterExceptionsWithMessage = $attribute->signature->extendedAttributes->{"GetterRaisesExceptionWithMessage"};
+ my $getterExceptions = $attribute->signature->extendedAttributes->{"GetterRaisesException"} || $getterExceptionsWithMessage;
</ins><span class="cx">
</span><ins>+ if ($getterExceptions) {
+ $implIncludes{"ExceptionCode.h"} = 1;
+ }
+
</ins><span class="cx"> my $attributeConditionalString = $codeGenerator->GenerateConditionalString($attribute->signature);
</span><span class="cx"> push(@implContent, "#if ${attributeConditionalString}\n") if $attributeConditionalString;
</span><span class="cx">
</span><span class="lines">@@ -2315,7 +2320,11 @@
</span><span class="cx"> my @arguments = ();
</span><span class="cx"> if ($getterExceptions && !HasCustomGetter($attribute->signature->extendedAttributes)) {
</span><span class="cx"> push(@arguments, "ec");
</span><del>- push(@implContent, " ExceptionCode ec = 0;\n");
</del><ins>+ if ($getterExceptionsWithMessage) {
+ push(@implContent, " ExceptionCodeWithMessage ec;\n");
+ } else {
+ push(@implContent, " ExceptionCode ec = 0;\n");
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> # Global constructors can be disabled at runtime.
</span><span class="lines">@@ -2359,7 +2368,7 @@
</span><span class="cx">
</span><span class="cx"> my $nativeType = GetNativeType($type);
</span><span class="cx"> my $memoizedType = GetNativeTypeForMemoization($type);
</span><del>- my $exceptionCode = $getterExceptions ? "ec" : "0";
</del><ins>+ my $exceptionCode = $getterExceptionsWithMessage ? "ec.code" : ($getterExceptions ? "ec" : "0");
</ins><span class="cx"> push(@implContent, " static NeverDestroyed<const AtomicString> bindingName(\"$interfaceName.$name\", AtomicString::ConstructFromLiteral);\n");
</span><span class="cx"> push(@implContent, " if (cursor.isCapturing()) {\n");
</span><span class="cx"> push(@implContent, " $memoizedType memoizedResult = castedThis->wrapped().$implGetterFunctionName(" . join(", ", @arguments) . ");\n");
</span><span class="lines">@@ -2408,7 +2417,7 @@
</span><span class="cx"> AddToImplIncludes("JS" . $constructorType . ".h", $attribute->signature->extendedAttributes->{"Conditional"});
</span><span class="cx"> push(@implContent, " return JSValue::encode(JS" . $constructorType . "::getConstructor(state->vm(), castedThis->globalObject()));\n");
</span><span class="cx"> }
</span><del>- } elsif (!$attribute->signature->extendedAttributes->{"GetterRaisesException"}) {
</del><ins>+ } elsif (!$attribute->signature->extendedAttributes->{"GetterRaisesException"} && !$attribute->signature->extendedAttributes->{"GetterRaisesExceptionWithMessage"}) {
</ins><span class="cx"> my $cacheIndex = 0;
</span><span class="cx"> if ($attribute->signature->extendedAttributes->{"CachedAttribute"}) {
</span><span class="cx"> $cacheIndex = $currentCachedAttribute;
</span><span class="lines">@@ -2606,8 +2615,13 @@
</span><span class="cx"> my $type = $attribute->signature->type;
</span><span class="cx"> my $putFunctionName = GetAttributeSetterName($interfaceName, $className, $interface, $attribute);
</span><span class="cx"> my $implSetterFunctionName = $codeGenerator->WK_ucfirst($name);
</span><del>- my $setterRaisesException = $attribute->signature->extendedAttributes->{"SetterRaisesException"};
</del><ins>+ my $setterRaisesExceptionWithMessage = $attribute->signature->extendedAttributes->{"SetterRaisesExceptionWithMessage"};
+ my $setterRaisesException = $attribute->signature->extendedAttributes->{"SetterRaisesException"} || $setterRaisesExceptionWithMessage;
</ins><span class="cx">
</span><ins>+ if ($setterRaisesException) {
+ $implIncludes{"ExceptionCode.h"} = 1;
+ }
+
</ins><span class="cx"> my $attributeConditionalString = $codeGenerator->GenerateConditionalString($attribute->signature);
</span><span class="cx"> push(@implContent, "#if ${attributeConditionalString}\n") if $attributeConditionalString;
</span><span class="cx">
</span><span class="lines">@@ -2702,7 +2716,11 @@
</span><span class="cx"> push(@implContent, " auto& impl = castedThis->wrapped();\n");
</span><span class="cx"> }
</span><span class="cx"> }
</span><del>- push(@implContent, " ExceptionCode ec = 0;\n") if $setterRaisesException;
</del><ins>+ if ($setterRaisesExceptionWithMessage) {
+ push(@implContent, " ExceptionCodeWithMessage ec;\n");
+ } elsif ($setterRaisesException) {
+ push(@implContent, " ExceptionCode ec = 0;\n");
+ }
</ins><span class="cx">
</span><span class="cx"> # If the "StrictTypeChecking" extended attribute is present, and the attribute's type is an
</span><span class="cx"> # interface type, then if the incoming value does not implement that interface, a TypeError
</span><span class="lines">@@ -2760,7 +2778,10 @@
</span><span class="cx"> push(@implContent, " setDOMException(state, ec);\n") if $setterRaisesException;
</span><span class="cx"> }
</span><span class="cx"> if ($svgPropertyType) {
</span><del>- if ($setterRaisesException) {
</del><ins>+ if ($setterRaisesExceptionWithMessage) {
+ push(@implContent, " if (!ec.code)\n");
+ push(@implContent, " impl.commitChange();\n");
+ } elsif ($setterRaisesException) {
</ins><span class="cx"> push(@implContent, " if (!ec)\n");
</span><span class="cx"> push(@implContent, " impl.commitChange();\n");
</span><span class="cx"> } else {
</span><span class="lines">@@ -2850,9 +2871,11 @@
</span><span class="cx">
</span><span class="cx"> my $isCustom = HasCustomMethod($function->signature->extendedAttributes);
</span><span class="cx"> my $isOverloaded = $function->{overloads} && @{$function->{overloads}} > 1;
</span><del>- my $raisesException = $function->signature->extendedAttributes->{"RaisesException"};
</del><ins>+
+ die "RaisesException and RaisesExceptionWithMessage are mutually exclusive" if $function->signature->extendedAttributes->{"RaisesException"} && $function->signature->extendedAttributes->{"RaisesExceptionWithMessage"};
+
</ins><span class="cx"> my $raisesExceptionWithMessage = $function->signature->extendedAttributes->{"RaisesExceptionWithMessage"};
</span><del>- die "RaisesException and RaisesExceptionWithMessage are mutually exclusive" if $raisesException && $raisesExceptionWithMessage;
</del><ins>+ my $raisesException = $function->signature->extendedAttributes->{"RaisesException"} || $raisesExceptionWithMessage;
</ins><span class="cx">
</span><span class="cx"> next if $isCustom && $isOverloaded && $function->{overloadIndex} > 1;
</span><span class="cx">
</span><span class="lines">@@ -2904,8 +2927,11 @@
</span><span class="cx"> } else {
</span><span class="cx"> GenerateArgumentsCountCheck(\@implContent, $function, $interface);
</span><span class="cx">
</span><del>- push(@implContent, " ExceptionCode ec = 0;\n") if $raisesException || $raisesExceptionWithMessage;
- push(@implContent, " String exceptionMessage;\n") if $raisesExceptionWithMessage;
</del><ins>+ if ($raisesExceptionWithMessage) {
+ push(@implContent, " ExceptionCodeWithMessage ec;\n");
+ } elsif ($raisesException) {
+ push(@implContent, " ExceptionCode ec = 0;\n");
+ }
</ins><span class="cx">
</span><span class="cx"> my $numParameters = @{$function->parameters};
</span><span class="cx"> my ($functionString, $dummy) = GenerateParametersCheck(\@implContent, $function, $interface, $numParameters, $interfaceName, $functionImplementationName, $svgPropertyType, $svgPropertyOrListPropertyType, $svgListPropertyType);
</span><span class="lines">@@ -2941,11 +2967,14 @@
</span><span class="cx"> } else {
</span><span class="cx"> GenerateArgumentsCountCheck(\@implContent, $function, $interface);
</span><span class="cx">
</span><del>- push(@implContent, " ExceptionCode ec = 0;\n") if $raisesException || $raisesExceptionWithMessage;
- push(@implContent, " String exceptionMessage;\n") if $raisesExceptionWithMessage;
</del><ins>+ if ($raisesExceptionWithMessage) {
+ push(@implContent, " ExceptionCodeWithMessage ec;\n");
+ } elsif ($raisesException) {
+ push(@implContent, " ExceptionCode ec = 0;\n");
+ }
</ins><span class="cx">
</span><span class="cx"> if ($function->signature->extendedAttributes->{"CheckSecurityForNode"}) {
</span><del>- push(@implContent, " if (!shouldAllowAccessToNode(state, impl." . $function->signature->name . "(" . ($raisesException ? "ec" : $raisesExceptionWithMessage ? "ec, exceptionMessage" : "") .")))\n");
</del><ins>+ push(@implContent, " if (!shouldAllowAccessToNode(state, impl." . $function->signature->name . "(" . ($raisesException ? "ec" : "") .")))\n");
</ins><span class="cx"> push(@implContent, " return JSValue::encode(jsNull());\n");
</span><span class="cx"> $implIncludes{"JSDOMBinding.h"} = 1;
</span><span class="cx"> }
</span><span class="lines">@@ -3292,8 +3321,6 @@
</span><span class="cx">
</span><span class="cx"> my $argsIndex = 0;
</span><span class="cx"> my $hasOptionalArguments = 0;
</span><del>- my $raisesException = $function->signature->extendedAttributes->{"RaisesException"};
- my $raisesExceptionWithMessage = $function->signature->extendedAttributes->{"RaisesExceptionWithMessage"};
</del><span class="cx">
</span><span class="cx"> my $className = $interface->name;
</span><span class="cx"> my @arguments;
</span><span class="lines">@@ -3539,7 +3566,6 @@
</span><span class="cx">
</span><span class="cx"> push(@arguments, "DeferredWrapper(state, castedThis->globalObject(), promiseDeferred)") if IsReturningPromise($function);
</span><span class="cx"> push(@arguments, "ec") if $function->signature->extendedAttributes->{"RaisesException"} || $function->signature->extendedAttributes->{"RaisesExceptionWithMessage"};
</span><del>- push(@arguments, "exceptionMessage") if $function->signature->extendedAttributes->{"RaisesExceptionWithMessage"};
</del><span class="cx"> return @arguments;
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -3821,8 +3847,8 @@
</span><span class="cx"> my $interfaceName = shift;
</span><span class="cx">
</span><span class="cx"> my $nondeterministic = $function->signature->extendedAttributes->{"Nondeterministic"};
</span><del>- my $raisesException = $function->signature->extendedAttributes->{"RaisesException"};
</del><span class="cx"> my $raisesExceptionWithMessage = $function->signature->extendedAttributes->{"RaisesExceptionWithMessage"};
</span><ins>+ my $raisesException = $function->signature->extendedAttributes->{"RaisesException"} || $raisesExceptionWithMessage;
</ins><span class="cx">
</span><span class="cx"> if ($function->signature->type eq "void" || IsReturningPromise($function)) {
</span><span class="cx"> if ($nondeterministic) {
</span><span class="lines">@@ -3832,23 +3858,23 @@
</span><span class="cx"> push(@implContent, $indent . "if (!cursor.isReplaying()) {\n");
</span><span class="cx"> push(@implContent, $indent . " $functionString;\n");
</span><span class="cx"> push(@implContent, $indent . " setDOMException(state, ec);\n") if $raisesException;
</span><del>- push(@implContent, $indent . " setDOMException(state, ec, exceptionMessage);\n") if $raisesExceptionWithMessage;
</del><span class="cx"> push(@implContent, $indent . "}\n");
</span><span class="cx"> push(@implContent, "#else\n");
</span><span class="cx"> push(@implContent, $indent . "$functionString;\n");
</span><span class="cx"> push(@implContent, $indent . "setDOMException(state, ec);\n") if $raisesException;
</span><del>- push(@implContent, $indent . "setDOMException(state, ec, exceptionMessage);\n") if $raisesExceptionWithMessage;
</del><span class="cx"> push(@implContent, "#endif\n");
</span><span class="cx"> } else {
</span><span class="cx"> push(@implContent, $indent . "$functionString;\n");
</span><span class="cx"> push(@implContent, $indent . "setDOMException(state, ec);\n") if $raisesException;
</span><del>- push(@implContent, $indent . "setDOMException(state, ec, exceptionMessage);\n") if $raisesExceptionWithMessage;
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($svgPropertyType and !$function->isStatic) {
</span><del>- if ($raisesException || $raisesExceptionWithMessage) {
- push(@implContent, $indent . "if (!ec)\n");
</del><ins>+ if ($raisesExceptionWithMessage) {
+ push(@implContent, $indent . "if (!ec.code)\n");
</ins><span class="cx"> push(@implContent, $indent . " impl.commitChange();\n");
</span><ins>+ } elsif ($raisesException) {
+ push(@implContent, $indent . "if (!ec)\n");
+ push(@implContent, $indent . " impl.commitChange();\n");
</ins><span class="cx"> } else {
</span><span class="cx"> push(@implContent, $indent . "impl.commitChange();\n");
</span><span class="cx"> }
</span><span class="lines">@@ -3871,7 +3897,7 @@
</span><span class="cx"> push(@implContent, $indent . "static NeverDestroyed<const AtomicString> bindingName(\"$bindingName\", AtomicString::ConstructFromLiteral);\n");
</span><span class="cx"> push(@implContent, $indent . "if (cursor.isCapturing()) {\n");
</span><span class="cx"> push(@implContent, $indent . " $nativeType memoizedResult = $functionString;\n");
</span><del>- my $exceptionCode = $raisesException || $raisesExceptionWithMessage ? "ec" : "0";
</del><ins>+ my $exceptionCode = $raisesExceptionWithMessage ? "ec.code" : ($raisesException ? "ec" : "0");
</ins><span class="cx"> push(@implContent, $indent . " cursor.appendInput<MemoizedDOMResult<$memoizedType>>(bindingName.get().string(), memoizedResult, $exceptionCode);\n");
</span><span class="cx"> push(@implContent, $indent . " result = " . NativeToJSValue($function->signature, 1, $interfaceName, "memoizedResult", $thisObject) . ";\n");
</span><span class="cx"> push(@implContent, $indent . "} else if (cursor.isReplaying()) {\n");
</span><span class="lines">@@ -3880,7 +3906,8 @@
</span><span class="cx"> # FIXME: the generated code should report an error if an input cannot be fetched or converted.
</span><span class="cx"> push(@implContent, $indent . " if (input && input->convertTo<$memoizedType>(memoizedResult)) {\n");
</span><span class="cx"> push(@implContent, $indent . " result = " . NativeToJSValue($function->signature, 1, $interfaceName, "memoizedResult", $thisObject) . ";\n");
</span><del>- push(@implContent, $indent . " ec = input->exceptionCode();\n") if $raisesException || $raisesExceptionWithMessage;
</del><ins>+ push(@implContent, $indent . " ec.code = input->exceptionCode();\n") if $raisesExceptionWithMessage;
+ push(@implContent, $indent . " ec = input->exceptionCode();\n") if $raisesException && !$raisesExceptionWithMessage;
</ins><span class="cx"> push(@implContent, $indent . " } else\n");
</span><span class="cx"> push(@implContent, $indent . " result = " . NativeToJSValue($function->signature, 1, $interfaceName, $functionString, $thisObject) . ";\n");
</span><span class="cx"> push(@implContent, $indent . "} else\n");
</span><span class="lines">@@ -3892,7 +3919,6 @@
</span><span class="cx"> push(@implContent, $indent . "JSValue result = " . NativeToJSValue($function->signature, 1, $interfaceName, $functionString, $thisObject) . ";\n");
</span><span class="cx"> }
</span><span class="cx"> push(@implContent, "\n" . $indent . "setDOMException(state, ec);\n") if $raisesException;
</span><del>- push(@implContent, "\n" . $indent . "setDOMException(state, ec, exceptionMessage);\n") if $raisesExceptionWithMessage;
</del><span class="cx">
</span><span class="cx"> if ($codeGenerator->ExtendedAttributeContains($function->signature->extendedAttributes->{"CallWith"}, "ScriptState")) {
</span><span class="cx"> push(@implContent, $indent . "if (UNLIKELY(state->hadException()))\n");
</span><span class="lines">@@ -4798,8 +4824,11 @@
</span><span class="cx">
</span><span class="cx"> if ($function->signature->extendedAttributes->{"RaisesException"} || $function->signature->extendedAttributes->{"RaisesExceptionWithMessage"} || $interface->extendedAttributes->{"ConstructorRaisesException"}) {
</span><span class="cx"> $implIncludes{"ExceptionCode.h"} = 1;
</span><del>- push(@$outputArray, " ExceptionCode ec = 0;\n");
- push(@$outputArray, " String exceptionMessage;\n") if $function->signature->extendedAttributes->{"RaisesExceptionWithMessage"};
</del><ins>+ if ($function->signature->extendedAttributes->{"RaisesExceptionWithMessage"}) {
+ push(@$outputArray, " ExceptionCodeWithMessage ec;\n");
+ } else {
+ push(@$outputArray, " ExceptionCode ec = 0;\n");
+ }
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> # FIXME: For now, we do not support SVG constructors.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsIDLAttributestxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt (193100 => 193101)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2015-12-03 18:46:48 UTC (rev 193100)
+++ trunk/Source/WebCore/bindings/scripts/IDLAttributes.txt        2015-12-03 18:46:51 UTC (rev 193101)
</span><span class="lines">@@ -65,6 +65,7 @@
</span><span class="cx"> ForwardDeclareInHeader
</span><span class="cx"> GenerateIsReachable=|Impl|ImplWebGLRenderingContext|ImplDocument|ImplElementRoot|ImplFrame|ImplOwnerNodeRoot
</span><span class="cx"> GetterRaisesException
</span><ins>+GetterRaisesExceptionWithMessage
</ins><span class="cx"> GlobalContext=DOMWindow|WorkerGlobalScope|DedicatedWorkerGlobalScope
</span><span class="cx"> Immutable
</span><span class="cx"> ImplementationLacksVTable
</span><span class="lines">@@ -112,6 +113,7 @@
</span><span class="cx"> ReportExtraMemoryCost
</span><span class="cx"> RequiresExistingAtomicString
</span><span class="cx"> SetterRaisesException
</span><ins>+SetterRaisesExceptionWithMessage
</ins><span class="cx"> SetterCallWith=ScriptExecutionContext|ScriptState|ScriptArguments|CallStack|ActiveWindow|FirstWindow
</span><span class="cx"> SkipVTableValidation
</span><span class="cx"> StrictTypeChecking
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp (193100 => 193101)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp        2015-12-03 18:46:48 UTC (rev 193100)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.cpp        2015-12-03 18:46:51 UTC (rev 193101)
</span><span class="lines">@@ -102,7 +102,9 @@
</span><span class="cx"> PROP_REFLECTED_CUSTOM_BOOLEAN_ATTR,
</span><span class="cx"> PROP_REFLECTED_CUSTOM_URL_ATTR,
</span><span class="cx"> PROP_ATTR_WITH_GETTER_EXCEPTION,
</span><ins>+ PROP_ATTR_WITH_GETTER_EXCEPTION_WITH_MESSAGE,
</ins><span class="cx"> PROP_ATTR_WITH_SETTER_EXCEPTION,
</span><ins>+ PROP_ATTR_WITH_SETTER_EXCEPTION_WITH_MESSAGE,
</ins><span class="cx"> PROP_STRING_ATTR_WITH_GETTER_EXCEPTION,
</span><span class="cx"> PROP_STRING_ATTR_WITH_SETTER_EXCEPTION,
</span><span class="cx"> PROP_STRICT_TYPE_CHECKING_ATTRIBUTE,
</span><span class="lines">@@ -211,9 +213,15 @@
</span><span class="cx"> case PROP_ATTR_WITH_GETTER_EXCEPTION:
</span><span class="cx"> webkit_dom_test_obj_set_attr_with_getter_exception(self, g_value_get_long(value));
</span><span class="cx"> break;
</span><ins>+ case PROP_ATTR_WITH_GETTER_EXCEPTION_WITH_MESSAGE:
+ webkit_dom_test_obj_set_attr_with_getter_exception_with_message(self, g_value_get_long(value));
+ break;
</ins><span class="cx"> case PROP_ATTR_WITH_SETTER_EXCEPTION:
</span><span class="cx"> webkit_dom_test_obj_set_attr_with_setter_exception(self, g_value_get_long(value), nullptr);
</span><span class="cx"> break;
</span><ins>+ case PROP_ATTR_WITH_SETTER_EXCEPTION_WITH_MESSAGE:
+ webkit_dom_test_obj_set_attr_with_setter_exception_with_message(self, g_value_get_long(value));
+ break;
</ins><span class="cx"> case PROP_STRING_ATTR_WITH_GETTER_EXCEPTION:
</span><span class="cx"> webkit_dom_test_obj_set_string_attr_with_getter_exception(self, g_value_get_string(value));
</span><span class="cx"> break;
</span><span class="lines">@@ -327,9 +335,15 @@
</span><span class="cx"> case PROP_ATTR_WITH_GETTER_EXCEPTION:
</span><span class="cx"> g_value_set_long(value, webkit_dom_test_obj_get_attr_with_getter_exception(self, nullptr));
</span><span class="cx"> break;
</span><ins>+ case PROP_ATTR_WITH_GETTER_EXCEPTION_WITH_MESSAGE:
+ g_value_set_long(value, webkit_dom_test_obj_get_attr_with_getter_exception_with_message(self));
+ break;
</ins><span class="cx"> case PROP_ATTR_WITH_SETTER_EXCEPTION:
</span><span class="cx"> g_value_set_long(value, webkit_dom_test_obj_get_attr_with_setter_exception(self));
</span><span class="cx"> break;
</span><ins>+ case PROP_ATTR_WITH_SETTER_EXCEPTION_WITH_MESSAGE:
+ g_value_set_long(value, webkit_dom_test_obj_get_attr_with_setter_exception_with_message(self));
+ break;
</ins><span class="cx"> case PROP_STRING_ATTR_WITH_GETTER_EXCEPTION:
</span><span class="cx"> g_value_take_string(value, webkit_dom_test_obj_get_string_attr_with_getter_exception(self, nullptr));
</span><span class="cx"> break;
</span><span class="lines">@@ -700,6 +714,16 @@
</span><span class="cx">
</span><span class="cx"> g_object_class_install_property(
</span><span class="cx"> gobjectClass,
</span><ins>+ PROP_ATTR_WITH_GETTER_EXCEPTION_WITH_MESSAGE,
+ g_param_spec_long(
+ "attr-with-getter-exception-with-message",
+ "TestObj:attr-with-getter-exception-with-message",
+ "read-write glong TestObj:attr-with-getter-exception-with-message",
+ G_MINLONG, G_MAXLONG, 0,
+ WEBKIT_PARAM_READWRITE));
+
+ g_object_class_install_property(
+ gobjectClass,
</ins><span class="cx"> PROP_ATTR_WITH_SETTER_EXCEPTION,
</span><span class="cx"> g_param_spec_long(
</span><span class="cx"> "attr-with-setter-exception",
</span><span class="lines">@@ -710,6 +734,16 @@
</span><span class="cx">
</span><span class="cx"> g_object_class_install_property(
</span><span class="cx"> gobjectClass,
</span><ins>+ PROP_ATTR_WITH_SETTER_EXCEPTION_WITH_MESSAGE,
+ g_param_spec_long(
+ "attr-with-setter-exception-with-message",
+ "TestObj:attr-with-setter-exception-with-message",
+ "read-write glong TestObj:attr-with-setter-exception-with-message",
+ G_MINLONG, G_MAXLONG, 0,
+ WEBKIT_PARAM_READWRITE));
+
+ g_object_class_install_property(
+ gobjectClass,
</ins><span class="cx"> PROP_STRING_ATTR_WITH_GETTER_EXCEPTION,
</span><span class="cx"> g_param_spec_string(
</span><span class="cx"> "string-attr-with-getter-exception",
</span><span class="lines">@@ -1997,6 +2031,23 @@
</span><span class="cx"> item->setAttrWithGetterException(value);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+glong webkit_dom_test_obj_get_attr_with_getter_exception_with_message(WebKitDOMTestObj* self)
+{
+ WebCore::JSMainThreadNullState state;
+ g_return_val_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self), 0);
+ WebCore::TestObj* item = WebKit::core(self);
+ glong result = item->attrWithGetterExceptionWithMessage();
+ return result;
+}
+
+void webkit_dom_test_obj_set_attr_with_getter_exception_with_message(WebKitDOMTestObj* self, glong value)
+{
+ WebCore::JSMainThreadNullState state;
+ g_return_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self));
+ WebCore::TestObj* item = WebKit::core(self);
+ item->setAttrWithGetterExceptionWithMessage(value);
+}
+
</ins><span class="cx"> glong webkit_dom_test_obj_get_attr_with_setter_exception(WebKitDOMTestObj* self)
</span><span class="cx"> {
</span><span class="cx"> WebCore::JSMainThreadNullState state;
</span><span class="lines">@@ -2020,6 +2071,23 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+glong webkit_dom_test_obj_get_attr_with_setter_exception_with_message(WebKitDOMTestObj* self)
+{
+ WebCore::JSMainThreadNullState state;
+ g_return_val_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self), 0);
+ WebCore::TestObj* item = WebKit::core(self);
+ glong result = item->attrWithSetterExceptionWithMessage();
+ return result;
+}
+
+void webkit_dom_test_obj_set_attr_with_setter_exception_with_message(WebKitDOMTestObj* self, glong value)
+{
+ WebCore::JSMainThreadNullState state;
+ g_return_if_fail(WEBKIT_DOM_IS_TEST_OBJ(self));
+ WebCore::TestObj* item = WebKit::core(self);
+ item->setAttrWithSetterExceptionWithMessage(value);
+}
+
</ins><span class="cx"> gchar* webkit_dom_test_obj_get_string_attr_with_getter_exception(WebKitDOMTestObj* self, GError** error)
</span><span class="cx"> {
</span><span class="cx"> WebCore::JSMainThreadNullState state;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestGObjectWebKitDOMTestObjh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h (193100 => 193101)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h        2015-12-03 18:46:48 UTC (rev 193100)
+++ trunk/Source/WebCore/bindings/scripts/test/GObject/WebKitDOMTestObj.h        2015-12-03 18:46:51 UTC (rev 193101)
</span><span class="lines">@@ -1124,6 +1124,27 @@
</span><span class="cx"> webkit_dom_test_obj_set_attr_with_getter_exception(WebKitDOMTestObj* self, glong value);
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * webkit_dom_test_obj_get_attr_with_getter_exception_with_message:
+ * @self: A #WebKitDOMTestObj
+ *
+ * Returns: A #glong
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API glong
+webkit_dom_test_obj_get_attr_with_getter_exception_with_message(WebKitDOMTestObj* self);
+
+/**
+ * webkit_dom_test_obj_set_attr_with_getter_exception_with_message:
+ * @self: A #WebKitDOMTestObj
+ * @value: A #glong
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API void
+webkit_dom_test_obj_set_attr_with_getter_exception_with_message(WebKitDOMTestObj* self, glong value);
+
+/**
</ins><span class="cx"> * webkit_dom_test_obj_get_attr_with_setter_exception:
</span><span class="cx"> * @self: A #WebKitDOMTestObj
</span><span class="cx"> *
</span><span class="lines">@@ -1146,6 +1167,27 @@
</span><span class="cx"> webkit_dom_test_obj_set_attr_with_setter_exception(WebKitDOMTestObj* self, glong value, GError** error);
</span><span class="cx">
</span><span class="cx"> /**
</span><ins>+ * webkit_dom_test_obj_get_attr_with_setter_exception_with_message:
+ * @self: A #WebKitDOMTestObj
+ *
+ * Returns: A #glong
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API glong
+webkit_dom_test_obj_get_attr_with_setter_exception_with_message(WebKitDOMTestObj* self);
+
+/**
+ * webkit_dom_test_obj_set_attr_with_setter_exception_with_message:
+ * @self: A #WebKitDOMTestObj
+ * @value: A #glong
+ *
+ * Stability: Unstable
+**/
+WEBKIT_API void
+webkit_dom_test_obj_set_attr_with_setter_exception_with_message(WebKitDOMTestObj* self, glong value);
+
+/**
</ins><span class="cx"> * webkit_dom_test_obj_get_string_attr_with_getter_exception:
</span><span class="cx"> * @self: A #WebKitDOMTestObj
</span><span class="cx"> * @error: #GError
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (193100 => 193101)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2015-12-03 18:46:48 UTC (rev 193100)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2015-12-03 18:46:51 UTC (rev 193101)
</span><span class="lines">@@ -237,8 +237,12 @@
</span><span class="cx"> void setJSTestObjTypedArrayAttr(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</span><span class="cx"> JSC::EncodedJSValue jsTestObjAttrWithGetterException(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="cx"> void setJSTestObjAttrWithGetterException(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</span><ins>+JSC::EncodedJSValue jsTestObjAttrWithGetterExceptionWithMessage(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::PropertyName);
+void setJSTestObjAttrWithGetterExceptionWithMessage(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</ins><span class="cx"> JSC::EncodedJSValue jsTestObjAttrWithSetterException(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="cx"> void setJSTestObjAttrWithSetterException(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</span><ins>+JSC::EncodedJSValue jsTestObjAttrWithSetterExceptionWithMessage(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::PropertyName);
+void setJSTestObjAttrWithSetterExceptionWithMessage(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</ins><span class="cx"> JSC::EncodedJSValue jsTestObjStringAttrWithGetterException(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="cx"> void setJSTestObjStringAttrWithGetterException(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::EncodedJSValue);
</span><span class="cx"> JSC::EncodedJSValue jsTestObjStringAttrWithSetterException(JSC::ExecState*, JSC::JSObject*, JSC::EncodedJSValue, JSC::PropertyName);
</span><span class="lines">@@ -511,7 +515,9 @@
</span><span class="cx"> { "reflectedCustomURLAttr", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjReflectedCustomURLAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjReflectedCustomURLAttr) } },
</span><span class="cx"> { "typedArrayAttr", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjTypedArrayAttr), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjTypedArrayAttr) } },
</span><span class="cx"> { "attrWithGetterException", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithGetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttrWithGetterException) } },
</span><ins>+ { "attrWithGetterExceptionWithMessage", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithGetterExceptionWithMessage), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttrWithGetterExceptionWithMessage) } },
</ins><span class="cx"> { "attrWithSetterException", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithSetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttrWithSetterException) } },
</span><ins>+ { "attrWithSetterExceptionWithMessage", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttrWithSetterExceptionWithMessage), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttrWithSetterExceptionWithMessage) } },
</ins><span class="cx"> { "stringAttrWithGetterException", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithGetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStringAttrWithGetterException) } },
</span><span class="cx"> { "stringAttrWithSetterException", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStringAttrWithSetterException), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStringAttrWithSetterException) } },
</span><span class="cx"> { "strictTypeCheckingAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjStrictTypeCheckingAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjStrictTypeCheckingAttribute) } },
</span><span class="lines">@@ -1248,6 +1254,25 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+EncodedJSValue jsTestObjAttrWithGetterExceptionWithMessage(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
+{
+ UNUSED_PARAM(state);
+ UNUSED_PARAM(slotBase);
+ UNUSED_PARAM(thisValue);
+ JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThis)) {
+ if (jsDynamicCast<JSTestObjPrototype*>(slotBase))
+ return reportDeprecatedGetterError(*state, "TestObj", "attrWithGetterExceptionWithMessage");
+ return throwGetterTypeError(*state, "TestObj", "attrWithGetterExceptionWithMessage");
+ }
+ ExceptionCodeWithMessage ec;
+ auto& impl = castedThis->wrapped();
+ JSValue result = jsNumber(impl.attrWithGetterExceptionWithMessage(ec));
+ setDOMException(state, ec);
+ return JSValue::encode(result);
+}
+
+
</ins><span class="cx"> EncodedJSValue jsTestObjAttrWithSetterException(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
</span><span class="cx"> {
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="lines">@@ -1265,6 +1290,23 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+EncodedJSValue jsTestObjAttrWithSetterExceptionWithMessage(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
+{
+ UNUSED_PARAM(state);
+ UNUSED_PARAM(slotBase);
+ UNUSED_PARAM(thisValue);
+ JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThis)) {
+ if (jsDynamicCast<JSTestObjPrototype*>(slotBase))
+ return reportDeprecatedGetterError(*state, "TestObj", "attrWithSetterExceptionWithMessage");
+ return throwGetterTypeError(*state, "TestObj", "attrWithSetterExceptionWithMessage");
+ }
+ auto& impl = castedThis->wrapped();
+ JSValue result = jsNumber(impl.attrWithSetterExceptionWithMessage());
+ return JSValue::encode(result);
+}
+
+
</ins><span class="cx"> EncodedJSValue jsTestObjStringAttrWithGetterException(ExecState* state, JSObject* slotBase, EncodedJSValue thisValue, PropertyName)
</span><span class="cx"> {
</span><span class="cx"> UNUSED_PARAM(state);
</span><span class="lines">@@ -2481,6 +2523,26 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+void setJSTestObjAttrWithGetterExceptionWithMessage(ExecState* state, JSObject* baseObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+ JSValue value = JSValue::decode(encodedValue);
+ UNUSED_PARAM(baseObject);
+ JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThis)) {
+ if (jsDynamicCast<JSTestObjPrototype*>(JSValue::decode(thisValue)))
+ reportDeprecatedSetterError(*state, "TestObj", "attrWithGetterExceptionWithMessage");
+ else
+ throwSetterTypeError(*state, "TestObj", "attrWithGetterExceptionWithMessage");
+ return;
+ }
+ auto& impl = castedThis->wrapped();
+ int nativeValue = toInt32(state, value, NormalConversion);
+ if (UNLIKELY(state->hadException()))
+ return;
+ impl.setAttrWithGetterExceptionWithMessage(nativeValue);
+}
+
+
</ins><span class="cx"> void setJSTestObjAttrWithSetterException(ExecState* state, JSObject* baseObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)
</span><span class="cx"> {
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="lines">@@ -2503,6 +2565,28 @@
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx">
</span><ins>+void setJSTestObjAttrWithSetterExceptionWithMessage(ExecState* state, JSObject* baseObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)
+{
+ JSValue value = JSValue::decode(encodedValue);
+ UNUSED_PARAM(baseObject);
+ JSTestObj* castedThis = jsDynamicCast<JSTestObj*>(JSValue::decode(thisValue));
+ if (UNLIKELY(!castedThis)) {
+ if (jsDynamicCast<JSTestObjPrototype*>(JSValue::decode(thisValue)))
+ reportDeprecatedSetterError(*state, "TestObj", "attrWithSetterExceptionWithMessage");
+ else
+ throwSetterTypeError(*state, "TestObj", "attrWithSetterExceptionWithMessage");
+ return;
+ }
+ auto& impl = castedThis->wrapped();
+ ExceptionCodeWithMessage ec;
+ int nativeValue = toInt32(state, value, NormalConversion);
+ if (UNLIKELY(state->hadException()))
+ return;
+ impl.setAttrWithSetterExceptionWithMessage(nativeValue, ec);
+ setDOMException(state, ec);
+}
+
+
</ins><span class="cx"> void setJSTestObjStringAttrWithGetterException(ExecState* state, JSObject* baseObject, EncodedJSValue thisValue, EncodedJSValue encodedValue)
</span><span class="cx"> {
</span><span class="cx"> JSValue value = JSValue::decode(encodedValue);
</span><span class="lines">@@ -3492,10 +3576,9 @@
</span><span class="cx"> return throwThisTypeError(*state, "TestObj", "methodWithExceptionWithMessage");
</span><span class="cx"> ASSERT_GC_OBJECT_INHERITS(castedThis, JSTestObj::info());
</span><span class="cx"> auto& impl = castedThis->wrapped();
</span><del>- ExceptionCode ec = 0;
- String exceptionMessage;
- impl.methodWithExceptionWithMessage(ec, exceptionMessage);
- setDOMException(state, ec, exceptionMessage);
</del><ins>+ ExceptionCodeWithMessage ec;
+ impl.methodWithExceptionWithMessage(ec);
+ setDOMException(state, ec);
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestObjCDOMTestObjh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h (193100 => 193101)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h        2015-12-03 18:46:48 UTC (rev 193100)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.h        2015-12-03 18:46:51 UTC (rev 193101)
</span><span class="lines">@@ -85,7 +85,9 @@
</span><span class="cx"> @property BOOL reflectedCustomBooleanAttr;
</span><span class="cx"> @property (copy) NSString *reflectedCustomURLAttr;
</span><span class="cx"> @property int attrWithGetterException;
</span><ins>+@property int attrWithGetterExceptionWithMessage;
</ins><span class="cx"> @property int attrWithSetterException;
</span><ins>+@property int attrWithSetterExceptionWithMessage;
</ins><span class="cx"> @property (copy) NSString *stringAttrWithGetterException;
</span><span class="cx"> @property (copy) NSString *stringAttrWithSetterException;
</span><span class="cx"> @property (strong) DOMTestObj *strictTypeCheckingAttribute;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestObjCDOMTestObjmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm (193100 => 193101)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm        2015-12-03 18:46:48 UTC (rev 193100)
+++ trunk/Source/WebCore/bindings/scripts/test/ObjC/DOMTestObj.mm        2015-12-03 18:46:51 UTC (rev 193101)
</span><span class="lines">@@ -381,6 +381,18 @@
</span><span class="cx"> IMPL->setAttrWithGetterException(newAttrWithGetterException);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (int)attrWithGetterExceptionWithMessage
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->attrWithGetterExceptionWithMessage();
+}
+
+- (void)setAttrWithGetterExceptionWithMessage:(int)newAttrWithGetterExceptionWithMessage
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setAttrWithGetterExceptionWithMessage(newAttrWithGetterExceptionWithMessage);
+}
+
</ins><span class="cx"> - (int)attrWithSetterException
</span><span class="cx"> {
</span><span class="cx"> WebCore::JSMainThreadNullState state;
</span><span class="lines">@@ -395,6 +407,18 @@
</span><span class="cx"> WebCore::raiseOnDOMError(ec);
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+- (int)attrWithSetterExceptionWithMessage
+{
+ WebCore::JSMainThreadNullState state;
+ return IMPL->attrWithSetterExceptionWithMessage();
+}
+
+- (void)setAttrWithSetterExceptionWithMessage:(int)newAttrWithSetterExceptionWithMessage
+{
+ WebCore::JSMainThreadNullState state;
+ IMPL->setAttrWithSetterExceptionWithMessage(newAttrWithSetterExceptionWithMessage);
+}
+
</ins><span class="cx"> - (NSString *)stringAttrWithGetterException
</span><span class="cx"> {
</span><span class="cx"> WebCore::JSMainThreadNullState state;
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestTestObjidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/TestObj.idl (193100 => 193101)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2015-12-03 18:46:48 UTC (rev 193100)
+++ trunk/Source/WebCore/bindings/scripts/test/TestObj.idl        2015-12-03 18:46:51 UTC (rev 193101)
</span><span class="lines">@@ -106,7 +106,9 @@
</span><span class="cx"> [RaisesException] void methodWithException();
</span><span class="cx"> [RaisesExceptionWithMessage] void methodWithExceptionWithMessage();
</span><span class="cx"> [GetterRaisesException] attribute long attrWithGetterException;
</span><ins>+ [GetterRaisesExceptionWithMessage] attribute long attrWithGetterExceptionWithMessage;
</ins><span class="cx"> [SetterRaisesException] attribute long attrWithSetterException;
</span><ins>+ [SetterRaisesExceptionWithMessage] attribute long attrWithSetterExceptionWithMessage;
</ins><span class="cx"> [GetterRaisesException] attribute DOMString stringAttrWithGetterException;
</span><span class="cx"> [SetterRaisesException] attribute DOMString stringAttrWithSetterException;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoredomExceptionCodeh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ExceptionCode.h (193100 => 193101)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ExceptionCode.h        2015-12-03 18:46:48 UTC (rev 193100)
+++ trunk/Source/WebCore/dom/ExceptionCode.h        2015-12-03 18:46:51 UTC (rev 193101)
</span><span class="lines">@@ -1,5 +1,5 @@
</span><span class="cx"> /*
</span><del>- * Copyright (C) 2006, 2007 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2006, 2007, 2015 Apple Inc. All rights reserved.
</ins><span class="cx"> *
</span><span class="cx"> * This library is free software; you can redistribute it and/or
</span><span class="cx"> * modify it under the terms of the GNU Lesser General Public
</span><span class="lines">@@ -19,55 +19,62 @@
</span><span class="cx"> #ifndef ExceptionCode_h
</span><span class="cx"> #define ExceptionCode_h
</span><span class="cx">
</span><ins>+#include <wtf/text/WTFString.h>
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>- // The DOM standards use unsigned short for exception codes.
- // In our DOM implementation we use int instead, and use different
- // numerical ranges for different types of DOM exception, so that
- // an exception of any type can be expressed with a single integer.
- typedef int ExceptionCode;
</del><ins>+// The DOM standards use unsigned short for exception codes.
+// In our DOM implementation we use int instead, and use different
+// numerical ranges for different types of DOM exception, so that
+// an exception of any type can be expressed with a single integer.
+typedef int ExceptionCode;
</ins><span class="cx">
</span><span class="cx">
</span><del>- // Some of these are considered historical since they have been
- // changed or removed from the specifications.
- enum {
- INDEX_SIZE_ERR = 1,
- HIERARCHY_REQUEST_ERR = 3,
- WRONG_DOCUMENT_ERR = 4,
- INVALID_CHARACTER_ERR = 5,
- NO_MODIFICATION_ALLOWED_ERR = 7,
- NOT_FOUND_ERR = 8,
- NOT_SUPPORTED_ERR = 9,
- INUSE_ATTRIBUTE_ERR = 10, // Historical. Only used in setAttributeNode etc which have been removed from the DOM specs.
</del><ins>+// Some of these are considered historical since they have been
+// changed or removed from the specifications.
+enum {
+ INDEX_SIZE_ERR = 1,
+ HIERARCHY_REQUEST_ERR = 3,
+ WRONG_DOCUMENT_ERR = 4,
+ INVALID_CHARACTER_ERR = 5,
+ NO_MODIFICATION_ALLOWED_ERR = 7,
+ NOT_FOUND_ERR = 8,
+ NOT_SUPPORTED_ERR = 9,
+ INUSE_ATTRIBUTE_ERR = 10, // Historical. Only used in setAttributeNode etc which have been removed from the DOM specs.
</ins><span class="cx">
</span><del>- // Introduced in DOM Level 2:
- INVALID_STATE_ERR = 11,
- SYNTAX_ERR = 12,
- INVALID_MODIFICATION_ERR = 13,
- NAMESPACE_ERR = 14,
- INVALID_ACCESS_ERR = 15,
</del><ins>+ // Introduced in DOM Level 2:
+ INVALID_STATE_ERR = 11,
+ SYNTAX_ERR = 12,
+ INVALID_MODIFICATION_ERR = 13,
+ NAMESPACE_ERR = 14,
+ INVALID_ACCESS_ERR = 15,
</ins><span class="cx">
</span><del>- // Introduced in DOM Level 3:
- TYPE_MISMATCH_ERR = 17, // Historical; use TypeError instead
</del><ins>+ // Introduced in DOM Level 3:
+ TYPE_MISMATCH_ERR = 17, // Historical; use TypeError instead
</ins><span class="cx">
</span><del>- // XMLHttpRequest extension:
- SECURITY_ERR = 18,
</del><ins>+ // XMLHttpRequest extension:
+ SECURITY_ERR = 18,
</ins><span class="cx">
</span><del>- // Others introduced in HTML5:
- NETWORK_ERR = 19,
- ABORT_ERR = 20,
- URL_MISMATCH_ERR = 21,
- QUOTA_EXCEEDED_ERR = 22,
- TIMEOUT_ERR = 23,
- INVALID_NODE_TYPE_ERR = 24,
- DATA_CLONE_ERR = 25,
</del><ins>+ // Others introduced in HTML5:
+ NETWORK_ERR = 19,
+ ABORT_ERR = 20,
+ URL_MISMATCH_ERR = 21,
+ QUOTA_EXCEEDED_ERR = 22,
+ TIMEOUT_ERR = 23,
+ INVALID_NODE_TYPE_ERR = 24,
+ DATA_CLONE_ERR = 25,
</ins><span class="cx">
</span><del>- // WebIDL exception types, handled by the binding layer.
- // FIXME: Add GeneralError, EvalError, etc. when implemented in the bindings.
- TypeError = 105,
- RangeError = 106,
- };
</del><ins>+ // WebIDL exception types, handled by the binding layer.
+ // FIXME: Add GeneralError, EvalError, etc. when implemented in the bindings.
+ TypeError = 105,
+ RangeError = 106,
+};
</ins><span class="cx">
</span><ins>+struct ExceptionCodeWithMessage {
+ ExceptionCode code { 0 };
+ String message;
+};
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx">
</span><span class="cx"> #endif // ExceptionCode_h
</span></span></pre>
</div>
</div>
</body>
</html>