<!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>[196648] 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/196648">196648</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2016-02-16 12:23:02 -0800 (Tue, 16 Feb 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Web IDL] Operations should be on the instance for global objects or if [Unforgeable]
https://bugs.webkit.org/show_bug.cgi?id=154120
&lt;rdar://problem/24613231&gt;

Reviewed by Gavin Barraclough.

LayoutTests/imported/w3c:

Rebaseline now that more checks are passing.

* web-platform-tests/html/dom/interfaces-expected.txt:

Source/JavaScriptCore:

Have putEntry() take a thisValue parameter in addition to the base,
instead of relying on PropertySlot::thisValue() because this did not
always do the right thing. In particular, when JSDOMWindow::put() was
called to set a function, it would end up setting the new value on the
JSDOMWindowShell instead of the actual JSDOMWindow.
JSDOMWindow::getOwnPropertySlot() would then not be able to find it.
Therefore the following would fail:
$ window.open = &quot;test&quot;
$ console.log(window.open) // prints the native function instead of &quot;test&quot;

* runtime/JSObject.cpp:
(JSC::JSObject::putInlineSlow):
* runtime/Lookup.h:
(JSC::putEntry):
(JSC::lookupPut):

Source/WebCore:

Operations should be on the instance for global objects or if
[Unforgeable] as per the Web IDL specification:
- http://heycam.github.io/webidl/#es-operations
- http://heycam.github.io/webidl/#dfn-unforgeable-on-an-interface

This patch implements this behavior in order to align
with the specification and other browsers.

No new tests, already covered by existing tests.

