<!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>[204219] trunk</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/204219">204219</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-08-05 22:34:57 -0700 (Fri, 05 Aug 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>DOMException should be constructible
https://bugs.webkit.org/show_bug.cgi?id=160626

Reviewed by Darin Adler.

LayoutTests/imported/w3c:

Import WebIDL tests from W3C web-platform-tests.

* web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constants-expected.txt: Added.
* web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constants.html: Added.
* web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor-expected.txt: Added.
* web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor.html: Added.
* web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object-expected.txt: Added.
* web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object.html: Added.
* web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object.js: Added.
* web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object.worker.js: Added.
* web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/exceptions-expected.txt: Added.
* web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/exceptions.html: Added.
* web-platform-tests/WebIDL/ecmascript-binding/has-instance-expected.txt: Added.
* web-platform-tests/WebIDL/ecmascript-binding/has-instance.html: Added.
* web-platform-tests/WebIDL/ecmascript-binding/interface-object-expected.txt: Added.
* web-platform-tests/WebIDL/ecmascript-binding/interface-object.html: Added.

Source/WebCore:

DOMException should be constructible:
- http://heycam.github.io/webidl/#dfn-DOMException
- http://heycam.github.io/webidl/#es-DOMException-constructor-object

DOMException already has a constructor in Firefox and Chrome so this
aligns our behavior with other browsers.

Test: imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor.html

