<!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
<rdar://problem/24613231>
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 = "test"
$ console.log(window.open) // prints the native function instead of "test"
* 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 "Instance" in their
name instead of "Prototype".
(WebCore::JSDOMWindow::getOwnPropertySlot):
- Update function names now that they have "Instance" in their
name instead of "Prototype".
- 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 "Instance" in their
name instead of "Prototype".
* 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 "properties" instead of "attributes" as "properties"
refer both "attributes" and "operations" / "functions".
* 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 <cdumez@apple.com>
+
+ [Web IDL] Operations should be on the instance for global objects or if [Unforgeable]
+ https://bugs.webkit.org/show_bug.cgi?id=154120
+ <rdar://problem/24613231>
+
+ 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 <ryanhaddad@apple.com>
</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 <cdumez@apple.com>
+
+ [Web IDL] Operations should be on the instance for global objects or if [Unforgeable]
+ https://bugs.webkit.org/show_bug.cgi?id=154120
+ <rdar://problem/24613231>
+
+ 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 <cdumez@apple.com>
</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 '"get" 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 '"get" 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 "function navigator() {
</span><span class="cx"> [native code]
</span><span class="cx"> }"
</span><span class="cx"> FAIL Window interface: attribute external assert_own_property: The global object must have a property "external" expected property "external" missing
</span><span class="cx"> PASS Window interface: attribute applicationCache
</span><del>-FAIL Window interface: operation alert() desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation confirm(DOMString) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation prompt(DOMString,DOMString) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation print() desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation showModalDialog(DOMString,any) desc is not an Object. (evaluating '"get" 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 '"get" in desc')
-FAIL Window interface: operation releaseEvents() desc is not an Object. (evaluating '"get" 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 "onautocomplete" expected property "onautocomplete" missing
</span><span class="cx"> FAIL Window interface: attribute onautocompleteerror assert_own_property: The global object must have a property "onautocompleteerror" expected property "onautocompleteerror" 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 '"get" in desc')
-FAIL Window interface: operation atob(DOMString) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation setTimeout(Function,long,any) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation setTimeout(DOMString,long,any) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation clearTimeout(long) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation setInterval(Function,long,any) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation setInterval(DOMString,long,any) desc is not an Object. (evaluating '"get" in desc')
-FAIL Window interface: operation clearInterval(long) desc is not an Object. (evaluating '"get" 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 "createImageBitmap" 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 "pathname"
</span><span class="cx"> PASS Location interface: window.location must have own property "search"
</span><span class="cx"> PASS Location interface: window.location must have own property "hash"
</span><del>-FAIL Location interface: window.location must have own property "assign" assert_own_property: Doesn't have the unforgeable operation property expected property "assign" missing
-FAIL Location interface: calling assign(USVString) on window.location with too few arguments must throw TypeError assert_own_property: expected property "assign" missing
-FAIL Location interface: window.location must have own property "replace" assert_own_property: Doesn't have the unforgeable operation property expected property "replace" missing
-FAIL Location interface: calling replace(USVString) on window.location with too few arguments must throw TypeError assert_own_property: expected property "replace" missing
-FAIL Location interface: window.location must have own property "reload" assert_own_property: Doesn't have the unforgeable operation property expected property "reload" missing
</del><ins>+FAIL Location interface: window.location must have own property "assign" 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 "function () {
+ [native code]
+}" did not throw
+FAIL Location interface: window.location must have own property "replace" 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 "function () {
+ [native code]
+}" did not throw
+FAIL Location interface: window.location must have own property "reload" 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 "ancestorOrigins"
</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 <cdumez@apple.com>
+
+ [Web IDL] Operations should be on the instance for global objects or if [Unforgeable]
+ https://bugs.webkit.org/show_bug.cgi?id=154120
+ <rdar://problem/24613231>
+
+ 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 = "test"
+ $ console.log(window.open) // prints the native function instead of "test"
+
+ * runtime/JSObject.cpp:
+ (JSC::JSObject::putInlineSlow):
+ * runtime/Lookup.h:
+ (JSC::putEntry):
+ (JSC::lookupPut):
+
</ins><span class="cx"> 2016-02-16 Keith Miller <keith_miller@apple.com>
</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->staticFunctionsReified()) {
</span><span class="cx"> if (obj->classInfo()->hasStaticSetterOrReadonlyProperties()) {
</span><span class="cx"> if (auto* entry = obj->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& 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& 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->attributes() & BuiltinOrFunction) {
</span><del>- if (JSObject* thisObject = jsDynamicCast<JSObject*>(slot.thisValue()))
</del><ins>+ if (JSObject* thisObject = jsDynamicCast<JSObject*>(thisValue))
</ins><span class="cx"> thisObject->putDirect(exec->vm(), propertyName, value);
</span><span class="cx"> } else if (entry->attributes() & Accessor) {
</span><span class="cx"> if (slot.isStrictMode())
</span><span class="cx"> throwTypeError(exec, StrictModeReadonlyPropertyWriteError);
</span><span class="cx"> } else if (!(entry->attributes() & ReadOnly)) {
</span><del>- JSValue thisValue = entry->attributes() & CustomAccessor ? slot.thisValue() : JSValue(base);
- entry->propertyPutter()(exec, JSValue::encode(thisValue), JSValue::encode(value));
</del><ins>+ JSValue updateThisValue = entry->attributes() & CustomAccessor ? slot.thisValue() : JSValue(base);
+ entry->propertyPutter()(exec, JSValue::encode(updateThisValue), JSValue::encode(value));
</ins><span class="cx"> if (entry->attributes() & CustomAccessor)
</span><span class="cx"> slot.setCustomAccessor(base, entry->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 <cdumez@apple.com>
+
+ [Web IDL] Operations should be on the instance for global objects or if [Unforgeable]
+ https://bugs.webkit.org/show_bug.cgi?id=154120
+ <rdar://problem/24613231>
+
+ 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 "Instance" in their
+ name instead of "Prototype".
+
+ (WebCore::JSDOMWindow::getOwnPropertySlot):
+ - Update function names now that they have "Instance" in their
+ name instead of "Prototype".
+ - 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 "Instance" in their
+ name instead of "Prototype".
+
+ * 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 "properties" instead of "attributes" as "properties"
+ refer both "attributes" and "operations" / "functions".
+
+ * bindings/scripts/test/JS/JSTestInterface.cpp:
+ * bindings/scripts/test/JS/JSTestObj.cpp:
+ Rebaseline bindings tests.
+
</ins><span class="cx"> 2016-02-16 Simon Fraser <simon.fraser@apple.com>
</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->propertyNames().close) {
</span><del>- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionClose, 0>);
</del><ins>+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionClose, 0>);
</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->propertyNames().blur) {
</span><del>- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionBlur, 0>);
</del><ins>+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionBlur, 0>);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> if (propertyName == exec->propertyNames().close) {
</span><del>- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionClose, 0>);
</del><ins>+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionClose, 0>);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> if (propertyName == exec->propertyNames().focus) {
</span><del>- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionFocus, 0>);
</del><ins>+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionFocus, 0>);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> if (propertyName == exec->propertyNames().postMessage) {
</span><del>- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionPostMessage, 2>);
</del><ins>+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionPostMessage, 2>);
</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->staticFunctionsReified()) {
- if (auto* entry = JSDOMWindow::info()->staticPropHashTable->entry(propertyName)) {
- slot.setCacheableCustom(thisObject, entry->attributes(), entry->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"> // & delete then the original value is restored!) Should be removed.
</span><span class="cx"> if (propertyName == exec->propertyNames().blur) {
</span><del>- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionBlur, 0>);
</del><ins>+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionBlur, 0>);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> if (propertyName == exec->propertyNames().close) {
</span><del>- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionClose, 0>);
</del><ins>+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionClose, 0>);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> if (propertyName == exec->propertyNames().focus) {
</span><del>- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionFocus, 0>);
</del><ins>+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionFocus, 0>);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> if (propertyName == exec->propertyNames().postMessage) {
</span><del>- slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowPrototypeFunctionPostMessage, 2>);
</del><ins>+ slot.setCustom(thisObject, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsDOMWindowInstanceFunctionPostMessage, 2>);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><ins>+
+ if (!thisObject->staticFunctionsReified()) {
+ if (auto* entry = JSDOMWindow::info()->staticPropHashTable->entry(propertyName)) {
+ if (entry->attributes() & BuiltinOrFunctionOrAccessor)
+ return setUpStaticFunctionSlot(exec, entry, thisObject, propertyName, slot);
+ slot.setCacheableCustom(thisObject, entry->attributes(), entry->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->propertyNames().replace) {
</span><del>- slot.setCustom(this, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsLocationPrototypeFunctionReplace, 1>);
</del><ins>+ slot.setCustom(this, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsLocationInstanceFunctionReplace, 1>);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> if (propertyName == exec->propertyNames().reload) {
</span><del>- slot.setCustom(this, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsLocationPrototypeFunctionReload, 0>);
</del><ins>+ slot.setCustom(this, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsLocationInstanceFunctionReload, 0>);
</ins><span class="cx"> return true;
</span><span class="cx"> }
</span><span class="cx"> if (propertyName == exec->propertyNames().assign) {
</span><del>- slot.setCustom(this, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsLocationPrototypeFunctionAssign, 1>);
</del><ins>+ slot.setCustom(this, ReadOnly | DontDelete | DontEnum, nonCachingStaticFunctionGetter<jsLocationInstanceFunctionAssign, 1>);
</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 <andersca@mac.com>
</span><span class="cx"> # Copyright (C) 2006, 2007 Samuel Weinig <sam@webkit.org>
</span><span class="cx"> # Copyright (C) 2006 Alexey Proskuryakov <ap@webkit.org>
</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 <cam@mcc.id.au>
</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 ? "JSC::" : "");
</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, " if (${namespaceMaybe}getStaticValueSlot<$className, Base>(state, *info()->staticPropHashTable, thisObject, propertyName, slot))\n");
- } else {
- push(@getOwnPropertySlotImpl, " if (${namespaceMaybe}getStaticValueSlot<$className, Base>(state, ${className}Table, thisObject, propertyName, slot))\n");
- }
</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 ? "getStaticValueSlot" : "getStaticPropertySlot");
+ my $staticPropertyTable = $inlined ? "*info()->staticPropHashTable" : "${className}Table";
+ push(@getOwnPropertySlotImpl, " if ($staticPropertyGetFunction<$className, Base>(state, ${staticPropertyTable}, thisObject, propertyName, slot))\n");
</ins><span class="cx"> } else {
</span><span class="cx"> push(@getOwnPropertySlotImpl, " if (Base::getOwnPropertySlot(thisObject, state, propertyName, slot))\n");
</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->isStatic ? "Constructor" : "Prototype";
</del><ins>+ my $kind = $function->isStatic ? "Constructor" : (OperationShouldBeOnInstance($interface, $function) ? "Instance" : "Prototype");
</ins><span class="cx"> return $codeGenerator->WK_lcfirst($className) . $kind . "Function" . $codeGenerator->WK_ucfirst($function->signature->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->signature->extendedAttributes->{"EnabledAtRuntime"};
+
+ return 1 if IsDOMGlobalObject($interface);
+
+ # [Unforgeable] operations should be on the instance.
+ # https://heycam.github.io/webidl/#Unforgeable
+ return 1 if $function->signature->extendedAttributes->{"Unforgeable"} || $interface->extendedAttributes->{"Unforgeable"};
+
+ 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, "getter", "DOMString", 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->functions}) {
+ $count++ if OperationShouldBeOnInstance($interface, $function);
+ }
+
+ return $count;
+}
+
+sub PrototypeFunctionCount
+{
+ my $interface = shift;
+ my $count = 0;
+
+ foreach my $function (@{$interface->functions}) {
+ $count++ if !$function->isStatic && !OperationShouldBeOnInstance($interface, $function);
+ }
+
+ return $count;
+}
+
+sub InstancePropertyCount
+{
+ my $interface = shift;
+ my $count = 0;
</ins><span class="cx"> foreach my $attribute (@{$interface->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->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->extendedAttributes->{"CustomGetOwnPropertySlot"}
</span><span class="cx"> || $hasNamedGetter;
</span><span class="cx">
</span><del>- return $numInstanceAttributes > 0 || $hasComplexGetter;
</del><ins>+ return $numInstanceProperties > 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->constants};
</span><del>- my $numFunctions = @{$interface->functions};
- return $numFunctions > 0 || $numConstants > 0 || $numPrototypeAttributes > 0;
</del><ins>+ return $numConstants > 0 || $numPrototypeProperties > 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, " static const bool needsDestruction = false;\n\n");
</span><span class="cx"> }
</span><span class="cx">
</span><del>- my $hasStaticPropertyTable = InstanceAttributeCount($interface) > 0 ? "true" : "false";
</del><ins>+ my $hasStaticPropertyTable = InstancePropertyCount($interface) > 0 ? "true" : "false";
</ins><span class="cx"> push(@headerContent, " static const bool hasStaticPropertyTable = $hasStaticPropertyTable;\n\n");
</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->name;
</span><span class="cx"> my $className = "JS$interfaceName";
</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, "constructor");
</span><span class="cx"> my $getter = "js" . $interfaceName . "Constructor";
</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->attributes}) {
</span><span class="cx"> next if ($attribute->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->functions}) {
+ next if ($function->signature->extendedAttributes->{"Private"});
+ next if ($function->isStatic);
+ next if $function->{overloadIndex} && $function->{overloadIndex} > 1;
+ next if OperationShouldBeOnInstance($interface, $function) != $isInstance;
+ my $name = $function->signature->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->signature->extendedAttributes->{"Conditional"};
+ if ($conditional) {
+ $conditionals->{$name} = $conditional;
+ }
+
+ if ($function->signature->extendedAttributes->{"EnabledAtRuntime"}) {
+ if ($isInstance) {
+ die "We currently do not support [EnabledAtRuntime] operations on the instance.";
+ } 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->isStatic ? "Constructor" : "Prototype";
</del><ins>+ my $kind = $function->isStatic ? "Constructor" : (OperationShouldBeOnInstance($interface, $function) ? "Instance" : "Prototype");
</ins><span class="cx"> my $functionName = "js${interfaceName}${kind}Function" . $codeGenerator->WK_ucfirst($function->signature->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 . "Table";
</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->GenerateHashTable($hashName, $numInstanceAttributes,
</del><ins>+ $object->GenerateHashTable($hashName, $numInstanceProperties,
</ins><span class="cx"> \@hashKeys, \@hashSpecials,
</span><span class="cx"> \@hashValue1, \@hashValue2,
</span><del>- \%conditionals, 0) if $numInstanceAttributes > 0;
</del><ins>+ \%conditionals, 0) if $numInstanceProperties > 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 . "ConstructorTable";
</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->constants}) {
</span><span class="cx"> my $name = $constant->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->functions}) {
- next if ($function->signature->extendedAttributes->{"Private"});
- next if ($function->isStatic);
- next if $function->{overloadIndex} && $function->{overloadIndex} > 1;
- my $name = $function->signature->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->signature->extendedAttributes->{"Conditional"};
- if ($conditional) {
- $conditionals{$name} = $conditional;
- }
-
- push(@runtimeEnabledFunctions, $function) if $function->signature->extendedAttributes->{"EnabledAtRuntime"};
-
- $hashSize++;
- }
-
</del><span class="cx"> my $justGenerateValueArray = !IsDOMGlobalObject($interface);
</span><span class="cx">
</span><span class="cx"> $object->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, "bool ${className}Prototype::getOwnPropertySlot(JSObject* object, ExecState* state, PropertyName propertyName, PropertySlot& slot)\n");
</span><span class="cx"> push(@implContent, "{\n");
</span><span class="lines">@@ -2054,17 +2099,17 @@
</span><span class="cx"> push(@implContent, " UNUSED_PARAM(vm);\n");
</span><span class="cx"> push(@implContent, " auto* thisObject = jsCast<${className}Prototype*>(object);\n");
</span><span class="cx">
</span><del>- if ($numConstants eq 0 && $numFunctions eq 0 && $numPrototypeAttributes eq 0) {
</del><ins>+ if ($numConstants eq 0 && $prototypePropertyCount eq 0) {
</ins><span class="cx"> push(@implContent, " return Base::getOwnPropertySlot(thisObject, state, propertyName, slot);\n");
</span><del>- } elsif ($numConstants eq 0 && $numPrototypeAttributes eq 0) {
</del><ins>+ } elsif ($numConstants eq 0 && $prototypeAttributeCount eq 0) {
</ins><span class="cx"> push(@implContent, " return getStaticFunctionSlot<JSObject>(state, ${className}PrototypeTable, thisObject, propertyName, slot);\n");
</span><del>- } elsif ($numFunctions eq 0 && $numPrototypeAttributes eq 0) {
</del><ins>+ } elsif ($prototypePropertyCount eq 0) {
</ins><span class="cx"> push(@implContent, " return getStaticValueSlot<${className}Prototype, JSObject>(state, ${className}PrototypeTable, thisObject, propertyName, slot);\n");
</span><span class="cx"> } else {
</span><span class="cx"> push(@implContent, " return getStaticPropertySlot<${className}Prototype, JSObject>(state, ${className}PrototypeTable, thisObject, propertyName, slot);\n");
</span><span class="cx"> }
</span><span class="cx"> push(@implContent, "}\n\n");
</span><del>- } elsif ($numConstants > 0 || $numFunctions > 0 || $numPrototypeAttributes > 0) {
</del><ins>+ } elsif ($numConstants > 0 || $numPrototypeProperties > 0) {
</ins><span class="cx"> push(@implContent, "void ${className}Prototype::finishCreation(VM& vm)\n");
</span><span class="cx"> push(@implContent, "{\n");
</span><span class="cx"> push(@implContent, " Base::finishCreation(vm);\n");
</span><span class="lines">@@ -2115,7 +2160,7 @@
</span><span class="cx"> # - Initialize static ClassInfo object
</span><span class="cx"> push(@implContent, "const ClassInfo $className" . "::s_info = { \"${visibleInterfaceName}\", &Base::s_info, ");
</span><span class="cx">
</span><del>- if ($numInstanceAttributes > 0) {
</del><ins>+ if ($numInstanceProperties > 0) {
</ins><span class="cx"> push(@implContent, "&${className}Table");
</span><span class="cx"> } else {
</span><span class="cx"> push(@implContent, "0");
</span><span class="lines">@@ -2184,7 +2229,7 @@
</span><span class="cx"> push(@implContent, "{\n");
</span><span class="cx"> push(@implContent, " auto* thisObject = jsCast<${className}*>(object);\n");
</span><span class="cx"> push(@implContent, " ASSERT_GC_OBJECT_INHERITS(thisObject, info());\n");
</span><del>- push(@implContent, GenerateGetOwnPropertySlotBody($interface, $interfaceName, $className, $numInstanceAttributes > 0, 0));
</del><ins>+ push(@implContent, GenerateGetOwnPropertySlotBody($interface, $interfaceName, $className, $numInstanceProperties > 0, 0));
</ins><span class="cx"> push(@implContent, "}\n\n");
</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>- { "IMPLEMENTSCONSTANT1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
</del><ins>+ { "implementsMethod1", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(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>- { "IMPLEMENTSCONSTANT2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
</del><ins>+ { "implementsMethod2", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(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)
- { "SUPPLEMENTALCONSTANT1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
</del><ins>+#if ENABLE(Condition22) || ENABLE(Condition23)
+ { "implementsMethod3", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(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>- { "SUPPLEMENTALCONSTANT2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
</del><ins>+ { "supplementalMethod1", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(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)
- { "implementsMethod1", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionImplementsMethod1), (intptr_t) (0) } },
</del><ins>+#if ENABLE(Condition11) || ENABLE(Condition12)
+ { "supplementalMethod2", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(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)
- { "implementsMethod2", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionImplementsMethod2), (intptr_t) (2) } },
</del><ins>+#if ENABLE(Condition11) || ENABLE(Condition12)
+ { "supplementalMethod3", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(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)
- { "implementsMethod3", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionImplementsMethod3), (intptr_t) (0) } },
</del><ins>+#if ENABLE(Condition11) || ENABLE(Condition12)
+ { "builtinFunction", JSC::Builtin, NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(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)
- { "supplementalMethod1", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod1), (intptr_t) (0) } },
</del><ins>+#if ENABLE(Condition22) || ENABLE(Condition23)
+ { "IMPLEMENTSCONSTANT1", 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)
- { "supplementalMethod2", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod2), (intptr_t) (2) } },
</del><ins>+#if ENABLE(Condition22) || ENABLE(Condition23)
+ { "IMPLEMENTSCONSTANT2", 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>- { "supplementalMethod3", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestInterfacePrototypeFunctionSupplementalMethod3), (intptr_t) (0) } },
</del><ins>+ { "SUPPLEMENTALCONSTANT1", 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>- { "builtinFunction", JSC::Builtin, NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(testSupplementalBuiltinFunctionCodeGenerator), (intptr_t) (0) } },
</del><ins>+ { "SUPPLEMENTALCONSTANT2", 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"> { "attributeWithReservedEnumType", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjAttributeWithReservedEnumType), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjAttributeWithReservedEnumType) } },
</span><span class="cx"> { "putForwardsAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjPutForwardsAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjPutForwardsAttribute) } },
</span><span class="cx"> { "putForwardsNullableAttribute", CustomAccessor, NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsTestObjPutForwardsNullableAttribute), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(setJSTestObjPutForwardsNullableAttribute) } },
</span><del>-#if ENABLE(Condition1)
- { "CONDITIONAL_CONST", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
-#else
- { 0, 0, NoIntrinsic, { 0, 0 } },
-#endif
- { "CONST_VALUE_0", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
- { "CONST_VALUE_1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
- { "CONST_VALUE_2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
- { "CONST_VALUE_4", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(4) } },
- { "CONST_VALUE_8", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(8) } },
- { "CONST_VALUE_9", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(-1) } },
- { "CONST_VALUE_11", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0xffffffff) } },
- { "CONST_VALUE_12", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0x01) } },
- { "CONST_VALUE_13", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0X20) } },
- { "CONST_VALUE_14", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0x1abc) } },
- { "CONST_JAVASCRIPT", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(15) } },
- { "readonly", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
</del><span class="cx"> { "voidMethod", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethod), (intptr_t) (0) } },
</span><span class="cx"> { "voidMethodWithArgs", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionVoidMethodWithArgs), (intptr_t) (3) } },
</span><span class="cx"> { "byteMethod", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionByteMethod), (intptr_t) (0) } },
</span><span class="lines">@@ -705,6 +688,23 @@
</span><span class="cx"> { "testPromiseFunctionWithFloatArgument", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestPromiseFunctionWithFloatArgument), (intptr_t) (1) } },
</span><span class="cx"> { "testPromiseFunctionWithException", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestPromiseFunctionWithException), (intptr_t) (0) } },
</span><span class="cx"> { "testPromiseFunctionWithOptionalIntArgument", JSC::Function, NoIntrinsic, { (intptr_t)static_cast<NativeFunction>(jsTestObjPrototypeFunctionTestPromiseFunctionWithOptionalIntArgument), (intptr_t) (0) } },
</span><ins>+#if ENABLE(Condition1)
+ { "CONDITIONAL_CONST", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
+#else
+ { 0, 0, NoIntrinsic, { 0, 0 } },
+#endif
+ { "CONST_VALUE_0", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
+ { "CONST_VALUE_1", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(1) } },
+ { "CONST_VALUE_2", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(2) } },
+ { "CONST_VALUE_4", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(4) } },
+ { "CONST_VALUE_8", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(8) } },
+ { "CONST_VALUE_9", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(-1) } },
+ { "CONST_VALUE_11", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0xffffffff) } },
+ { "CONST_VALUE_12", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0x01) } },
+ { "CONST_VALUE_13", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0X20) } },
+ { "CONST_VALUE_14", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0x1abc) } },
+ { "CONST_JAVASCRIPT", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(15) } },
+ { "readonly", DontDelete | ReadOnly | ConstantInteger, NoIntrinsic, { (long long)(0) } },
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> const ClassInfo JSTestObjPrototype::s_info = { "TestObjectPrototype", &Base::s_info, 0, CREATE_METHOD_TABLE(JSTestObjPrototype) };
</span></span></pre>
</div>
</div>
</body>
</html>