* bindings/js/JSDOMWindowCustom.cpp:
(WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
Update function names now that they have &quot;Instance&quot; in their
name instead of &quot;Prototype&quot;.

(WebCore::JSDOMWindow::getOwnPropertySlot):
- Update function names now that they have &quot;Instance&quot; in their
  name instead of &quot;Prototype&quot;.
- Move the functions hard-coding *before* the static table check
  now that these functions are in the static table to maintain
  the previous behavior.

* bindings/js/JSLocationCustom.cpp:
(WebCore::JSLocation::getOwnPropertySlotDelegate):
Update function names now that they have &quot;Instance&quot; in their
name instead of &quot;Prototype&quot;.

* bindings/scripts/CodeGeneratorJS.pm:
- Move functions to the instance if their interface is a global
  object or if they are marked as [Unforgeable]. Operations are
  now treated more like attributes, as they can now be either on
  the instance or the prototype. In a lot of places, I now use
  the naming &quot;properties&quot; instead of &quot;attributes&quot; as &quot;properties&quot;
  refer both &quot;attributes&quot; and &quot;operations&quot; / &quot;functions&quot;.

* bindings/scripts/test/JS/JSTestInterface.cpp:
* bindings/scripts/test/JS/JSTestObj.cpp:
Rebaseline bindings tests.

LayoutTests:

* inspector/model/remote-object-get-properties-expected.txt:
Rebaseline test because the order of static properties has changed:
functions are now before constants instead of after.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cChangeLog">trunk/LayoutTests/imported/w3c/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsimportedw3cwebplatformtestshtmldominterfacesexpectedtxt">trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt</a></li>
<li><a href="#trunkLayoutTestsinspectormodelremoteobjectgetpropertiesexpectedtxt">trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt</a></li>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSObjectcpp">trunk/Source/JavaScriptCore/runtime/JSObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeLookuph">trunk/Source/JavaScriptCore/runtime/Lookup.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp">trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSLocationCustomcpp">trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (196647 => 196648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/LayoutTests/ChangeLog        2016-02-16 20:23:02 UTC (rev 196648)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-02-16  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        [Web IDL] Operations should be on the instance for global objects or if [Unforgeable]
+        https://bugs.webkit.org/show_bug.cgi?id=154120
+        &lt;rdar://problem/24613231&gt;
+
+        Reviewed by Gavin Barraclough.
+
+        * inspector/model/remote-object-get-properties-expected.txt:
+        Rebaseline test because the order of static properties has changed:
+        functions are now before constants instead of after.
+
</ins><span class="cx"> 2016-02-16  Ryan Haddad  &lt;ryanhaddad@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Marking webarchive/loading/missing-data.html as flaky on ios-simulator-wk2
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/ChangeLog (196647 => 196648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/ChangeLog        2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/LayoutTests/imported/w3c/ChangeLog        2016-02-16 20:23:02 UTC (rev 196648)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2016-02-16  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        [Web IDL] Operations should be on the instance for global objects or if [Unforgeable]
+        https://bugs.webkit.org/show_bug.cgi?id=154120
+        &lt;rdar://problem/24613231&gt;
+
+        Reviewed by Gavin Barraclough.
+
+        Rebaseline now that more checks are passing.
+
+        * web-platform-tests/html/dom/interfaces-expected.txt:
+
</ins><span class="cx"> 2016-02-15  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         The following properties should exist on the global object: AudioTrackList, AudioTrack, VideoTrackList, VideoTrack
</span></span></pre></div>
<a id="trunkLayoutTestsimportedw3cwebplatformtestshtmldominterfacesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt (196647 => 196648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt        2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/LayoutTests/imported/w3c/web-platform-tests/html/dom/interfaces-expected.txt        2016-02-16 20:23:02 UTC (rev 196648)
</span><span class="lines">@@ -3824,30 +3824,30 @@
</span><span class="cx"> PASS Window interface: attribute statusbar 
</span><span class="cx"> PASS Window interface: attribute toolbar 
</span><span class="cx"> PASS Window interface: attribute status 
</span><del>-FAIL Window interface: operation close() assert_equals: property should be writable if and only if not unforgeable expected true but got false
</del><ins>+PASS Window interface: operation close() 
</ins><span class="cx"> PASS Window interface: attribute closed 
</span><del>-FAIL Window interface: operation stop() desc is not an Object. (evaluating '&quot;get&quot; in desc')
-FAIL Window interface: operation focus() assert_equals: property should be writable if and only if not unforgeable expected true but got false
-FAIL Window interface: operation blur() assert_equals: property should be writable if and only if not unforgeable expected true but got false
</del><ins>+PASS Window interface: operation stop() 
+PASS Window interface: operation focus() 
+PASS Window interface: operation blur() 
</ins><span class="cx"> PASS Window interface: attribute frames 
</span><span class="cx"> PASS Window interface: attribute length 
</span><span class="cx"> PASS Window interface: attribute opener 
</span><span class="cx"> PASS Window interface: attribute parent 
</span><span class="cx"> PASS Window interface: attribute frameElement 
</span><del>-FAIL Window interface: operation open(DOMString,DOMString,DOMString,boolean) desc is not an Object. (evaluating '&quot;get&quot; in desc')
</del><ins>+FAIL Window interface: operation open(DOMString,DOMString,DOMString,boolean) assert_equals: property has wrong .length expected 0 but got 2
</ins><span class="cx"> FAIL Window interface: attribute navigator assert_equals: setter must be undefined for readonly attributes expected (undefined) undefined but got (function) function &quot;function navigator() {
</span><span class="cx">     [native code]
</span><span class="cx"> }&quot;
</span><span class="cx"> FAIL Window interface: attribute external assert_own_property: The global object must have a property &quot;external&quot; expected property &quot;external&quot; missing
</span><span class="cx"> PASS Window interface: attribute applicationCache 
</span><del>-FAIL Window interface: operation alert() desc is not an Object. (evaluating '&quot;get&quot; in desc')
-FAIL Window interface: operation confirm(DOMString) desc is not an Object. (evaluating '&quot;get&quot; in desc')
-FAIL Window interface: operation prompt(DOMString,DOMString) desc is not an Object. (evaluating '&quot;get&quot; in desc')
-FAIL Window interface: operation print() desc is not an Object. (evaluating '&quot;get&quot; in desc')
-FAIL Window interface: operation showModalDialog(DOMString,any) desc is not an Object. (evaluating '&quot;get&quot; in desc')
-FAIL Window interface: operation postMessage(any,DOMString,[object Object]) assert_equals: property should be writable if and only if not unforgeable expected true but got false
-FAIL Window interface: operation captureEvents() desc is not an Object. (evaluating '&quot;get&quot; in desc')
-FAIL Window interface: operation releaseEvents() desc is not an Object. (evaluating '&quot;get&quot; in desc')
</del><ins>+PASS Window interface: operation alert() 
+PASS Window interface: operation confirm(DOMString) 
+PASS Window interface: operation prompt(DOMString,DOMString) 
+PASS Window interface: operation print() 
+PASS Window interface: operation showModalDialog(DOMString,any) 
+PASS Window interface: operation postMessage(any,DOMString,[object Object]) 
+PASS Window interface: operation captureEvents() 
+PASS Window interface: operation releaseEvents() 
</ins><span class="cx"> PASS Window interface: attribute onabort 
</span><span class="cx"> FAIL Window interface: attribute onautocomplete assert_own_property: The global object must have a property &quot;onautocomplete&quot; expected property &quot;onautocomplete&quot; missing
</span><span class="cx"> FAIL Window interface: attribute onautocompleteerror assert_own_property: The global object must have a property &quot;onautocompleteerror&quot; expected property &quot;onautocompleteerror&quot; missing
</span><span class="lines">@@ -3924,14 +3924,14 @@
</span><span class="cx"> PASS Window interface: attribute onpopstate 
</span><span class="cx"> PASS Window interface: attribute onstorage 
</span><span class="cx"> PASS Window interface: attribute onunload 
</span><del>-FAIL Window interface: operation btoa(DOMString) desc is not an Object. (evaluating '&quot;get&quot; in desc')
-FAIL Window interface: operation atob(DOMString) desc is not an Object. (evaluating '&quot;get&quot; in desc')
-FAIL Window interface: operation setTimeout(Function,long,any) desc is not an Object. (evaluating '&quot;get&quot; in desc')
-FAIL Window interface: operation setTimeout(DOMString,long,any) desc is not an Object. (evaluating '&quot;get&quot; in desc')
-FAIL Window interface: operation clearTimeout(long) desc is not an Object. (evaluating '&quot;get&quot; in desc')
-FAIL Window interface: operation setInterval(Function,long,any) desc is not an Object. (evaluating '&quot;get&quot; in desc')
-FAIL Window interface: operation setInterval(DOMString,long,any) desc is not an Object. (evaluating '&quot;get&quot; in desc')
-FAIL Window interface: operation clearInterval(long) desc is not an Object. (evaluating '&quot;get&quot; in desc')
</del><ins>+PASS Window interface: operation btoa(DOMString) 
+PASS Window interface: operation atob(DOMString) 
+PASS Window interface: operation setTimeout(Function,long,any) 
+PASS Window interface: operation setTimeout(DOMString,long,any) 
+PASS Window interface: operation clearTimeout(long) 
+PASS Window interface: operation setInterval(Function,long,any) 
+PASS Window interface: operation setInterval(DOMString,long,any) 
+PASS Window interface: operation clearInterval(long) 
</ins><span class="cx"> FAIL Window interface: operation createImageBitmap(ImageBitmapSource,long,long,long,long) assert_own_property: global object missing non-static operation expected property &quot;createImageBitmap&quot; missing
</span><span class="cx"> PASS Window interface: attribute sessionStorage 
</span><span class="cx"> PASS Window interface: attribute localStorage 
</span><span class="lines">@@ -4142,11 +4142,15 @@
</span><span class="cx"> PASS Location interface: window.location must have own property &quot;pathname&quot; 
</span><span class="cx"> PASS Location interface: window.location must have own property &quot;search&quot; 
</span><span class="cx"> PASS Location interface: window.location must have own property &quot;hash&quot; 
</span><del>-FAIL Location interface: window.location must have own property &quot;assign&quot; assert_own_property: Doesn't have the unforgeable operation property expected property &quot;assign&quot; missing
-FAIL Location interface: calling assign(USVString) on window.location with too few arguments must throw TypeError assert_own_property: expected property &quot;assign&quot; missing
-FAIL Location interface: window.location must have own property &quot;replace&quot; assert_own_property: Doesn't have the unforgeable operation property expected property &quot;replace&quot; missing
-FAIL Location interface: calling replace(USVString) on window.location with too few arguments must throw TypeError assert_own_property: expected property &quot;replace&quot; missing
-FAIL Location interface: window.location must have own property &quot;reload&quot; assert_own_property: Doesn't have the unforgeable operation property expected property &quot;reload&quot; missing
</del><ins>+FAIL Location interface: window.location must have own property &quot;assign&quot; assert_equals: property should be writable if and only if not unforgeable expected false but got true
+FAIL Location interface: calling assign(USVString) on window.location with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
+    [native code]
+}&quot; did not throw
+FAIL Location interface: window.location must have own property &quot;replace&quot; assert_equals: property should be writable if and only if not unforgeable expected false but got true
+FAIL Location interface: calling replace(USVString) on window.location with too few arguments must throw TypeError assert_throws: Called with 0 arguments function &quot;function () {
+    [native code]
+}&quot; did not throw
+FAIL Location interface: window.location must have own property &quot;reload&quot; assert_equals: property should be writable if and only if not unforgeable expected false but got true
</ins><span class="cx"> PASS Location interface: window.location must have own property &quot;ancestorOrigins&quot; 
</span><span class="cx"> PASS PopStateEvent interface: existence and properties of interface object 
</span><span class="cx"> PASS PopStateEvent interface object length 
</span></span></pre></div>
<a id="trunkLayoutTestsinspectormodelremoteobjectgetpropertiesexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt (196647 => 196648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt        2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/LayoutTests/inspector/model/remote-object-get-properties-expected.txt        2016-02-16 20:23:02 UTC (rev 196648)
</span><span class="lines">@@ -71,6 +71,10 @@
</span><span class="cx">     returnValue
</span><span class="cx">     cancelBubble
</span><span class="cx">     clipboardData
</span><ins>+    stopPropagation
+    preventDefault
+    initEvent
+    stopImmediatePropagation
</ins><span class="cx">     NONE
</span><span class="cx">     CAPTURING_PHASE
</span><span class="cx">     AT_TARGET
</span><span class="lines">@@ -91,10 +95,6 @@
</span><span class="cx">     BLUR
</span><span class="cx">     SELECT
</span><span class="cx">     CHANGE
</span><del>-    stopPropagation
-    preventDefault
-    initEvent
-    stopImmediatePropagation
</del><span class="cx">     toString
</span><span class="cx">     toLocaleString
</span><span class="cx">     valueOf
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (196647 => 196648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog        2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/Source/JavaScriptCore/ChangeLog        2016-02-16 20:23:02 UTC (rev 196648)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2016-02-16  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        [Web IDL] Operations should be on the instance for global objects or if [Unforgeable]
+        https://bugs.webkit.org/show_bug.cgi?id=154120
+        &lt;rdar://problem/24613231&gt;
+
+        Reviewed by Gavin Barraclough.
+
+        Have putEntry() take a thisValue parameter in addition to the base,
+        instead of relying on PropertySlot::thisValue() because this did not
+        always do the right thing. In particular, when JSDOMWindow::put() was
+        called to set a function, it would end up setting the new value on the
+        JSDOMWindowShell instead of the actual JSDOMWindow.
+        JSDOMWindow::getOwnPropertySlot() would then not be able to find it.
+        Therefore the following would fail:
+        $ window.open = &quot;test&quot;
+        $ console.log(window.open) // prints the native function instead of &quot;test&quot;
+
+        * runtime/JSObject.cpp:
+        (JSC::JSObject::putInlineSlow):
+        * runtime/Lookup.h:
+        (JSC::putEntry):
+        (JSC::lookupPut):
+
</ins><span class="cx"> 2016-02-16  Keith Miller  &lt;keith_miller@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         ClonedArguments should not materialize its special properties unless they are being changed or deleted
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSObject.cpp (196647 => 196648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/Source/JavaScriptCore/runtime/JSObject.cpp        2016-02-16 20:23:02 UTC (rev 196648)
</span><span class="lines">@@ -416,7 +416,7 @@
</span><span class="cx">         if (!obj-&gt;staticFunctionsReified()) {
</span><span class="cx">             if (obj-&gt;classInfo()-&gt;hasStaticSetterOrReadonlyProperties()) {
</span><span class="cx">                 if (auto* entry = obj-&gt;findPropertyHashEntry(propertyName)) {
</span><del>-                    putEntry(exec, entry, obj, propertyName, value, slot);
</del><ins>+                    putEntry(exec, entry, obj, this, propertyName, value, slot);
</ins><span class="cx">                     return;
</span><span class="cx">                 }
</span><span class="cx">             }
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeLookuph"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/Lookup.h (196647 => 196648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/Lookup.h        2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/Source/JavaScriptCore/runtime/Lookup.h        2016-02-16 20:23:02 UTC (rev 196648)
</span><span class="lines">@@ -268,18 +268,21 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline void putEntry(ExecState* exec, const HashTableValue* entry, JSObject* base, PropertyName propertyName, JSValue value, PutPropertySlot&amp; slot)
</del><ins>+// 'base' means the object holding the property (possibly in the prototype chain of the object put was called on).
+// 'thisValue' is the object that put is being applied to (in the case of a proxy, the proxy target).
+// 'slot.thisValue()' is the object the put was originally performed on (in the case of a proxy, the proxy itself).
+inline void putEntry(ExecState* exec, const HashTableValue* entry, JSObject* base, JSObject* thisValue, PropertyName propertyName, JSValue value, PutPropertySlot&amp; slot)
</ins><span class="cx"> {
</span><span class="cx">     // If this is a function put it as an override property.
</span><span class="cx">     if (entry-&gt;attributes() &amp; BuiltinOrFunction) {
</span><del>-        if (JSObject* thisObject = jsDynamicCast&lt;JSObject*&gt;(slot.thisValue()))
</del><ins>+        if (JSObject* thisObject = jsDynamicCast&lt;JSObject*&gt;(thisValue))
</ins><span class="cx">             thisObject-&gt;putDirect(exec-&gt;vm(), propertyName, value);
</span><span class="cx">     } else if (entry-&gt;attributes() &amp; Accessor) {
</span><span class="cx">         if (slot.isStrictMode())
</span><span class="cx">             throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
</span><span class="cx">     } else if (!(entry-&gt;attributes() &amp; ReadOnly)) {
</span><del>-        JSValue thisValue = entry-&gt;attributes() &amp; CustomAccessor ? slot.thisValue() : JSValue(base);
-        entry-&gt;propertyPutter()(exec, JSValue::encode(thisValue), JSValue::encode(value));
</del><ins>+        JSValue updateThisValue = entry-&gt;attributes() &amp; CustomAccessor ? slot.thisValue() : JSValue(base);
+        entry-&gt;propertyPutter()(exec, JSValue::encode(updateThisValue), JSValue::encode(value));
</ins><span class="cx">         if (entry-&gt;attributes() &amp; CustomAccessor)
</span><span class="cx">             slot.setCustomAccessor(base, entry-&gt;propertyPutter());
</span><span class="cx">         else
</span><span class="lines">@@ -300,7 +303,7 @@
</span><span class="cx">     if (!entry)
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><del>-    putEntry(exec, entry, base, propertyName, value, slot);
</del><ins>+    putEntry(exec, entry, base, base, propertyName, value, slot);
</ins><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (196647 => 196648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/Source/WebCore/ChangeLog        2016-02-16 20:23:02 UTC (rev 196648)
</span><span class="lines">@@ -1,3 +1,50 @@
</span><ins>+2016-02-16  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        [Web IDL] Operations should be on the instance for global objects or if [Unforgeable]
+        https://bugs.webkit.org/show_bug.cgi?id=154120
+        &lt;rdar://problem/24613231&gt;
+
+        Reviewed by Gavin Barraclough.
+
+        Operations should be on the instance for global objects or if
+        [Unforgeable] as per the Web IDL specification:
+        - http://heycam.github.io/webidl/#es-operations
+        - http://heycam.github.io/webidl/#dfn-unforgeable-on-an-interface
+
+        This patch implements this behavior in order to align
+        with the specification and other browsers.
+
+        No new tests, already covered by existing tests.
+
+        * bindings/js/JSDOMWindowCustom.cpp:
+        (WebCore::jsDOMWindowGetOwnPropertySlotRestrictedAccess):
+        Update function names now that they have &quot;Instance&quot; in their
+        name instead of &quot;Prototype&quot;.
+
+        (WebCore::JSDOMWindow::getOwnPropertySlot):
+        - Update function names now that they have &quot;Instance&quot; in their
+          name instead of &quot;Prototype&quot;.
+        - Move the functions hard-coding *before* the static table check
+          now that these functions are in the static table to maintain
+          the previous behavior.
+
+        * bindings/js/JSLocationCustom.cpp:
+        (WebCore::JSLocation::getOwnPropertySlotDelegate):
+        Update function names now that they have &quot;Instance&quot; in their
+        name instead of &quot;Prototype&quot;.
+
+        * bindings/scripts/CodeGeneratorJS.pm:
+        - Move functions to the instance if their interface is a global
+          object or if they are marked as [Unforgeable]. Operations are
+          now treated more like attributes, as they can now be either on
+          the instance or the prototype. In a lot of places, I now use
+          the naming &quot;properties&quot; instead of &quot;attributes&quot; as &quot;properties&quot;
+          refer both &quot;attributes&quot; and &quot;operations&quot; / &quot;functions&quot;.
+
+        * bindings/scripts/test/JS/JSTestInterface.cpp:
+        * bindings/scripts/test/JS/JSTestObj.cpp:
+        Rebaseline bindings tests.
+
</ins><span class="cx"> 2016-02-16  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Rollout r188659. This broke scrolling of iframes and overflow when
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMWindowCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (196647 => 196648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp        2016-02-16 20:23:02 UTC (rev 196648)
</span><span class="lines">@@ -109,7 +109,7 @@
</span><span class="cx">             return true;
</span><span class="cx">         }
</span><span class="cx">         if (propertyName == exec-&gt;propertyNames().close) {
</span><del>-            slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowPrototypeFunctionClose, 0&gt;);
</del><ins>+            slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowInstanceFunctionClose, 0&gt;);
</ins><span class="cx">             return true;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -122,19 +122,19 @@
</span><span class="cx">     // These are the functions we allow access to cross-origin (DoNotCheckSecurity in IDL).
</span><span class="cx">     // Always provide the original function, on a fresh uncached function object.
</span><span class="cx">     if (propertyName == exec-&gt;propertyNames().blur) {
</span><del>-        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowPrototypeFunctionBlur, 0&gt;);
</del><ins>+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowInstanceFunctionBlur, 0&gt;);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     if (propertyName == exec-&gt;propertyNames().close) {
</span><del>-        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowPrototypeFunctionClose, 0&gt;);
</del><ins>+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowInstanceFunctionClose, 0&gt;);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     if (propertyName == exec-&gt;propertyNames().focus) {
</span><del>-        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowPrototypeFunctionFocus, 0&gt;);
</del><ins>+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowInstanceFunctionFocus, 0&gt;);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     if (propertyName == exec-&gt;propertyNames().postMessage) {
</span><del>-        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowPrototypeFunctionPostMessage, 2&gt;);
</del><ins>+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowInstanceFunctionPostMessage, 2&gt;);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -258,31 +258,36 @@
</span><span class="cx">     // FIXME: we should probably be able to use getStaticPropertySlot here.
</span><span class="cx">     if (Base::getOwnPropertySlot(thisObject, exec, propertyName, slot))
</span><span class="cx">         return true;
</span><del>-    if (!thisObject-&gt;staticFunctionsReified()) {
-        if (auto* entry = JSDOMWindow::info()-&gt;staticPropHashTable-&gt;entry(propertyName)) {
-            slot.setCacheableCustom(thisObject, entry-&gt;attributes(), entry-&gt;propertyGetter());
-            return true;
-        }
-    }
</del><ins>+
</ins><span class="cx">     // FIXME: These are all bogus. Keeping these here make some tests pass that check these properties
</span><span class="cx">     // are own properties of the window, but introduces other problems instead (e.g. if you overwrite
</span><span class="cx">     // &amp; delete then the original value is restored!) Should be removed.
</span><span class="cx">     if (propertyName == exec-&gt;propertyNames().blur) {
</span><del>-        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowPrototypeFunctionBlur, 0&gt;);
</del><ins>+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowInstanceFunctionBlur, 0&gt;);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     if (propertyName == exec-&gt;propertyNames().close) {
</span><del>-        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowPrototypeFunctionClose, 0&gt;);
</del><ins>+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowInstanceFunctionClose, 0&gt;);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     if (propertyName == exec-&gt;propertyNames().focus) {
</span><del>-        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowPrototypeFunctionFocus, 0&gt;);
</del><ins>+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowInstanceFunctionFocus, 0&gt;);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     if (propertyName == exec-&gt;propertyNames().postMessage) {
</span><del>-        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowPrototypeFunctionPostMessage, 2&gt;);
</del><ins>+        slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsDOMWindowInstanceFunctionPostMessage, 2&gt;);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><ins>+
+    if (!thisObject-&gt;staticFunctionsReified()) {
+        if (auto* entry = JSDOMWindow::info()-&gt;staticPropHashTable-&gt;entry(propertyName)) {
+            if (entry-&gt;attributes() &amp; BuiltinOrFunctionOrAccessor)
+                return setUpStaticFunctionSlot(exec, entry, thisObject, propertyName, slot);
+            slot.setCacheableCustom(thisObject, entry-&gt;attributes(), entry-&gt;propertyGetter());
+            return true;
+        }
+    }
+
</ins><span class="cx">     // FIXME: this looks pretty bogus. It seems highly likely that if !canShowModalDialog the
</span><span class="cx">     // funtion should still be present, or should be omitted entirely - present but reads as
</span><span class="cx">     // undefined with unspecified attributes is likely wrong.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSLocationCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp (196647 => 196648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp        2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/Source/WebCore/bindings/js/JSLocationCustom.cpp        2016-02-16 20:23:02 UTC (rev 196648)
</span><span class="lines">@@ -50,15 +50,15 @@
</span><span class="cx">     // Check for the few functions that we allow, even when called cross-domain.
</span><span class="cx">     // Make these read-only / non-configurable to prevent writes via defineProperty.
</span><span class="cx">     if (propertyName == exec-&gt;propertyNames().replace) {
</span><del>-        slot.setCustom(this, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsLocationPrototypeFunctionReplace, 1&gt;);
</del><ins>+        slot.setCustom(this, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsLocationInstanceFunctionReplace, 1&gt;);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     if (propertyName == exec-&gt;propertyNames().reload) {
</span><del>-        slot.setCustom(this, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsLocationPrototypeFunctionReload, 0&gt;);
</del><ins>+        slot.setCustom(this, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsLocationInstanceFunctionReload, 0&gt;);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx">     if (propertyName == exec-&gt;propertyNames().assign) {
</span><del>-        slot.setCustom(this, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsLocationPrototypeFunctionAssign, 1&gt;);
</del><ins>+        slot.setCustom(this, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter&lt;jsLocationInstanceFunctionAssign, 1&gt;);
</ins><span class="cx">         return true;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (196647 => 196648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-02-16 20:23:02 UTC (rev 196648)
</span><span class="lines">@@ -3,7 +3,7 @@
</span><span class="cx"> # Copyright (C) 2006 Anders Carlsson &lt;andersca@mac.com&gt;
</span><span class="cx"> # Copyright (C) 2006, 2007 Samuel Weinig &lt;sam@webkit.org&gt;
</span><span class="cx"> # Copyright (C) 2006 Alexey Proskuryakov &lt;ap@webkit.org&gt;
</span><del>-# Copyright (C) 2006, 2007-2010, 2013-2105 Apple Inc. All rights reserved.
</del><ins>+# Copyright (C) 2006, 2007-2010, 2013-2016 Apple Inc. All rights reserved.
</ins><span class="cx"> # Copyright (C) 2009 Cameron McCormack &lt;cam@mcc.id.au&gt;
</span><span class="cx"> # Copyright (C) Research In Motion Limited 2010. All rights reserved.
</span><span class="cx"> # Copyright (C) 2010 Nokia Corporation and/or its subsidiary(-ies)
</span><span class="lines">@@ -383,7 +383,7 @@
</span><span class="cx"> 
</span><span class="cx"> sub GenerateGetOwnPropertySlotBody
</span><span class="cx"> {
</span><del>-    my ($interface, $interfaceName, $className, $hasAttributes, $inlined) = @_;
</del><ins>+    my ($interface, $interfaceName, $className, $hasInstanceProperties, $inlined) = @_;
</ins><span class="cx"> 
</span><span class="cx">     my $namespaceMaybe = ($inlined ? &quot;JSC::&quot; : &quot;&quot;);
</span><span class="cx">     my $namedGetterFunction = GetNamedGetterFunction($interface);
</span><span class="lines">@@ -392,12 +392,12 @@
</span><span class="cx">     my @getOwnPropertySlotImpl = ();
</span><span class="cx"> 
</span><span class="cx">     my $ownPropertyCheck = sub {
</span><del>-        if ($hasAttributes) {
-            if ($inlined) {
-                push(@getOwnPropertySlotImpl, &quot;    if (${namespaceMaybe}getStaticValueSlot&lt;$className, Base&gt;(state, *info()-&gt;staticPropHashTable, thisObject, propertyName, slot))\n&quot;);
-            } else {
-                push(@getOwnPropertySlotImpl, &quot;    if (${namespaceMaybe}getStaticValueSlot&lt;$className, Base&gt;(state, ${className}Table, thisObject, propertyName, slot))\n&quot;);
-            }
</del><ins>+        if ($hasInstanceProperties) {
+            my $instanceFunctionCount = InstanceFunctionCount($interface);
+            # If there are functions on the instance, then call getStaticPropertySlot() instead of getStaticValueSlot().
+            my $staticPropertyGetFunction = $namespaceMaybe . ($instanceFunctionCount eq 0 ? &quot;getStaticValueSlot&quot; : &quot;getStaticPropertySlot&quot;);
+            my $staticPropertyTable = $inlined ? &quot;*info()-&gt;staticPropHashTable&quot; : &quot;${className}Table&quot;;
+            push(@getOwnPropertySlotImpl, &quot;    if ($staticPropertyGetFunction&lt;$className, Base&gt;(state, ${staticPropertyTable}, thisObject, propertyName, slot))\n&quot;);
</ins><span class="cx">         } else {
</span><span class="cx">             push(@getOwnPropertySlotImpl, &quot;    if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))\n&quot;);
</span><span class="cx">         }
</span><span class="lines">@@ -605,7 +605,7 @@
</span><span class="cx">         return GetJSBuiltinFunctionName($className, $function);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    my $kind = $function-&gt;isStatic ? &quot;Constructor&quot; : &quot;Prototype&quot;;
</del><ins>+    my $kind = $function-&gt;isStatic ? &quot;Constructor&quot; : (OperationShouldBeOnInstance($interface, $function) ? &quot;Instance&quot; : &quot;Prototype&quot;);
</ins><span class="cx">     return $codeGenerator-&gt;WK_lcfirst($className) . $kind . &quot;Function&quot; . $codeGenerator-&gt;WK_ucfirst($function-&gt;signature-&gt;name);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="lines">@@ -729,6 +729,24 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+# https://heycam.github.io/webidl/#es-operations
+sub OperationShouldBeOnInstance
+{
+    my $interface = shift;
+    my $function = shift;
+
+    # FIXME: The bindings generator does not support putting runtime-enabled on the instance yet.
+    return 0 if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;EnabledAtRuntime&quot;};
+
+    return 1 if IsDOMGlobalObject($interface);
+
+    # [Unforgeable] operations should be on the instance.
+    # https://heycam.github.io/webidl/#Unforgeable
+    return 1 if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Unforgeable&quot;} || $interface-&gt;extendedAttributes-&gt;{&quot;Unforgeable&quot;};
+
+    return 0;
+}
+
</ins><span class="cx"> sub GetIndexedGetterFunction
</span><span class="cx"> {
</span><span class="cx">     my $interface = shift;
</span><span class="lines">@@ -741,32 +759,58 @@
</span><span class="cx">     return GetSpecialAccessorFunctionForType($interface, &quot;getter&quot;, &quot;DOMString&quot;, 1);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub InstanceAttributeCount
</del><ins>+sub InstanceFunctionCount
</ins><span class="cx"> {
</span><span class="cx">     my $interface = shift;
</span><span class="cx">     my $count = 0;
</span><ins>+
+    foreach my $function (@{$interface-&gt;functions}) {
+        $count++ if OperationShouldBeOnInstance($interface, $function);
+    }
+
+    return $count;
+}
+
+sub PrototypeFunctionCount
+{
+    my $interface = shift;
+    my $count = 0;
+
+    foreach my $function (@{$interface-&gt;functions}) {
+        $count++ if !$function-&gt;isStatic &amp;&amp; !OperationShouldBeOnInstance($interface, $function);
+    }
+
+    return $count;
+}
+
+sub InstancePropertyCount
+{
+    my $interface = shift;
+    my $count = 0;
</ins><span class="cx">     foreach my $attribute (@{$interface-&gt;attributes}) {
</span><del>-        $count = $count + AttributeShouldBeOnInstance($interface, $attribute);
</del><ins>+        $count++ if AttributeShouldBeOnInstance($interface, $attribute);
</ins><span class="cx">     }
</span><del>-    $count = $count + 1 if ConstructorShouldBeOnInstance($interface);
</del><ins>+    $count += InstanceFunctionCount($interface);
+    $count++ if ConstructorShouldBeOnInstance($interface);
</ins><span class="cx">     return $count;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub PrototypeAttributeCount
</del><ins>+sub PrototypePropertyCount
</ins><span class="cx"> {
</span><span class="cx">     my $interface = shift;
</span><span class="cx">     my $count = 0;
</span><span class="cx">     foreach my $attribute (@{$interface-&gt;attributes}) {
</span><del>-        $count = $count + 1 if !AttributeShouldBeOnInstance($interface, $attribute);
</del><ins>+        $count++ if !AttributeShouldBeOnInstance($interface, $attribute);
</ins><span class="cx">     }
</span><del>-    $count = $count + 1 if !ConstructorShouldBeOnInstance($interface);
</del><ins>+    $count += PrototypeFunctionCount($interface);
+    $count++ if !ConstructorShouldBeOnInstance($interface);
</ins><span class="cx">     return $count;
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub InstanceOverridesGetOwnPropertySlot
</span><span class="cx"> {
</span><span class="cx">     my $interface = shift;
</span><del>-    my $numInstanceAttributes = InstanceAttributeCount($interface);
</del><ins>+    my $numInstanceProperties = InstancePropertyCount($interface);
</ins><span class="cx"> 
</span><span class="cx">     my $namedGetterFunction = GetNamedGetterFunction($interface);
</span><span class="cx">     my $indexedGetterFunction = GetIndexedGetterFunction($interface);
</span><span class="lines">@@ -779,17 +823,16 @@
</span><span class="cx">         || $interface-&gt;extendedAttributes-&gt;{&quot;CustomGetOwnPropertySlot&quot;}
</span><span class="cx">         || $hasNamedGetter;
</span><span class="cx"> 
</span><del>-    return $numInstanceAttributes &gt; 0 || $hasComplexGetter;
</del><ins>+    return $numInstanceProperties &gt; 0 || $hasComplexGetter;
</ins><span class="cx"> 
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub PrototypeOverridesGetOwnPropertySlot
</span><span class="cx"> {
</span><span class="cx">     my $interface = shift;
</span><del>-    my $numPrototypeAttributes = PrototypeAttributeCount($interface);
</del><ins>+    my $numPrototypeProperties = PrototypePropertyCount($interface);
</ins><span class="cx">     my $numConstants = @{$interface-&gt;constants};
</span><del>-    my $numFunctions = @{$interface-&gt;functions};
-    return $numFunctions &gt; 0 || $numConstants &gt; 0 || $numPrototypeAttributes &gt; 0;
</del><ins>+    return $numConstants &gt; 0 || $numPrototypeProperties &gt; 0;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub InstanceOverridesPutImplementation
</span><span class="lines">@@ -944,7 +987,7 @@
</span><span class="cx">         push(@headerContent, &quot;    static const bool needsDestruction = false;\n\n&quot;);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    my $hasStaticPropertyTable = InstanceAttributeCount($interface) &gt; 0 ? &quot;true&quot; : &quot;false&quot;;
</del><ins>+    my $hasStaticPropertyTable = InstancePropertyCount($interface) &gt; 0 ? &quot;true&quot; : &quot;false&quot;;
</ins><span class="cx">     push(@headerContent, &quot;    static const bool hasStaticPropertyTable = $hasStaticPropertyTable;\n\n&quot;);
</span><span class="cx"> 
</span><span class="cx">     # Prototype
</span><span class="lines">@@ -1335,27 +1378,21 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-sub GenerateAttributesHashTable
</del><ins>+sub GeneratePropertiesHashTable
</ins><span class="cx"> {
</span><del>-    my ($object, $interface, $isInstance, $hashKeys, $hashSpecials, $hashValue1, $hashValue2, $conditionals, $entries) = @_;
</del><ins>+    my ($object, $interface, $isInstance, $hashKeys, $hashSpecials, $hashValue1, $hashValue2, $conditionals, $runtimeEnabledFunctions) = @_;
</ins><span class="cx"> 
</span><span class="cx">     # FIXME: These should be functions on $interface.
</span><span class="cx">     my $interfaceName = $interface-&gt;name;
</span><span class="cx">     my $className = &quot;JS$interfaceName&quot;;
</span><span class="cx">     
</span><del>-    # - Add all attributes in a hashtable definition
-    my $numAttributes = 0;
-    if ($isInstance) {
-        $numAttributes = InstanceAttributeCount($interface);
-    } else {
-        $numAttributes = PrototypeAttributeCount($interface);
-    }
</del><ins>+    # - Add all properties in a hashtable definition
+    my $propertyCount = $isInstance ? InstancePropertyCount($interface) : PrototypePropertyCount($interface);
</ins><span class="cx"> 
</span><del>-
</del><span class="cx">     if (ConstructorShouldBeOnInstance($interface) == $isInstance) {
</span><span class="cx"> 
</span><span class="cx">         if (NeedsConstructorProperty($interface)) {
</span><del>-            die if !$numAttributes;
</del><ins>+            die if !$propertyCount;
</ins><span class="cx">             push(@$hashKeys, &quot;constructor&quot;);
</span><span class="cx">             my $getter = &quot;js&quot; . $interfaceName . &quot;Constructor&quot;;
</span><span class="cx">             push(@$hashValue1, $getter);
</span><span class="lines">@@ -1366,7 +1403,7 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return 0 if !$numAttributes;
</del><ins>+    return 0 if !$propertyCount;
</ins><span class="cx"> 
</span><span class="cx">     foreach my $attribute (@{$interface-&gt;attributes}) {
</span><span class="cx">         next if ($attribute-&gt;isStatic);
</span><span class="lines">@@ -1403,7 +1440,37 @@
</span><span class="cx">         }
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return $numAttributes;
</del><ins>+    foreach my $function (@{$interface-&gt;functions}) {
+        next if ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Private&quot;});
+        next if ($function-&gt;isStatic);
+        next if $function-&gt;{overloadIndex} &amp;&amp; $function-&gt;{overloadIndex} &gt; 1;
+        next if OperationShouldBeOnInstance($interface, $function) != $isInstance;
+        my $name = $function-&gt;signature-&gt;name;
+        push(@$hashKeys, $name);
+
+        my $functionName = GetFunctionName($interface, $className, $function);
+        push(@$hashValue1, $functionName);
+
+        my $functionLength = GetFunctionLength($function);
+        push(@$hashValue2, $functionLength);
+
+        push(@$hashSpecials, ComputeFunctionSpecial($interface, $function));
+
+        my $conditional = $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Conditional&quot;};
+        if ($conditional) {
+            $conditionals-&gt;{$name} = $conditional;
+        }
+
+        if ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;EnabledAtRuntime&quot;}) {
+            if ($isInstance) {
+                die &quot;We currently do not support [EnabledAtRuntime] operations on the instance.&quot;;
+            } else {
+                push(@$runtimeEnabledFunctions, $function);
+            }
+        }
+    }
+
+    return $propertyCount;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> sub GenerateParametersCheckExpression
</span><span class="lines">@@ -1533,7 +1600,7 @@
</span><span class="cx">     # overload is applicable, precedence is given according to the order of
</span><span class="cx">     # declaration in the IDL.
</span><span class="cx"> 
</span><del>-    my $kind = $function-&gt;isStatic ? &quot;Constructor&quot; : &quot;Prototype&quot;;
</del><ins>+    my $kind = $function-&gt;isStatic ? &quot;Constructor&quot; : (OperationShouldBeOnInstance($interface, $function) ? &quot;Instance&quot; : &quot;Prototype&quot;);
</ins><span class="cx">     my $functionName = &quot;js${interfaceName}${kind}Function&quot; . $codeGenerator-&gt;WK_ucfirst($function-&gt;signature-&gt;name);
</span><span class="cx"> 
</span><span class="cx">     # FIXME: Implement support for overloaded functions with variadic arguments.
</span><span class="lines">@@ -1864,18 +1931,20 @@
</span><span class="cx">     my @hashSpecials = ();
</span><span class="cx">     my %conditionals = ();
</span><span class="cx">     my $hashName = $className . &quot;Table&quot;;
</span><ins>+    my @runtimeEnabledFunctions = ();
</ins><span class="cx"> 
</span><del>-    my $numInstanceAttributes = GenerateAttributesHashTable($object, $interface, 1,
</del><ins>+    # Generate hash table for properties on the instance.
+    my $numInstanceProperties = GeneratePropertiesHashTable($object, $interface, 1,
</ins><span class="cx">         \@hashKeys, \@hashSpecials,
</span><span class="cx">         \@hashValue1, \@hashValue2,
</span><del>-        \%conditionals);
</del><ins>+        \%conditionals, \@runtimeEnabledFunctions);
</ins><span class="cx"> 
</span><del>-    $object-&gt;GenerateHashTable($hashName, $numInstanceAttributes,
</del><ins>+    $object-&gt;GenerateHashTable($hashName, $numInstanceProperties,
</ins><span class="cx">         \@hashKeys, \@hashSpecials,
</span><span class="cx">         \@hashValue1, \@hashValue2,
</span><del>-        \%conditionals, 0) if $numInstanceAttributes &gt; 0;
</del><ins>+        \%conditionals, 0) if $numInstanceProperties &gt; 0;
</ins><span class="cx"> 
</span><del>-    # - Add all constants
</del><ins>+    # - Add all interface object (aka constructor) properties (constants, static attributes, static operations).
</ins><span class="cx">     if (NeedsConstructorProperty($interface)) {
</span><span class="cx">         my $hashSize = 0;
</span><span class="cx">         my $hashName = $className . &quot;ConstructorTable&quot;;
</span><span class="lines">@@ -1981,13 +2050,14 @@
</span><span class="cx">     @hashValue2 = ();
</span><span class="cx">     @hashSpecials = ();
</span><span class="cx">     %conditionals = ();
</span><ins>+    @runtimeEnabledFunctions = ();
</ins><span class="cx"> 
</span><del>-
-    my $numPrototypeAttributes = GenerateAttributesHashTable($object, $interface, 0,
</del><ins>+    # Generate hash table for properties on the prototype.
+    my $numPrototypeProperties = GeneratePropertiesHashTable($object, $interface, 0,
</ins><span class="cx">         \@hashKeys, \@hashSpecials,
</span><span class="cx">         \@hashValue1, \@hashValue2,
</span><del>-        \%conditionals);
-    my $hashSize = $numPrototypeAttributes;
</del><ins>+        \%conditionals, \@runtimeEnabledFunctions);
+    my $hashSize = $numPrototypeProperties;
</ins><span class="cx"> 
</span><span class="cx">     foreach my $constant (@{$interface-&gt;constants}) {
</span><span class="cx">         my $name = $constant-&gt;name;
</span><span class="lines">@@ -2005,33 +2075,6 @@
</span><span class="cx">         $hashSize++;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    my @runtimeEnabledFunctions = ();
-
-    foreach my $function (@{$interface-&gt;functions}) {
-        next if ($function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Private&quot;});
-        next if ($function-&gt;isStatic);
-        next if $function-&gt;{overloadIndex} &amp;&amp; $function-&gt;{overloadIndex} &gt; 1;
-        my $name = $function-&gt;signature-&gt;name;
-        push(@hashKeys, $name);
-
-        my $functionName = GetFunctionName($interface, $className, $function);
-        push(@hashValue1, $functionName);
-
-        my $functionLength = GetFunctionLength($function);
-        push(@hashValue2, $functionLength);
-
-        push(@hashSpecials, ComputeFunctionSpecial($interface, $function));
-
-        my $conditional = $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;Conditional&quot;};
-        if ($conditional) {
-            $conditionals{$name} = $conditional;
-        }
-
-        push(@runtimeEnabledFunctions, $function) if $function-&gt;signature-&gt;extendedAttributes-&gt;{&quot;EnabledAtRuntime&quot;};
-
-        $hashSize++;
-    }
-
</del><span class="cx">     my $justGenerateValueArray = !IsDOMGlobalObject($interface);
</span><span class="cx"> 
</span><span class="cx">     $object-&gt;GenerateHashTable($hashName, $hashSize,
</span><span class="lines">@@ -2046,7 +2089,9 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (PrototypeOverridesGetOwnPropertySlot($interface)) {
</span><del>-        my $numPrototypeAttributes = PrototypeAttributeCount($interface);
</del><ins>+        my $prototypePropertyCount = PrototypePropertyCount($interface);
+        my $prototypeFunctionCount = PrototypeFunctionCount($interface);
+        my $prototypeAttributeCount = $prototypePropertyCount - $prototypeFunctionCount;
</ins><span class="cx">         if (IsDOMGlobalObject($interface)) {
</span><span class="cx">             push(@implContent, &quot;bool ${className}Prototype::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot&amp; slot)\n&quot;);
</span><span class="cx">             push(@implContent, &quot;{\n&quot;);
</span><span class="lines">@@ -2054,17 +2099,17 @@
</span><span class="cx">             push(@implContent, &quot;    UNUSED_PARAM(vm);\n&quot;);
</span><span class="cx">             push(@implContent, &quot;    auto* thisObject = jsCast&lt;${className}Prototype*&gt;(object);\n&quot;);
</span><span class="cx"> 
</span><del>-            if ($numConstants eq 0 &amp;&amp; $numFunctions eq 0 &amp;&amp; $numPrototypeAttributes eq 0) {
</del><ins>+            if ($numConstants eq 0 &amp;&amp; $prototypePropertyCount eq 0) {
</ins><span class="cx">                 push(@implContent, &quot;    return Base::getOwnPropertySlot(thisObject, state, propertyName, slot);\n&quot;);        
</span><del>-            } elsif ($numConstants eq 0 &amp;&amp; $numPrototypeAttributes eq 0) {
</del><ins>+            } elsif ($numConstants eq 0 &amp;&amp; $prototypeAttributeCount eq 0) {
</ins><span class="cx">                 push(@implContent, &quot;    return getStaticFunctionSlot&lt;JSObject&gt;(state, ${className}PrototypeTable, thisObject, propertyName, slot);\n&quot;);
</span><del>-            } elsif ($numFunctions eq 0 &amp;&amp; $numPrototypeAttributes eq 0) {
</del><ins>+            } elsif ($prototypePropertyCount eq 0) {
</ins><span class="cx">                 push(@implContent, &quot;    return getStaticValueSlot&lt;${className}Prototype, JSObject&gt;(state, ${className}PrototypeTable, thisObject, propertyName, slot);\n&quot;);
</span><span class="cx">             } else {
</span><span class="cx">                 push(@implContent, &quot;    return getStaticPropertySlot&lt;${className}Prototype, JSObject&gt;(state, ${className}PrototypeTable, thisObject, propertyName, slot);\n&quot;);
</span><span class="cx">             }
</span><span class="cx">             push(@implContent, &quot;}\n\n&quot;);
</span><del>-        } elsif ($numConstants &gt; 0 || $numFunctions &gt; 0 || $numPrototypeAttributes &gt; 0) {
</del><ins>+        } elsif ($numConstants &gt; 0 || $numPrototypeProperties &gt; 0) {
</ins><span class="cx">             push(@implContent, &quot;void ${className}Prototype::finishCreation(VM&amp; vm)\n&quot;);
</span><span class="cx">             push(@implContent, &quot;{\n&quot;);
</span><span class="cx">             push(@implContent, &quot;    Base::finishCreation(vm);\n&quot;);
</span><span class="lines">@@ -2115,7 +2160,7 @@
</span><span class="cx">     # - Initialize static ClassInfo object
</span><span class="cx">     push(@implContent, &quot;const ClassInfo $className&quot; . &quot;::s_info = { \&quot;${visibleInterfaceName}\&quot;, &amp;Base::s_info, &quot;);
</span><span class="cx"> 
</span><del>-    if ($numInstanceAttributes &gt; 0) {
</del><ins>+    if ($numInstanceProperties &gt; 0) {
</ins><span class="cx">         push(@implContent, &quot;&amp;${className}Table&quot;);
</span><span class="cx">     } else {
</span><span class="cx">         push(@implContent, &quot;0&quot;);
</span><span class="lines">@@ -2184,7 +2229,7 @@
</span><span class="cx">             push(@implContent, &quot;{\n&quot;);
</span><span class="cx">             push(@implContent, &quot;    auto* thisObject = jsCast&lt;${className}*&gt;(object);\n&quot;);
</span><span class="cx">             push(@implContent, &quot;    ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n&quot;);
</span><del>-            push(@implContent, GenerateGetOwnPropertySlotBody($interface, $interfaceName, $className, $numInstanceAttributes &gt; 0, 0));
</del><ins>+            push(@implContent, GenerateGetOwnPropertySlotBody($interface, $interfaceName, $className, $numInstanceProperties &gt; 0, 0));
</ins><span class="cx">             push(@implContent, &quot;}\n\n&quot;);
</span><span class="cx">         }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestInterfacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp (196647 => 196648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestInterface.cpp        2016-02-16 20:23:02 UTC (rev 196648)
</span><span class="lines">@@ -323,57 +323,57 @@
</span><span class="cx">     { 0, 0, NoIntrinsic, { 0, 0 } },
</span><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(Condition22) || ENABLE(Condition23)
</span><del>-    { &quot;IMPLEMENTSCONSTANT1&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
</del><ins>+    { &quot;implementsMethod1&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestInterfacePrototypeFunctionImplementsMethod1), (intptr_t) (0) } },
</ins><span class="cx"> #else
</span><span class="cx">     { 0, 0, NoIntrinsic, { 0, 0 } },
</span><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(Condition22) || ENABLE(Condition23)
</span><del>-    { &quot;IMPLEMENTSCONSTANT2&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
</del><ins>+    { &quot;implementsMethod2&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestInterfacePrototypeFunctionImplementsMethod2), (intptr_t) (2) } },
</ins><span class="cx"> #else
</span><span class="cx">     { 0, 0, NoIntrinsic, { 0, 0 } },
</span><span class="cx"> #endif
</span><del>-#if ENABLE(Condition11) || ENABLE(Condition12)
-    { &quot;SUPPLEMENTALCONSTANT1&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
</del><ins>+#if ENABLE(Condition22) || ENABLE(Condition23)
+    { &quot;implementsMethod3&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestInterfacePrototypeFunctionImplementsMethod3), (intptr_t) (0) } },
</ins><span class="cx"> #else
</span><span class="cx">     { 0, 0, NoIntrinsic, { 0, 0 } },
</span><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(Condition11) || ENABLE(Condition12)
</span><del>-    { &quot;SUPPLEMENTALCONSTANT2&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
</del><ins>+    { &quot;supplementalMethod1&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestInterfacePrototypeFunctionSupplementalMethod1), (intptr_t) (0) } },
</ins><span class="cx"> #else
</span><span class="cx">     { 0, 0, NoIntrinsic, { 0, 0 } },
</span><span class="cx"> #endif
</span><del>-#if ENABLE(Condition22) || ENABLE(Condition23)
-    { &quot;implementsMethod1&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestInterfacePrototypeFunctionImplementsMethod1), (intptr_t) (0) } },
</del><ins>+#if ENABLE(Condition11) || ENABLE(Condition12)
+    { &quot;supplementalMethod2&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestInterfacePrototypeFunctionSupplementalMethod2), (intptr_t) (2) } },
</ins><span class="cx"> #else
</span><span class="cx">     { 0, 0, NoIntrinsic, { 0, 0 } },
</span><span class="cx"> #endif
</span><del>-#if ENABLE(Condition22) || ENABLE(Condition23)
-    { &quot;implementsMethod2&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestInterfacePrototypeFunctionImplementsMethod2), (intptr_t) (2) } },
</del><ins>+#if ENABLE(Condition11) || ENABLE(Condition12)
+    { &quot;supplementalMethod3&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestInterfacePrototypeFunctionSupplementalMethod3), (intptr_t) (0) } },
</ins><span class="cx"> #else
</span><span class="cx">     { 0, 0, NoIntrinsic, { 0, 0 } },
</span><span class="cx"> #endif
</span><del>-#if ENABLE(Condition22) || ENABLE(Condition23)
-    { &quot;implementsMethod3&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestInterfacePrototypeFunctionImplementsMethod3), (intptr_t) (0) } },
</del><ins>+#if ENABLE(Condition11) || ENABLE(Condition12)
+    { &quot;builtinFunction&quot;, JSC::Builtin, NoIntrinsic, { (intptr_t)static_cast&lt;BuiltinGenerator&gt;(testSupplementalBuiltinFunctionCodeGenerator), (intptr_t) (0) } },
</ins><span class="cx"> #else
</span><span class="cx">     { 0, 0, NoIntrinsic, { 0, 0 } },
</span><span class="cx"> #endif
</span><del>-#if ENABLE(Condition11) || ENABLE(Condition12)
-    { &quot;supplementalMethod1&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestInterfacePrototypeFunctionSupplementalMethod1), (intptr_t) (0) } },
</del><ins>+#if ENABLE(Condition22) || ENABLE(Condition23)
+    { &quot;IMPLEMENTSCONSTANT1&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
</ins><span class="cx"> #else
</span><span class="cx">     { 0, 0, NoIntrinsic, { 0, 0 } },
</span><span class="cx"> #endif
</span><del>-#if ENABLE(Condition11) || ENABLE(Condition12)
-    { &quot;supplementalMethod2&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestInterfacePrototypeFunctionSupplementalMethod2), (intptr_t) (2) } },
</del><ins>+#if ENABLE(Condition22) || ENABLE(Condition23)
+    { &quot;IMPLEMENTSCONSTANT2&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
</ins><span class="cx"> #else
</span><span class="cx">     { 0, 0, NoIntrinsic, { 0, 0 } },
</span><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(Condition11) || ENABLE(Condition12)
</span><del>-    { &quot;supplementalMethod3&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestInterfacePrototypeFunctionSupplementalMethod3), (intptr_t) (0) } },
</del><ins>+    { &quot;SUPPLEMENTALCONSTANT1&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
</ins><span class="cx"> #else
</span><span class="cx">     { 0, 0, NoIntrinsic, { 0, 0 } },
</span><span class="cx"> #endif
</span><span class="cx"> #if ENABLE(Condition11) || ENABLE(Condition12)
</span><del>-    { &quot;builtinFunction&quot;, JSC::Builtin, NoIntrinsic, { (intptr_t)static_cast&lt;BuiltinGenerator&gt;(testSupplementalBuiltinFunctionCodeGenerator), (intptr_t) (0) } },
</del><ins>+    { &quot;SUPPLEMENTALCONSTANT2&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
</ins><span class="cx"> #else
</span><span class="cx">     { 0, 0, NoIntrinsic, { 0, 0 } },
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestObjcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp (196647 => 196648)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-02-16 20:18:11 UTC (rev 196647)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestObj.cpp        2016-02-16 20:23:02 UTC (rev 196648)
</span><span class="lines">@@ -588,23 +588,6 @@
</span><span class="cx">     { &quot;attributeWithReservedEnumType&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjAttributeWithReservedEnumType), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjAttributeWithReservedEnumType) } },
</span><span class="cx">     { &quot;putForwardsAttribute&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjPutForwardsAttribute), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjPutForwardsAttribute) } },
</span><span class="cx">     { &quot;putForwardsNullableAttribute&quot;, CustomAccessor, NoIntrinsic, { (intptr_t)static_cast&lt;PropertySlot::GetValueFunc&gt;(jsTestObjPutForwardsNullableAttribute), (intptr_t) static_cast&lt;PutPropertySlot::PutValueFunc&gt;(setJSTestObjPutForwardsNullableAttribute) } },
</span><del>-#if ENABLE(Condition1)
-    { &quot;CONDITIONAL_CONST&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
-#else
-    { 0, 0, NoIntrinsic, { 0, 0 } },
-#endif
-    { &quot;CONST_VALUE_0&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
-    { &quot;CONST_VALUE_1&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
-    { &quot;CONST_VALUE_2&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
-    { &quot;CONST_VALUE_4&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(4) } },
-    { &quot;CONST_VALUE_8&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(8) } },
-    { &quot;CONST_VALUE_9&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(-1) } },
-    { &quot;CONST_VALUE_11&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0xffffffff) } },
-    { &quot;CONST_VALUE_12&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0x01) } },
-    { &quot;CONST_VALUE_13&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0X20) } },
-    { &quot;CONST_VALUE_14&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0x1abc) } },
-    { &quot;CONST_JAVASCRIPT&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(15) } },
-    { &quot;readonly&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
</del><span class="cx">     { &quot;voidMethod&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionVoidMethod), (intptr_t) (0) } },
</span><span class="cx">     { &quot;voidMethodWithArgs&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionVoidMethodWithArgs), (intptr_t) (3) } },
</span><span class="cx">     { &quot;byteMethod&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionByteMethod), (intptr_t) (0) } },
</span><span class="lines">@@ -705,6 +688,23 @@
</span><span class="cx">     { &quot;testPromiseFunctionWithFloatArgument&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument), (intptr_t) (1) } },
</span><span class="cx">     { &quot;testPromiseFunctionWithException&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionTestPromiseFunctionWithException), (intptr_t) (0) } },
</span><span class="cx">     { &quot;testPromiseFunctionWithOptionalIntArgument&quot;, JSC::Function, NoIntrinsic, { (intptr_t)static_cast&lt;NativeFunction&gt;(jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument), (intptr_t) (0) } },
</span><ins>+#if ENABLE(Condition1)
+    { &quot;CONDITIONAL_CONST&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
+#else
+    { 0, 0, NoIntrinsic, { 0, 0 } },
+#endif
+    { &quot;CONST_VALUE_0&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
+    { &quot;CONST_VALUE_1&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
+    { &quot;CONST_VALUE_2&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
+    { &quot;CONST_VALUE_4&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(4) } },
+    { &quot;CONST_VALUE_8&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(8) } },
+    { &quot;CONST_VALUE_9&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(-1) } },
+    { &quot;CONST_VALUE_11&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0xffffffff) } },
+    { &quot;CONST_VALUE_12&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0x01) } },
+    { &quot;CONST_VALUE_13&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0X20) } },
+    { &quot;CONST_VALUE_14&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0x1abc) } },
+    { &quot;CONST_JAVASCRIPT&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(15) } },
+    { &quot;readonly&quot;, DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> const ClassInfo JSTestObjPrototype::s_info = { &quot;TestObjectPrototype&quot;, &amp;Base::s_info, 0, CREATE_METHOD_TABLE(JSTestObjPrototype) };
</span></span></pre>
</div>
</div>

</body>
</html>