* dom/DOMCoreException.cpp:
(WebCore::errorCodeFromName):
(WebCore::DOMCoreException::create):
(WebCore::DOMCoreException::DOMCoreException):
* dom/DOMCoreException.h:
* dom/DOMCoreException.idl:
* dom/ExceptionBase.cpp:
(WebCore::ExceptionBase::ExceptionBase):
* dom/ExceptionBase.h:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoredomDOMCoreExceptioncpp">trunk/Source/WebCore/dom/DOMCoreException.cpp</a></li>
<li><a href="#trunkSourceWebCoredomDOMCoreExceptionh">trunk/Source/WebCore/dom/DOMCoreException.h</a></li>
<li><a href="#trunkSourceWebCoredomDOMCoreExceptionidl">trunk/Source/WebCore/dom/DOMCoreException.idl</a></li>
<li><a href="#trunkSourceWebCoredomExceptionBasecpp">trunk/Source/WebCore/dom/ExceptionBase.cpp</a></li>
<li><a href="#trunkSourceWebCoredomExceptionBaseh">trunk/Source/WebCore/dom/ExceptionBase.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li>trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/</li>
<li>trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/</li>
<li>trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/</li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsDOMExceptionconstantsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constants-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsDOMExceptionconstantshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constants.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsDOMExceptionconstructorexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsDOMExceptionconstructorhtml">trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsconstructorobjectexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsconstructorobjecthtml">trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsconstructorobjectjs">trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsconstructorobjectworkerjs">trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object.worker.js</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsexceptionsexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/exceptions-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsexceptionshtml">trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/exceptions.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindinghasinstanceexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/has-instance-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindinghasinstancehtml">trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/has-instance.html</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindinginterfaceobjectexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/interface-object-expected.txt</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindinginterfaceobjecthtml">trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/interface-object.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (204218 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-08-06 03:48:10 UTC (rev 204218)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -1,5 +1,29 @@
</span><span class="cx"> 2016-08-05  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        DOMException should be constructible
+        https://bugs.webkit.org/show_bug.cgi?id=160626
+
+        Reviewed by Darin Adler.
+
+        Import WebIDL tests from W3C web-platform-tests.
+
+        * web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constants-expected.txt: Added.
+        * web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constants.html: Added.
+        * web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor-expected.txt: Added.
+        * web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor.html: Added.
+        * web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object-expected.txt: Added.
+        * web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object.html: Added.
+        * web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object.js: Added.
+        * web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object.worker.js: Added.
+        * web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/exceptions-expected.txt: Added.
+        * web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/exceptions.html: Added.
+        * web-platform-tests/WebIDL/ecmascript-binding/has-instance-expected.txt: Added.
+        * web-platform-tests/WebIDL/ecmascript-binding/has-instance.html: Added.
+        * web-platform-tests/WebIDL/ecmascript-binding/interface-object-expected.txt: Added.
+        * web-platform-tests/WebIDL/ecmascript-binding/interface-object.html: Added.
+
+2016-08-05  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Align Range.insertNode() input validation with the specification
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=160624
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsDOMExceptionconstantsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constants-expected.txt (0 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constants-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constants-expected.txt        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+
+PASS DOMException constants 
+PASS Constant INDEX_SIZE_ERR on DOMException constructor object 
+PASS Constant INDEX_SIZE_ERR on DOMException prototype object 
+PASS Constant DOMSTRING_SIZE_ERR on DOMException constructor object 
+PASS Constant DOMSTRING_SIZE_ERR on DOMException prototype object 
+PASS Constant HIERARCHY_REQUEST_ERR on DOMException constructor object 
+PASS Constant HIERARCHY_REQUEST_ERR on DOMException prototype object 
+PASS Constant WRONG_DOCUMENT_ERR on DOMException constructor object 
+PASS Constant WRONG_DOCUMENT_ERR on DOMException prototype object 
+PASS Constant INVALID_CHARACTER_ERR on DOMException constructor object 
+PASS Constant INVALID_CHARACTER_ERR on DOMException prototype object 
+PASS Constant NO_DATA_ALLOWED_ERR on DOMException constructor object 
+PASS Constant NO_DATA_ALLOWED_ERR on DOMException prototype object 
+PASS Constant NO_MODIFICATION_ALLOWED_ERR on DOMException constructor object 
+PASS Constant NO_MODIFICATION_ALLOWED_ERR on DOMException prototype object 
+PASS Constant NOT_FOUND_ERR on DOMException constructor object 
+PASS Constant NOT_FOUND_ERR on DOMException prototype object 
+PASS Constant NOT_SUPPORTED_ERR on DOMException constructor object 
+PASS Constant NOT_SUPPORTED_ERR on DOMException prototype object 
+PASS Constant INUSE_ATTRIBUTE_ERR on DOMException constructor object 
+PASS Constant INUSE_ATTRIBUTE_ERR on DOMException prototype object 
+PASS Constant INVALID_STATE_ERR on DOMException constructor object 
+PASS Constant INVALID_STATE_ERR on DOMException prototype object 
+PASS Constant SYNTAX_ERR on DOMException constructor object 
+PASS Constant SYNTAX_ERR on DOMException prototype object 
+PASS Constant INVALID_MODIFICATION_ERR on DOMException constructor object 
+PASS Constant INVALID_MODIFICATION_ERR on DOMException prototype object 
+PASS Constant NAMESPACE_ERR on DOMException constructor object 
+PASS Constant NAMESPACE_ERR on DOMException prototype object 
+PASS Constant INVALID_ACCESS_ERR on DOMException constructor object 
+PASS Constant INVALID_ACCESS_ERR on DOMException prototype object 
+PASS Constant VALIDATION_ERR on DOMException constructor object 
+PASS Constant VALIDATION_ERR on DOMException prototype object 
+PASS Constant TYPE_MISMATCH_ERR on DOMException constructor object 
+PASS Constant TYPE_MISMATCH_ERR on DOMException prototype object 
+PASS Constant SECURITY_ERR on DOMException constructor object 
+PASS Constant SECURITY_ERR on DOMException prototype object 
+PASS Constant NETWORK_ERR on DOMException constructor object 
+PASS Constant NETWORK_ERR on DOMException prototype object 
+PASS Constant ABORT_ERR on DOMException constructor object 
+PASS Constant ABORT_ERR on DOMException prototype object 
+PASS Constant URL_MISMATCH_ERR on DOMException constructor object 
+PASS Constant URL_MISMATCH_ERR on DOMException prototype object 
+PASS Constant QUOTA_EXCEEDED_ERR on DOMException constructor object 
+PASS Constant QUOTA_EXCEEDED_ERR on DOMException prototype object 
+PASS Constant TIMEOUT_ERR on DOMException constructor object 
+PASS Constant TIMEOUT_ERR on DOMException prototype object 
+PASS Constant INVALID_NODE_TYPE_ERR on DOMException constructor object 
+PASS Constant INVALID_NODE_TYPE_ERR on DOMException prototype object 
+PASS Constant DATA_CLONE_ERR on DOMException constructor object 
+PASS Constant DATA_CLONE_ERR on DOMException prototype object 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsDOMExceptionconstantshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constants.html (0 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constants.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constants.html        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -0,0 +1,59 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;DOMException constants&lt;/title&gt;
+&lt;link rel=help href=&quot;https://heycam.github.io/webidl/#es-DOMException-constructor-object&quot;&gt;
+&lt;link rel=help href=&quot;https://heycam.github.io/webidl/#es-DOMException-prototype-object&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+test(function() {
+  // https://www.w3.org/Bugs/Public/show_bug.cgi?id=27732
+  var constants = [
+    &quot;INDEX_SIZE_ERR&quot;,
+    &quot;DOMSTRING_SIZE_ERR&quot;,
+    &quot;HIERARCHY_REQUEST_ERR&quot;,
+    &quot;WRONG_DOCUMENT_ERR&quot;,
+    &quot;INVALID_CHARACTER_ERR&quot;,
+    &quot;NO_DATA_ALLOWED_ERR&quot;,
+    &quot;NO_MODIFICATION_ALLOWED_ERR&quot;,
+    &quot;NOT_FOUND_ERR&quot;,
+    &quot;NOT_SUPPORTED_ERR&quot;,
+    &quot;INUSE_ATTRIBUTE_ERR&quot;,
+    &quot;INVALID_STATE_ERR&quot;,
+    &quot;SYNTAX_ERR&quot;,
+    &quot;INVALID_MODIFICATION_ERR&quot;,
+    &quot;NAMESPACE_ERR&quot;,
+    &quot;INVALID_ACCESS_ERR&quot;,
+    &quot;VALIDATION_ERR&quot;,
+    &quot;TYPE_MISMATCH_ERR&quot;,
+    &quot;SECURITY_ERR&quot;,
+    &quot;NETWORK_ERR&quot;,
+    &quot;ABORT_ERR&quot;,
+    &quot;URL_MISMATCH_ERR&quot;,
+    &quot;QUOTA_EXCEEDED_ERR&quot;,
+    &quot;TIMEOUT_ERR&quot;,
+    &quot;INVALID_NODE_TYPE_ERR&quot;,
+    &quot;DATA_CLONE_ERR&quot;
+  ]
+  var objects = [
+    [DOMException, &quot;DOMException constructor object&quot;],
+    [DOMException.prototype, &quot;DOMException prototype object&quot;]
+  ]
+  constants.forEach(function(name, i) {
+    objects.forEach(function(o) {
+      var object = o[0], description = o[1];
+      test(function() {
+        assert_equals(object[name], i + 1, name)
+        assert_own_property(object, name)
+        var pd = Object.getOwnPropertyDescriptor(object, name)
+        assert_false(&quot;get&quot; in pd, &quot;property has getter&quot;)
+        assert_false(&quot;set&quot; in pd, &quot;property has setter&quot;)
+        assert_false(pd.writable, &quot;not writable&quot;)
+        assert_true(pd.enumerable, &quot;enumerable&quot;)
+        assert_false(pd.configurable, &quot;not configurable&quot;)
+      }, &quot;Constant &quot; + name + &quot; on &quot; + description)
+    })
+  })
+})
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsDOMExceptionconstructorexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor-expected.txt (0 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor-expected.txt        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+
+PASS new DOMException() 
+FAIL new DOMException(): own-ness assert_false: The name property should be inherited expected false got true
+PASS new DOMException(null) 
+PASS new DOMException(undefined) 
+FAIL new DOMException(undefined): own-ness assert_false: The name property should be inherited expected false got true
+PASS new DOMException(&quot;foo&quot;) 
+FAIL new DOMException(&quot;foo&quot;): own-ness assert_false: The name property should be inherited expected false got true
+PASS new DOMException(&quot;bar&quot;, undefined) 
+PASS new DOMException(&quot;bar&quot;, &quot;NotSupportedError&quot;) 
+PASS new DOMException(&quot;bar&quot;, &quot;NotSupportedError&quot;): own-ness 
+PASS new DOMException(&quot;bar&quot;, &quot;foo&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;IndexSizeError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;HierarchyRequestError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;WrongDocumentError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;InvalidCharacterError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;NoModificationAllowedError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;NotFoundError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;NotSupportedError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;InUseAttributeError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;InvalidStateError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;SyntaxError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;InvalidModificationError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;NamespaceError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;InvalidAccessError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;SecurityError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;NetworkError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;AbortError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;URLMismatchError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;QuotaExceededError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;TimeoutError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;InvalidNodeTypeError&quot;) 
+PASS new DOMexception(&quot;msg&quot;, &quot;DataCloneError&quot;) 
+PASS new DOMException(&quot;bar&quot;, &quot;UnknownError&quot;) 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsDOMExceptionconstructorhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor.html (0 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor.html        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -0,0 +1,139 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;DOMException constructor&lt;/title&gt;
+&lt;link rel=help href=&quot;https://heycam.github.io/webidl/#es-DOMException-constructor-object&quot;&gt;
+&lt;link rel=help href=&quot;https://people.mozilla.org/~jorendorff/es6-draft.html#sec-error.prototype.message&quot;&gt;
+&lt;link rel=help href=&quot;https://people.mozilla.org/~jorendorff/es6-draft.html#sec-error.prototype.name&quot;&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+test(function() {
+  var ex = new DOMException();
+  assert_equals(ex.name, &quot;Error&quot;,
+                &quot;Not passing a name should end up with 'Error' as the name&quot;);
+  assert_equals(ex.message, &quot;&quot;,
+                &quot;Not passing a message should end up with empty string as the message&quot;);
+}, 'new DOMException()');
+
+test(function() {
+  var ex = new DOMException();
+  assert_false(ex.hasOwnProperty(&quot;name&quot;),
+               &quot;The name property should be inherited&quot;);
+  assert_false(ex.hasOwnProperty(&quot;message&quot;),
+               &quot;The message property should be inherited&quot;);
+}, 'new DOMException(): own-ness');
+
+test(function() {
+  var ex = new DOMException(null);
+  assert_equals(ex.name, &quot;Error&quot;,
+                &quot;Not passing a name should end up with 'Error' as the name&quot;);
+  assert_equals(ex.message, &quot;null&quot;,
+                &quot;Passing null as message should end up with stringified 'null' as the message&quot;);
+}, 'new DOMException(null)');
+
+test(function() {
+  var ex = new DOMException(undefined);
+  assert_equals(ex.name, &quot;Error&quot;,
+                &quot;Not passing a name should end up with 'Error' as the name&quot;);
+  assert_equals(ex.message, &quot;&quot;,
+                &quot;Not passing a message should end up with empty string as the message&quot;);
+}, 'new DOMException(undefined)');
+
+test(function() {
+  var ex = new DOMException(undefined);
+  assert_false(ex.hasOwnProperty(&quot;name&quot;),
+               &quot;The name property should be inherited&quot;);
+  assert_false(ex.hasOwnProperty(&quot;message&quot;),
+               &quot;The message property should be inherited&quot;);
+}, 'new DOMException(undefined): own-ness');
+
+test(function() {
+  var ex = new DOMException(&quot;foo&quot;);
+  assert_equals(ex.name, &quot;Error&quot;,
+                &quot;Not passing a name should still end up with 'Error' as the name&quot;);
+  assert_equals(ex.message, &quot;foo&quot;, &quot;Should be using passed-in message&quot;);
+}, 'new DOMException(&quot;foo&quot;)');
+
+test(function() {
+  var ex = new DOMException(&quot;foo&quot;);
+  assert_false(ex.hasOwnProperty(&quot;name&quot;),
+               &quot;The name property should be inherited&quot;);
+  assert_true(ex.hasOwnProperty(&quot;message&quot;),
+              &quot;The message property should be own&quot;);
+}, 'new DOMException(&quot;foo&quot;): own-ness');
+
+test(function() {
+  var ex = new DOMException(&quot;bar&quot;, undefined);
+  assert_equals(ex.name, &quot;Error&quot;,
+                &quot;Passing undefined for name should end up with 'Error' as the name&quot;);
+  assert_equals(ex.message, &quot;bar&quot;, &quot;Should still be using passed-in message&quot;);
+}, 'new DOMException(&quot;bar&quot;, undefined)');
+
+test(function() {
+  var ex = new DOMException(&quot;bar&quot;, &quot;NotSupportedError&quot;);
+  assert_equals(ex.name, &quot;NotSupportedError&quot;, &quot;Should be using the passed-in name&quot;);
+  assert_equals(ex.message, &quot;bar&quot;, &quot;Should still be using passed-in message&quot;);
+  assert_equals(ex.code, DOMException.NOT_SUPPORTED_ERR,
+                &quot;Should have the right exception code&quot;);
+}, 'new DOMException(&quot;bar&quot;, &quot;NotSupportedError&quot;)');
+
+test(function() {
+  var ex = new DOMException(&quot;bar&quot;, &quot;NotSupportedError&quot;);
+  assert_true(ex.hasOwnProperty(&quot;name&quot;),
+              &quot;The name property should be own&quot;);
+  assert_true(ex.hasOwnProperty(&quot;message&quot;),
+              &quot;The message property should be own&quot;);
+}, 'new DOMException(&quot;bar&quot;, &quot;NotSupportedError&quot;): own-ness');
+
+test(function() {
+  var ex = new DOMException(&quot;bar&quot;, &quot;foo&quot;);
+  assert_equals(ex.name, &quot;foo&quot;, &quot;Should be using the passed-in name&quot;);
+  assert_equals(ex.message, &quot;bar&quot;, &quot;Should still be using passed-in message&quot;);
+  assert_equals(ex.code, 0,
+                &quot;Should have 0 for code for a name not in the exception names table&quot;);
+}, 'new DOMException(&quot;bar&quot;, &quot;foo&quot;)');
+
+[
+  {name: &quot;IndexSizeError&quot;, code: 1},
+  {name: &quot;HierarchyRequestError&quot;, code: 3},
+  {name: &quot;WrongDocumentError&quot;, code: 4},
+  {name: &quot;InvalidCharacterError&quot;, code: 5},
+  {name: &quot;NoModificationAllowedError&quot;, code: 7},
+  {name: &quot;NotFoundError&quot;, code: 8},
+  {name: &quot;NotSupportedError&quot;, code: 9},
+  {name: &quot;InUseAttributeError&quot;, code: 10},
+  {name: &quot;InvalidStateError&quot;, code: 11},
+  {name: &quot;SyntaxError&quot;, code: 12},
+  {name: &quot;InvalidModificationError&quot;, code: 13},
+  {name: &quot;NamespaceError&quot;, code: 14},
+  {name: &quot;InvalidAccessError&quot;, code: 15},
+  {name: &quot;SecurityError&quot;, code: 18},
+  {name: &quot;NetworkError&quot;, code: 19},
+  {name: &quot;AbortError&quot;, code: 20},
+  {name: &quot;URLMismatchError&quot;, code: 21},
+  {name: &quot;QuotaExceededError&quot;, code: 22},
+  {name: &quot;TimeoutError&quot;, code: 23},
+  {name: &quot;InvalidNodeTypeError&quot;, code: 24},
+  {name: &quot;DataCloneError&quot;, code: 25}
+].forEach(function(test_case) {
+  test(function() {
+    var ex = new DOMException(&quot;msg&quot;, test_case.name);
+    assert_equals(ex.name, test_case.name,
+                  &quot;Should be using the passed-in name&quot;);
+    assert_equals(ex.message, &quot;msg&quot;,
+                  &quot;Should be using the passed-in message&quot;);
+    assert_equals(ex.code, test_case.code,
+                  &quot;Should have matching legacy code from error names table&quot;);
+  },'new DOMexception(&quot;msg&quot;, &quot;' + test_case.name + '&quot;)');
+});
+
+test(function() {
+  var ex = new DOMException(&quot;bar&quot;, &quot;UnknownError&quot;);
+  assert_equals(ex.name, &quot;UnknownError&quot;, &quot;Should be using the passed-in name&quot;);
+  assert_equals(ex.message, &quot;bar&quot;, &quot;Should still be using passed-in message&quot;);
+  assert_equals(ex.code, 0,
+                &quot;Should have 0 for code for a name in the exception names table with no legacy code&quot;);
+}, 'new DOMException(&quot;bar&quot;, &quot;UnknownError&quot;)');
+
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsconstructorobjectexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object-expected.txt (0 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object-expected.txt        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+
+FAIL existence and properties of DOMException assert_equals: prototype of self's property &quot;DOMException&quot; is not Error expected function &quot;function Error() {
+    [native code]
+}&quot; but got function &quot;function () {
+    [native code]
+}&quot;
+PASS existence and properties of DOMException.prototype 
+PASS existence of name and code properties on DOMException.prototype 
+PASS existence and properties of exception interface prototype object's &quot;constructor&quot; property 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsconstructorobjecthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object.html (0 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object.html        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;meta charset=utf-8&gt;
+&lt;title&gt;DOMException constructor and prototype object&lt;/title&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script src=constructor-object.js&gt;&lt;/script&gt;
+&lt;div id=&quot;log&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+setup({ explicit_done: true })
+run_test()
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsconstructorobjectjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object.js (0 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object.js        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -0,0 +1,111 @@
</span><ins>+function run_test() {
+    test(function() {
+        // &quot;There MUST exist a property on the ECMAScript global object whose
+        // name is “DOMException” and value is an object called the
+        // DOMException constructor object, which provides access to legacy
+        // DOMException code constants. The property has the attributes
+        // { [[Writable]]: true, [[Enumerable]]: false,
+        // [[Configurable]]: true }.&quot;
+        assert_own_property(self, &quot;DOMException&quot;,
+                            &quot;self does not have own property \&quot;DOMException\&quot;&quot;);
+        var desc = Object.getOwnPropertyDescriptor(self, &quot;DOMException&quot;);
+        assert_false(&quot;get&quot; in desc, &quot;self's property \&quot;DOMException\&quot; has getter&quot;);
+        assert_false(&quot;set&quot; in desc, &quot;self's property \&quot;DOMException\&quot; has setter&quot;);
+        assert_true(desc.writable, &quot;self's property \&quot;DOMException\&quot; is not writable&quot;);
+        assert_false(desc.enumerable, &quot;self's property \&quot;DOMException\&quot; is enumerable&quot;);
+        assert_true(desc.configurable, &quot;self's property \&quot;DOMException\&quot; is not configurable&quot;);
+
+        // &quot;The DOMException constructor object MUST be a function object but
+        // with a [[Prototype]] value of %Error% ([ECMA-262], section 6.1.7.4).&quot;
+        assert_equals(Object.getPrototypeOf(self.DOMException), Error,
+                      &quot;prototype of self's property \&quot;DOMException\&quot; is not Error&quot;);
+
+        // &quot;Its [[Get]] internal property is set as described in ECMA-262
+        // section 9.1.8.&quot;
+        // Not much to test for this.
+        // &quot;Its [[Construct]] internal property is set as described in ECMA-262
+        // section 19.2.2.3.&quot;
+        // &quot;Its @@hasInstance property is set as described in ECMA-262 section
+        // 19.2.3.8, unless otherwise specified.&quot;
+
+        // String() returns something implementation-dependent, because it
+        // calls Function#toString.
+        assert_class_string(self.DOMException, &quot;Function&quot;,
+                            &quot;class string of DOMException&quot;);
+
+        // &quot;For every legacy code listed in the error names table, there MUST
+        // be a property on the DOMException constructor object whose name and
+        // value are as indicated in the table. The property has attributes
+        // { [[Writable]]: false, [[Enumerable]]: true,
+        // [[Configurable]]: false }.&quot;
+        // See DOMException-constants.html.
+    }, &quot;existence and properties of DOMException&quot;);
+
+    test(function() {
+        assert_own_property(self, &quot;DOMException&quot;,
+                            &quot;self does not have own property \&quot;DOMException\&quot;&quot;);
+
+        // &quot;The DOMException constructor object MUST also have a property named
+        // “prototype” with attributes { [[Writable]]: false,
+        // [[Enumerable]]: false, [[Configurable]]: false } whose value is an
+        // object called the DOMException prototype object. This object also
+        // provides access to the legacy code values.&quot;
+        assert_own_property(self.DOMException, &quot;prototype&quot;,
+                            'exception &quot;DOMException&quot; does not have own property &quot;prototype&quot;');
+        var desc = Object.getOwnPropertyDescriptor(self.DOMException, &quot;prototype&quot;);
+        assert_false(&quot;get&quot; in desc, &quot;DOMException.prototype has getter&quot;);
+        assert_false(&quot;set&quot; in desc, &quot;DOMException.prototype has setter&quot;);
+        assert_false(desc.writable, &quot;DOMException.prototype is writable&quot;);
+        assert_false(desc.enumerable, &quot;DOMException.prototype is enumerable&quot;);
+        assert_false(desc.configurable, &quot;DOMException.prototype is configurable&quot;);
+
+        // &quot;The DOMException prototype object MUST have an internal
+        // [[Prototype]] property whose value is %ErrorPrototype% ([ECMA-262],
+        // section 6.1.7.4).&quot;
+        assert_own_property(self, &quot;Error&quot;,
+                            'should inherit from Error, but self has no such property');
+        assert_own_property(self.Error, &quot;prototype&quot;,
+                            'should inherit from Error, but that object has no &quot;prototype&quot; property');
+        assert_equals(Object.getPrototypeOf(self.DOMException.prototype),
+                      self.Error.prototype,
+                      'prototype of DOMException.prototype is not Error.prototype');
+
+        // &quot;The class string of the DOMException prototype object is
+        // “DOMExceptionPrototype”.&quot;
+        assert_class_string(self.DOMException.prototype, &quot;DOMExceptionPrototype&quot;,
+                            &quot;class string of DOMException.prototype&quot;);
+    }, &quot;existence and properties of DOMException.prototype&quot;);
+
+    test(function() {
+        assert_false(self.DOMException.prototype.hasOwnProperty(&quot;name&quot;),
+                     &quot;DOMException.prototype should not have an own \&quot;name\&quot; &quot; +
+                     &quot;property.&quot;);
+        assert_false(self.DOMException.prototype.hasOwnProperty(&quot;code&quot;),
+                     &quot;DOMException.prototype should not have an own \&quot;name\&quot; &quot; +
+                     &quot;property.&quot;);
+    }, &quot;existence of name and code properties on DOMException.prototype&quot;);
+
+    test(function() {
+        assert_own_property(self, &quot;DOMException&quot;,
+                            &quot;self does not have own property \&quot;DOMException\&quot;&quot;);
+        assert_own_property(self.DOMException, &quot;prototype&quot;,
+                            'interface &quot;DOMException&quot; does not have own property &quot;prototype&quot;');
+
+        // &quot;There MUST be a property named “constructor” on the DOMException
+        // prototype object with attributes { [[Writable]]: true,
+        // [[Enumerable]]: false, [[Configurable]]: true } and whose value is
+        // the DOMException constructor object.&quot;
+        assert_own_property(self.DOMException.prototype, &quot;constructor&quot;,
+                            &quot;DOMException&quot; + '.prototype does not have own property &quot;constructor&quot;');
+        var desc = Object.getOwnPropertyDescriptor(self.DOMException.prototype, &quot;constructor&quot;);
+        assert_false(&quot;get&quot; in desc, &quot;DOMException.prototype.constructor has getter&quot;);
+        assert_false(&quot;set&quot; in desc, &quot;DOMException.prototype.constructor has setter&quot;);
+        assert_true(desc.writable, &quot;DOMException.prototype.constructor is not writable&quot;);
+        assert_false(desc.enumerable, &quot;DOMException.prototype.constructor is enumerable&quot;);
+        assert_true(desc.configurable, &quot;DOMException.prototype.constructor in not configurable&quot;);
+        assert_equals(self.DOMException.prototype.constructor, self.DOMException,
+                      &quot;DOMException.prototype.constructor is not the same object as DOMException&quot;);
+    }, &quot;existence and properties of exception interface prototype object's \&quot;constructor\&quot; property&quot;);
+
+    done();
+}
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsconstructorobjectworkerjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object.worker.js (0 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object.worker.js                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/constructor-object.worker.js        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+importScripts(&quot;/resources/testharness.js&quot;)
+importScripts(&quot;constructor-object.js&quot;)
+run_test();
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsexceptionsexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/exceptions-expected.txt (0 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/exceptions-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/exceptions-expected.txt        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+
+PASS Object.getPrototypeOf(exception) === DOMException.prototype 
+PASS exception.hasOwnProperty(&quot;name&quot;) 
+PASS exception.name === &quot;HierarchyRequestError&quot; 
+FAIL Object.getOwnPropertyDescriptor(exception, &quot;name&quot;) assert_true: must be writable expected true got undefined
+FAIL Object.getOwnPropertyDescriptor(exception, &quot;message&quot;) assert_true: must be writable expected true got undefined
+PASS typeof exception.message === &quot;string&quot; 
+PASS Object.prototype.toString.call(exception) === &quot;[object DOMException]&quot; 
+PASS exception.code === DOMException.HIERARCHY_REQUEST_ERR 
+FAIL Object.getOwnPropertyDescriptor(exception, &quot;code&quot;) assert_true: must be writable expected true got undefined
+PASS In iframe: Object.getPrototypeOf(exception) === DOMException.prototype 
+PASS In iframe: exception.hasOwnProperty(&quot;name&quot;) 
+PASS In iframe: exception.name === &quot;HierarchyRequestError&quot; 
+FAIL In iframe: Object.getOwnPropertyDescriptor(exception, &quot;name&quot;) assert_true: must be writable expected true got undefined
+FAIL In iframe: Object.getOwnPropertyDescriptor(exception, &quot;message&quot;) assert_true: must be writable expected true got undefined
+PASS In iframe: typeof exception.message === &quot;string&quot; 
+PASS In iframe: Object.prototype.toString.call(exception) === &quot;[object DOMException]&quot; 
+PASS In iframe: exception.code === DOMException.HIERARCHY_REQUEST_ERR 
+FAIL In iframe: Object.getOwnPropertyDescriptor(exception, &quot;code&quot;) assert_true: must be writable expected true got undefined
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindingesexceptionsexceptionshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/exceptions.html (0 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/exceptions.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/exceptions.html        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -0,0 +1,136 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;title&gt;DOMException-throwing tests&lt;/title&gt;
+&lt;link rel=author title=&quot;Aryeh Gregor&quot; href=ayg@aryeh.name&gt;
+&lt;div id=log&gt;&lt;/div&gt;
+&lt;script src=/resources/testharness.js&gt;&lt;/script&gt;
+&lt;script src=/resources/testharnessreport.js&gt;&lt;/script&gt;
+&lt;script&gt;
+/**
+ * This file just picks one case where browsers are supposed to throw an
+ * exception, and tests the heck out of whether it meets the spec.  In the
+ * future, all these checks should be in assert_throws(), but we don't want
+ * every browser failing every assert_throws() check until they fix every
+ * single bug in their exception-throwing.
+ *
+ * We don't go out of our way to test everything that's already tested by
+ * interfaces.html, like whether all constants are present on the object, but
+ * some things are duplicated.
+ */
+setup({explicit_done: true});
+
+function testException(exception, global, desc) {
+  // https://heycam.github.io/webidl/#es-exception-objects
+  // (as of 2015-01-03): &quot;The value of the internal [[Prototype]] property of a
+  // DOMException object MUST be the DOMException prototype object from the
+  // global environment the exception object is associated with.&quot;
+  test(function() {
+    assert_equals(global.Object.getPrototypeOf(exception),
+                  global.DOMException.prototype);
+  }, desc + &quot;Object.getPrototypeOf(exception) === DOMException.prototype&quot;);
+
+
+  // https://heycam.github.io/webidl/#es-creating-throwing-exceptions
+  // (as of 2015-01-03): &quot;Call the [[DefineOwnProperty]] internal method of /O/
+  // passing “name”, Property Descriptor { [[Value]]: /N/, [[Writable]]: true,
+  // [[Enumerable]]: true, [[Configurable]]: true }, and false as arguments.&quot;
+  test(function() {
+    assert_true(exception.hasOwnProperty(&quot;name&quot;));
+  }, desc + &quot;exception.hasOwnProperty(\&quot;name\&quot;)&quot;);
+
+  test(function() {
+    assert_equals(exception.name, &quot;HierarchyRequestError&quot;);
+  }, desc + &quot;exception.name === \&quot;HierarchyRequestError\&quot;&quot;);
+
+  test(function() {
+    var desc = global.Object.getOwnPropertyDescriptor(exception, &quot;name&quot;);
+    assert_true(desc.writable, &quot;must be writable&quot;);
+    assert_true(desc.enumerable, &quot;must be enumerable&quot;);
+    assert_true(desc.configurable, &quot;must be configurable&quot;);
+  }, desc + &quot;Object.getOwnPropertyDescriptor(exception, \&quot;name\&quot;)&quot;);
+
+
+  // https://heycam.github.io/webidl/#es-creating-throwing-exceptions
+  // (as of 2015-01-03): &quot;If the optional user agent-defined message /M/ was
+  // specified, then this list has a single element whose value is the result
+  // of converting /M/ to a String value. Otherwise, the list is empty.&quot;
+  //
+  // https://heycam.github.io/webidl/#es-DOMException-constructor-object
+  // (as of 2015-01-03): &quot;Call the [[DefineOwnProperty]] internal method of /O/
+  // passing “message”, Property Descriptor { [[Value]]: /S/,
+  // [[Writable]]: true, [[Enumerable]]: false, [[Configurable]]: true }, and
+  // false as arguments.&quot;
+  test(function() {
+    if (exception.hasOwnProperty(&quot;message&quot;)) {
+      var desc = global.Object.getOwnPropertyDescriptor(exception, &quot;message&quot;);
+      assert_true(desc.writable, &quot;must be writable&quot;);
+      assert_false(desc.enumerable, &quot;must not be enumerable&quot;);
+      assert_true(desc.configurable, &quot;must be configurable&quot;);
+    }
+  }, desc + &quot;Object.getOwnPropertyDescriptor(exception, \&quot;message\&quot;)&quot;);
+
+  test(function() {
+    if (exception.hasOwnProperty(&quot;message&quot;)) {
+      // Can't test anything more specific, since it's implementation-defined :(
+      assert_equals(typeof exception.message, &quot;string&quot;);
+    } else {
+      // Error.prototype.message
+      assert_equals(exception.message, &quot;&quot;);
+    }
+  }, desc + &quot;typeof exception.message === \&quot;string\&quot;&quot;);
+
+
+  // https://heycam.github.io/webidl/#es-exception-objects
+  // (as of 2015-01-03): &quot;The class string of a DOMException object MUST be
+  // “DOMException”.&quot;
+  test(function() {
+    assert_equals(global.Object.prototype.toString.call(exception),
+                  &quot;[object DOMException]&quot;);
+  }, desc + &quot;Object.prototype.toString.call(exception) === \&quot;[object DOMException]\&quot;&quot;);
+
+
+  // https://heycam.github.io/webidl/#es-creating-throwing-exceptions
+  // (as of 2015-01-03): &quot;Call the [[DefineOwnProperty]] internal method of /O/
+  // passing “code”, Property Descriptor { [[Value]]: /code/,
+  // [[Writable]]: true, [[Enumerable]]: true, [[Configurable]]: true }, and
+  // false as arguments.&quot;
+  test(function() {
+    assert_equals(exception.code, global.DOMException.HIERARCHY_REQUEST_ERR);
+  }, desc + &quot;exception.code === DOMException.HIERARCHY_REQUEST_ERR&quot;);
+
+  test(function() {
+    var desc = global.Object.getOwnPropertyDescriptor(exception, &quot;name&quot;);
+    assert_true(desc.writable, &quot;must be writable&quot;);
+    assert_true(desc.enumerable, &quot;must be enumerable&quot;);
+    assert_true(desc.configurable, &quot;must be configurable&quot;);
+  }, desc + &quot;Object.getOwnPropertyDescriptor(exception, \&quot;code\&quot;)&quot;);
+}
+
+
+// Test in current window
+var exception = null;
+try {
+  // This should throw a HierarchyRequestError in every browser since the
+  // Stone Age, so we're really only testing exception-throwing details.
+  document.documentElement.appendChild(document);
+} catch(e) {
+  exception = e;
+}
+testException(exception, window, &quot;&quot;);
+
+// Test in iframe
+var iframe = document.createElement(&quot;iframe&quot;);
+iframe.src = &quot;about:blank&quot;;
+iframe.onload = function() {
+  var exception = null;
+  try {
+    iframe.contentDocument.documentElement.appendChild(iframe.contentDocument);
+  } catch(e) {
+    exception = e;
+  }
+  testException(exception, iframe.contentWindow, &quot;In iframe: &quot;);
+
+  document.body.removeChild(iframe);
+  done();
+};
+document.body.appendChild(iframe);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindinghasinstanceexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/has-instance-expected.txt (0 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/has-instance-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/has-instance-expected.txt        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -0,0 +1,3 @@
</span><ins>+
+PASS Manually-constructed prototype chains are correctly handled by instanceof 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindinghasinstancehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/has-instance.html (0 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/has-instance.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/has-instance.html        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -0,0 +1,13 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;&lt;/title&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+test(function() {
+  var obj = Object.create(Element.prototype);
+  assert_true(obj instanceof Element);
+  assert_true(obj instanceof Node);
+  assert_false(obj instanceof Attr);
+}, &quot;Manually-constructed prototype chains are correctly handled by instanceof&quot;);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindinginterfaceobjectexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/interface-object-expected.txt (0 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/interface-object-expected.txt                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/interface-object-expected.txt        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -0,0 +1,6 @@
</span><ins>+
+PASS An interface object deleted after it has been accessed is undefined 
+PASS An interface object deleted before it has been defined is undefined 
+PASS Interface objects deleted multiple times stay deleted 
+PASS Fancy property names don't break the resolve hook on Window 
+
</ins></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestsWebIDLecmascriptbindinginterfaceobjecthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/interface-object.html (0 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/interface-object.html                                (rev 0)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/interface-object.html        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -0,0 +1,28 @@
</span><ins>+&lt;!doctype html&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;title&gt;Interface objects&lt;/title&gt;
+&lt;script src=&quot;/resources/testharness.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;/resources/testharnessreport.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+test(function () {
+    assert_equals(typeof window.Blob, &quot;function&quot;)
+    delete window.Blob;
+    assert_equals(window.Blob, undefined);
+}, &quot;An interface object deleted after it has been accessed is undefined&quot;);
+
+test(function () {
+    delete window.File;
+    assert_equals(window.File, undefined);
+}, &quot;An interface object deleted before it has been defined is undefined&quot;);
+
+test(function () {
+    delete window.ImageData;
+    assert_equals(Object.getOwnPropertyDescriptor(window, &quot;ImageData&quot;), undefined);
+    delete window.ImageData;
+    assert_equals(Object.getOwnPropertyDescriptor(window, &quot;ImageData&quot;), undefined);
+}, &quot;Interface objects deleted multiple times stay deleted&quot;);
+
+test(function () {
+    assert_equals(window[&quot;abc\udc88&quot;], undefined);
+}, &quot;Fancy property names don't break the resolve hook on Window&quot;);
+&lt;/script&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (204218 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-08-06 03:48:10 UTC (rev 204218)
+++ trunk/Source/WebCore/ChangeLog        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -1,5 +1,31 @@
</span><span class="cx"> 2016-08-05  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        DOMException should be constructible
+        https://bugs.webkit.org/show_bug.cgi?id=160626
+
+        Reviewed by Darin Adler.
+
+        DOMException should be constructible:
+        - http://heycam.github.io/webidl/#dfn-DOMException
+        - http://heycam.github.io/webidl/#es-DOMException-constructor-object
+
+        DOMException already has a constructor in Firefox and Chrome so this
+        aligns our behavior with other browsers.
+
+        Test: imported/w3c/web-platform-tests/WebIDL/ecmascript-binding/es-exceptions/DOMException-constructor.html
+
+        * dom/DOMCoreException.cpp:
+        (WebCore::errorCodeFromName):
+        (WebCore::DOMCoreException::create):
+        (WebCore::DOMCoreException::DOMCoreException):
+        * dom/DOMCoreException.h:
+        * dom/DOMCoreException.idl:
+        * dom/ExceptionBase.cpp:
+        (WebCore::ExceptionBase::ExceptionBase):
+        * dom/ExceptionBase.h:
+
+2016-08-05  Chris Dumez  &lt;cdumez@apple.com&gt;
+
</ins><span class="cx">         Align Range.insertNode() input validation with the specification
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=160624
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoredomDOMCoreExceptioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DOMCoreException.cpp (204218 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMCoreException.cpp        2016-08-06 03:48:10 UTC (rev 204218)
+++ trunk/Source/WebCore/dom/DOMCoreException.cpp        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -33,47 +33,68 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><ins>+// http://heycam.github.io/webidl/#idl-DOMException-error-names
</ins><span class="cx"> static const struct CoreException {
</span><span class="cx">     const char* const name;
</span><span class="cx">     const char* const description;
</span><ins>+    ExceptionCode code;
</ins><span class="cx"> } coreExceptions[] = {
</span><del>-    { &quot;IndexSizeError&quot;, &quot;The index is not in the allowed range.&quot; },
-    { 0, 0 }, // DOMStringSizeError
-    { &quot;HierarchyRequestError&quot;, &quot;The operation would yield an incorrect node tree.&quot; },
-    { &quot;WrongDocumentError&quot;, &quot;The object is in the wrong document.&quot; },
-    { &quot;InvalidCharacterError&quot;, &quot;The string contains invalid characters.&quot; },
-    { 0, 0 }, // NoDataAllowedError
-    { &quot;NoModificationAllowedError&quot;, &quot;The object can not be modified.&quot; },
-    { &quot;NotFoundError&quot;, &quot;The object can not be found here.&quot; },
-    { &quot;NotSupportedError&quot;, &quot;The operation is not supported.&quot; },
-    { &quot;InUseAttributeError&quot;, &quot;The attribute is in use.&quot; },
-    { &quot;InvalidStateError&quot;, &quot;The object is in an invalid state.&quot; },
-    { &quot;SyntaxError&quot;, &quot;The string did not match the expected pattern.&quot; },
-    { &quot;InvalidModificationError&quot;, &quot; The object can not be modified in this way.&quot; },
-    { &quot;NamespaceError&quot;, &quot;The operation is not allowed by Namespaces in XML.&quot; },
-    { &quot;InvalidAccessError&quot;, &quot;The object does not support the operation or argument.&quot; },
-    { 0, 0 }, // ValidationError
-    { &quot;TypeMismatchError&quot;, &quot;The type of an object was incompatible with the expected type of the parameter associated to the object.&quot; },
-    { &quot;SecurityError&quot;, &quot;The operation is insecure.&quot; },
-    { &quot;NetworkError&quot;, &quot; A network error occurred.&quot; },
-    { &quot;AbortError&quot;, &quot;The operation was aborted.&quot; },
-    { &quot;URLMismatchError&quot;, &quot;The given URL does not match another URL.&quot; },
-    { &quot;QuotaExceededError&quot;, &quot;The quota has been exceeded.&quot; },
-    { &quot;TimeoutError&quot;, &quot;The operation timed out.&quot; },
-    { &quot;InvalidNodeTypeError&quot;, &quot;The supplied node is incorrect or has an incorrect ancestor for this operation.&quot; },
-    { &quot;DataCloneError&quot;, &quot;The object can not be cloned.&quot; },
-    { &quot;EncodingError&quot;, &quot;The encoding operation (either encoded or decoding) failed.&quot; },
-    { &quot;NotReadableError&quot;, &quot;The I/O read operation failed.&quot; },
-    { &quot;UnknownError&quot;, &quot;The operation failed for an unknown transient reason (e.g. out of memory).&quot; },
-    { &quot;ConstraintError&quot;, &quot;A mutation operation in a transaction failed because a constraint was not satisfied.&quot; },
-    { &quot;DataError&quot;, &quot;Provided data is inadequate.&quot; },
-    { &quot;TransactionInactiveError&quot;, &quot;A request was placed against a transaction which is currently not active, or which is finished.&quot; },
-    { &quot;ReadOnlyError&quot;, &quot;The mutating operation was attempted in a \&quot;readonly\&quot; transaction.&quot; },
-    { &quot;VersionError&quot;, &quot;An attempt was made to open a database using a lower version than the existing version.&quot; },
-    { &quot;OperationError&quot;, &quot;The operation failed for an operation-specific reason.&quot; },
-    { &quot;NotAllowedError&quot;, &quot;The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.&quot; }
</del><ins>+    { &quot;IndexSizeError&quot;, &quot;The index is not in the allowed range.&quot;, 1 },
+    { nullptr, nullptr, 0 }, // DOMStringSizeError
+    { &quot;HierarchyRequestError&quot;, &quot;The operation would yield an incorrect node tree.&quot;, 3 },
+    { &quot;WrongDocumentError&quot;, &quot;The object is in the wrong document.&quot;, 4 },
+    { &quot;InvalidCharacterError&quot;, &quot;The string contains invalid characters.&quot;, 5 },
+    { nullptr, nullptr, 0 }, // NoDataAllowedError
+    { &quot;NoModificationAllowedError&quot;, &quot;The object can not be modified.&quot;, 7 },
+    { &quot;NotFoundError&quot;, &quot;The object can not be found here.&quot;, 8 },
+    { &quot;NotSupportedError&quot;, &quot;The operation is not supported.&quot;, 9 },
+    { &quot;InUseAttributeError&quot;, &quot;The attribute is in use.&quot;, 10 },
+    { &quot;InvalidStateError&quot;, &quot;The object is in an invalid state.&quot;, 11 },
+    { &quot;SyntaxError&quot;, &quot;The string did not match the expected pattern.&quot;, 12 },
+    { &quot;InvalidModificationError&quot;, &quot; The object can not be modified in this way.&quot;, 13 },
+    { &quot;NamespaceError&quot;, &quot;The operation is not allowed by Namespaces in XML.&quot;, 14 },
+    { &quot;InvalidAccessError&quot;, &quot;The object does not support the operation or argument.&quot;, 15 },
+    { nullptr, nullptr, 0 }, // ValidationError
+    { &quot;TypeMismatchError&quot;, &quot;The type of an object was incompatible with the expected type of the parameter associated to the object.&quot;, 17 },
+    { &quot;SecurityError&quot;, &quot;The operation is insecure.&quot;, 18 },
+    { &quot;NetworkError&quot;, &quot; A network error occurred.&quot;, 19 },
+    { &quot;AbortError&quot;, &quot;The operation was aborted.&quot;, 20 },
+    { &quot;URLMismatchError&quot;, &quot;The given URL does not match another URL.&quot;, 21 },
+    { &quot;QuotaExceededError&quot;, &quot;The quota has been exceeded.&quot;, 22 },
+    { &quot;TimeoutError&quot;, &quot;The operation timed out.&quot;, 23 },
+    { &quot;InvalidNodeTypeError&quot;, &quot;The supplied node is incorrect or has an incorrect ancestor for this operation.&quot;, 24 },
+    { &quot;DataCloneError&quot;, &quot;The object can not be cloned.&quot;, 25 },
+    { &quot;EncodingError&quot;, &quot;The encoding operation (either encoded or decoding) failed.&quot;, 0 },
+    { &quot;NotReadableError&quot;, &quot;The I/O read operation failed.&quot;, 0 },
+    { &quot;UnknownError&quot;, &quot;The operation failed for an unknown transient reason (e.g. out of memory).&quot;, 0 },
+    { &quot;ConstraintError&quot;, &quot;A mutation operation in a transaction failed because a constraint was not satisfied.&quot;, 0 },
+    { &quot;DataError&quot;, &quot;Provided data is inadequate.&quot;, 0 },
+    { &quot;TransactionInactiveError&quot;, &quot;A request was placed against a transaction which is currently not active, or which is finished.&quot;, 0 },
+    { &quot;ReadOnlyError&quot;, &quot;The mutating operation was attempted in a \&quot;readonly\&quot; transaction.&quot;, 0 },
+    { &quot;VersionError&quot;, &quot;An attempt was made to open a database using a lower version than the existing version.&quot;, 0 },
+    { &quot;OperationError&quot;, &quot;The operation failed for an operation-specific reason.&quot;, 0 },
+    { &quot;NotAllowedError&quot;, &quot;The request is not allowed by the user agent or the platform in the current context, possibly because the user denied permission.&quot;, 0 }
</ins><span class="cx"> };
</span><span class="cx"> 
</span><ins>+static ExceptionCode errorCodeFromName(const String&amp; name)
+{
+    for (auto&amp; entry : coreExceptions) {
+        if (entry.name == name)
+            return entry.code;
+    }
+    return 0;
+}
+
+Ref&lt;DOMCoreException&gt; DOMCoreException::create(const String&amp; message, const String&amp; name)
+{
+    return adoptRef(*new DOMCoreException(errorCodeFromName(name), message, name));
+}
+
+DOMCoreException::DOMCoreException(ExceptionCode ec, const String&amp; message, const String&amp; name)
+    : ExceptionBase(ec, name, message, ASCIILiteral(&quot;DOM&quot;))
+{
+}
+
</ins><span class="cx"> bool DOMCoreException::initializeDescription(ExceptionCode ec, ExceptionCodeDescription* description)
</span><span class="cx"> {
</span><span class="cx">     description-&gt;typeName = &quot;DOM&quot;;
</span></span></pre></div>
<a id="trunkSourceWebCoredomDOMCoreExceptionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DOMCoreException.h (204218 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMCoreException.h        2016-08-06 03:48:10 UTC (rev 204218)
+++ trunk/Source/WebCore/dom/DOMCoreException.h        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -39,10 +39,12 @@
</span><span class="cx">     {
</span><span class="cx">         return adoptRef(*new DOMCoreException(description));
</span><span class="cx">     }
</span><ins>+    static Ref&lt;DOMCoreException&gt; create(const String&amp; message, const String&amp; name);
</ins><span class="cx"> 
</span><span class="cx">     static bool initializeDescription(ExceptionCode, ExceptionCodeDescription*);
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><ins>+    DOMCoreException(ExceptionCode, const String&amp; message, const String&amp; name);
</ins><span class="cx">     explicit DOMCoreException(const ExceptionCodeDescription&amp; description)
</span><span class="cx">         : ExceptionBase(description)
</span><span class="cx">     {
</span></span></pre></div>
<a id="trunkSourceWebCoredomDOMCoreExceptionidl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/DOMCoreException.idl (204218 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/DOMCoreException.idl        2016-08-06 03:48:10 UTC (rev 204218)
+++ trunk/Source/WebCore/dom/DOMCoreException.idl        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx">  */
</span><span class="cx"> 
</span><span class="cx"> [
</span><ins>+    Constructor(optional DOMString message = &quot;&quot;, optional DOMString name = &quot;Error&quot;),
</ins><span class="cx">     DoNotCheckConstants,
</span><span class="cx">     Exposed=(Window,Worker),
</span><span class="cx">     InterfaceName=DOMException,
</span></span></pre></div>
<a id="trunkSourceWebCoredomExceptionBasecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ExceptionBase.cpp (204218 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ExceptionBase.cpp        2016-08-06 03:48:10 UTC (rev 204218)
+++ trunk/Source/WebCore/dom/ExceptionBase.cpp        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -41,6 +41,14 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+ExceptionBase::ExceptionBase(unsigned short code, const String&amp; name, const String&amp; message, const String&amp; typeName)
+    : m_code(code)
+    , m_name(name)
+    , m_message(message)
+    , m_typeName(typeName)
+{
+}
+
</ins><span class="cx"> String ExceptionBase::toString() const
</span><span class="cx"> {
</span><span class="cx">     if (!m_toString.isEmpty())
</span></span></pre></div>
<a id="trunkSourceWebCoredomExceptionBaseh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/dom/ExceptionBase.h (204218 => 204219)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/dom/ExceptionBase.h        2016-08-06 03:48:10 UTC (rev 204218)
+++ trunk/Source/WebCore/dom/ExceptionBase.h        2016-08-06 05:34:57 UTC (rev 204219)
</span><span class="lines">@@ -47,6 +47,7 @@
</span><span class="cx"> 
</span><span class="cx"> protected:
</span><span class="cx">     explicit ExceptionBase(const ExceptionCodeDescription&amp;);
</span><ins>+    ExceptionBase(unsigned short code, const String&amp; name, const String&amp; message, const String&amp; typeName);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     unsigned short m_code;
</span></span></pre>
</div>
</div>

</body>
</html>