<!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>[202981] trunk/Source/WebCore</title>
</head>
<body>
<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; }
#msg dl a { font-weight: bold}
#msg dl a:link { color:#fc3; }
#msg dl a:active { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/202981">202981</a></dd>
<dt>Author</dt> <dd>nael.ouedraogo@crf.canon.fr</dd>
<dt>Date</dt> <dd>2016-07-08 08:52:57 -0700 (Fri, 08 Jul 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>ExecState should be passed by reference in JS bindings generator for custom constructors
https://bugs.webkit.org/show_bug.cgi?id=159357
Reviewed by Youenn Fablet.
Pass ExecState as a reference instead of pointer in JS bindings
code for custom constructors.
* bindings/js/JSAudioContextCustom.cpp:
(WebCore::constructJSAudioContext):
* bindings/js/JSBlobCustom.cpp:
(WebCore::constructJSBlob):
* bindings/js/JSDOMFormDataCustom.cpp:
(WebCore::constructJSDOMFormData):
(WebCore::JSDOMFormData::append):
* bindings/js/JSDataCueCustom.cpp:
(WebCore::constructJSDataCue):
* bindings/js/JSFileCustom.cpp:
(WebCore::constructJSFile):
* bindings/js/JSHTMLElementCustom.cpp:
(WebCore::constructJSHTMLElement):
* bindings/js/JSMediaSessionCustom.cpp:
(WebCore::constructJSMediaSession):
* bindings/js/JSMutationObserverCustom.cpp:
(WebCore::constructJSMutationObserver):
* bindings/js/JSReadableStreamPrivateConstructors.cpp:
(WebCore::constructJSReadableStreamController):
(WebCore::constructJSReadableStreamReader):
* bindings/js/JSWebKitPointCustom.cpp:
(WebCore::constructJSWebKitPoint):
* bindings/js/JSWorkerCustom.cpp:
(WebCore::constructJSWorker):
* bindings/scripts/CodeGeneratorJS.pm:
(GenerateHeader):
(GenerateConstructorDefinition):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
(WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::construct):
* bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSAudioContextCustomcpp">trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSBlobCustomcpp">trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDOMFormDataCustomcpp">trunk/Source/WebCore/bindings/js/JSDOMFormDataCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSDataCueCustomcpp">trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSFileCustomcpp">trunk/Source/WebCore/bindings/js/JSFileCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSHTMLElementCustomcpp">trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMediaSessionCustomcpp">trunk/Source/WebCore/bindings/js/JSMediaSessionCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSMutationObserverCustomcpp">trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSReadableStreamPrivateConstructorscpp">trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSWebKitPointCustomcpp">trunk/Source/WebCore/bindings/js/JSWebKitPointCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsjsJSWorkerCustomcpp">trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm">trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCustomConstructorWithNoInterfaceObjectcpp">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp</a></li>
<li><a href="#trunkSourceWebCorebindingsscriptstestJSJSTestCustomConstructorWithNoInterfaceObjecth">trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/ChangeLog        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -1,3 +1,44 @@
</span><ins>+2016-07-08 Nael Ouedraogo <nael.ouedraogo@crf.canon.fr>
+
+ ExecState should be passed by reference in JS bindings generator for custom constructors
+ https://bugs.webkit.org/show_bug.cgi?id=159357
+
+ Reviewed by Youenn Fablet.
+
+ Pass ExecState as a reference instead of pointer in JS bindings
+ code for custom constructors.
+
+ * bindings/js/JSAudioContextCustom.cpp:
+ (WebCore::constructJSAudioContext):
+ * bindings/js/JSBlobCustom.cpp:
+ (WebCore::constructJSBlob):
+ * bindings/js/JSDOMFormDataCustom.cpp:
+ (WebCore::constructJSDOMFormData):
+ (WebCore::JSDOMFormData::append):
+ * bindings/js/JSDataCueCustom.cpp:
+ (WebCore::constructJSDataCue):
+ * bindings/js/JSFileCustom.cpp:
+ (WebCore::constructJSFile):
+ * bindings/js/JSHTMLElementCustom.cpp:
+ (WebCore::constructJSHTMLElement):
+ * bindings/js/JSMediaSessionCustom.cpp:
+ (WebCore::constructJSMediaSession):
+ * bindings/js/JSMutationObserverCustom.cpp:
+ (WebCore::constructJSMutationObserver):
+ * bindings/js/JSReadableStreamPrivateConstructors.cpp:
+ (WebCore::constructJSReadableStreamController):
+ (WebCore::constructJSReadableStreamReader):
+ * bindings/js/JSWebKitPointCustom.cpp:
+ (WebCore::constructJSWebKitPoint):
+ * bindings/js/JSWorkerCustom.cpp:
+ (WebCore::constructJSWorker):
+ * bindings/scripts/CodeGeneratorJS.pm:
+ (GenerateHeader):
+ (GenerateConstructorDefinition):
+ * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp:
+ (WebCore::JSTestCustomConstructorWithNoInterfaceObjectConstructor::construct):
+ * bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h:
+
</ins><span class="cx"> 2016-07-08 Olivier Blin <olivier.blin@softathome.com>
</span><span class="cx">
</span><span class="cx"> Expose crossOrigin attribute as a static property in HTMLMediaElement
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSAudioContextCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSAudioContextCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -44,33 +44,33 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSAudioContext(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSAudioContext(ExecState& exec)
</ins><span class="cx"> {
</span><del>- DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec->callee());
</del><ins>+ DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec.callee());
</ins><span class="cx"> if (!jsConstructor)
</span><del>- return throwVMError(exec, createReferenceError(exec, "AudioContext constructor callee is unavailable"));
</del><ins>+ return throwVMError(&exec, createReferenceError(&exec, "AudioContext constructor callee is unavailable"));
</ins><span class="cx">
</span><span class="cx"> ScriptExecutionContext* scriptExecutionContext = jsConstructor->scriptExecutionContext();
</span><span class="cx"> if (!scriptExecutionContext)
</span><del>- return throwVMError(exec, createReferenceError(exec, "AudioContext constructor script execution context is unavailable"));
-
</del><ins>+ return throwVMError(&exec, createReferenceError(&exec, "AudioContext constructor script execution context is unavailable"));
+
</ins><span class="cx"> if (!is<Document>(*scriptExecutionContext))
</span><del>- return throwVMError(exec, createReferenceError(exec, "AudioContext constructor called in a script execution context which is not a document"));
</del><ins>+ return throwVMError(&exec, createReferenceError(&exec, "AudioContext constructor called in a script execution context which is not a document"));
</ins><span class="cx">
</span><span class="cx"> Document& document = downcast<Document>(*scriptExecutionContext);
</span><span class="cx">
</span><span class="cx"> RefPtr<AudioContext> audioContext;
</span><del>-
- if (!exec->argumentCount()) {
</del><ins>+
+ if (!exec.argumentCount()) {
</ins><span class="cx"> // Constructor for default AudioContext which talks to audio hardware.
</span><span class="cx"> ExceptionCode ec = 0;
</span><span class="cx"> audioContext = AudioContext::create(document, ec);
</span><span class="cx"> if (ec) {
</span><del>- setDOMException(exec, ec);
</del><ins>+ setDOMException(&exec, ec);
</ins><span class="cx"> return JSValue::encode(JSValue());
</span><span class="cx"> }
</span><span class="cx"> if (!audioContext.get())
</span><del>- return throwVMError(exec, createSyntaxError(exec, "audio resources unavailable for AudioContext construction"));
</del><ins>+ return throwVMError(&exec, createSyntaxError(&exec, "audio resources unavailable for AudioContext construction"));
</ins><span class="cx"> } else {
</span><span class="cx"> #if ENABLE(LEGACY_WEB_AUDIO)
</span><span class="cx"> // Constructor for offline (render-target) AudioContext which renders into an AudioBuffer.
</span><span class="lines">@@ -77,36 +77,36 @@
</span><span class="cx"> // new AudioContext(in unsigned long numberOfChannels, in unsigned long numberOfFrames, in float sampleRate);
</span><span class="cx"> document.addConsoleMessage(MessageSource::JS, MessageLevel::Warning, ASCIILiteral("Deprecated AudioContext constructor: use OfflineAudioContext instead"));
</span><span class="cx">
</span><del>- if (exec->argumentCount() < 3)
- return throwVMError(exec, createNotEnoughArgumentsError(exec));
</del><ins>+ if (exec.argumentCount() < 3)
+ return throwVMError(&exec, createNotEnoughArgumentsError(&exec));
</ins><span class="cx">
</span><del>- int32_t numberOfChannels = exec->argument(0).toInt32(exec);
- int32_t numberOfFrames = exec->argument(1).toInt32(exec);
- float sampleRate = exec->argument(2).toFloat(exec);
-
</del><ins>+ int32_t numberOfChannels = exec.uncheckedArgument(0).toInt32(&exec);
+ int32_t numberOfFrames = exec.uncheckedArgument(1).toInt32(&exec);
+ float sampleRate = exec.uncheckedArgument(2).toFloat(&exec);
+
</ins><span class="cx"> if (numberOfChannels <= 0 || numberOfChannels > 10)
</span><del>- return throwVMError(exec, createSyntaxError(exec, "Invalid number of channels"));
</del><ins>+ return throwVMError(&exec, createSyntaxError(&exec, "Invalid number of channels"));
</ins><span class="cx">
</span><span class="cx"> if (numberOfFrames <= 0)
</span><del>- return throwVMError(exec, createSyntaxError(exec, "Invalid number of frames"));
</del><ins>+ return throwVMError(&exec, createSyntaxError(&exec, "Invalid number of frames"));
</ins><span class="cx">
</span><span class="cx"> if (sampleRate <= 0)
</span><del>- return throwVMError(exec, createSyntaxError(exec, "Invalid sample rate"));
</del><ins>+ return throwVMError(&exec, createSyntaxError(&exec, "Invalid sample rate"));
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> ExceptionCode ec = 0;
</span><span class="cx"> audioContext = OfflineAudioContext::create(document, numberOfChannels, numberOfFrames, sampleRate, ec);
</span><span class="cx"> if (ec) {
</span><del>- setDOMException(exec, ec);
- return throwVMError(exec, createSyntaxError(exec, "Error creating OfflineAudioContext"));
</del><ins>+ setDOMException(&exec, ec);
+ return throwVMError(&exec, createSyntaxError(&exec, "Error creating OfflineAudioContext"));
</ins><span class="cx"> }
</span><span class="cx"> #else
</span><del>- return throwVMError(exec, createSyntaxError(exec, "Illegal AudioContext constructor"));
</del><ins>+ return throwVMError(&exec, createSyntaxError(&exec, "Illegal AudioContext constructor"));
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (!audioContext)
</span><del>- return throwVMError(exec, createReferenceError(exec, "Error creating AudioContext"));
</del><ins>+ return throwVMError(&exec, createReferenceError(&exec, "Error creating AudioContext"));
</ins><span class="cx">
</span><span class="cx"> return JSValue::encode(CREATE_DOM_WRAPPER(jsConstructor->globalObject(), AudioContext, audioContext.releaseNonNull()));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSBlobCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSBlobCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -60,20 +60,20 @@
</span><span class="cx"> return wrap(state, globalObject, blob);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSBlob(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSBlob(ExecState& exec)
</ins><span class="cx"> {
</span><del>- DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec->callee());
</del><ins>+ DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec.callee());
</ins><span class="cx"> ScriptExecutionContext* context = jsConstructor->scriptExecutionContext();
</span><span class="cx"> if (!context)
</span><del>- return throwVMError(exec, createReferenceError(exec, "Blob constructor associated document is unavailable"));
</del><ins>+ return throwVMError(&exec, createReferenceError(&exec, "Blob constructor associated document is unavailable"));
</ins><span class="cx">
</span><del>- if (!exec->argumentCount()) {
</del><ins>+ if (!exec.argumentCount()) {
</ins><span class="cx"> return JSValue::encode(CREATE_DOM_WRAPPER(jsConstructor->globalObject(), Blob, Blob::create()));
</span><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> unsigned blobPartsLength = 0;
</span><del>- JSObject* blobParts = toJSSequence(exec, exec->argument(0), blobPartsLength);
- if (exec->hadException())
</del><ins>+ JSObject* blobParts = toJSSequence(&exec, exec.uncheckedArgument(0), blobPartsLength);
+ if (exec.hadException())
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> ASSERT(blobParts);
</span><span class="cx">
</span><span class="lines">@@ -80,31 +80,31 @@
</span><span class="cx"> String type;
</span><span class="cx"> String endings = ASCIILiteral("transparent");
</span><span class="cx">
</span><del>- if (exec->argumentCount() > 1) {
- JSValue blobPropertyBagValue = exec->argument(1);
</del><ins>+ if (exec.argumentCount() > 1) {
+ JSValue blobPropertyBagValue = exec.uncheckedArgument(1);
</ins><span class="cx">
</span><span class="cx"> if (!blobPropertyBagValue.isObject())
</span><del>- return throwVMTypeError(exec, "Second argument of the constructor is not of type Object");
</del><ins>+ return throwVMTypeError(&exec, "Second argument of the constructor is not of type Object");
</ins><span class="cx">
</span><span class="cx"> // Given the above test, this will always yield an object.
</span><del>- JSObject* blobPropertyBagObject = blobPropertyBagValue.toObject(exec);
</del><ins>+ JSObject* blobPropertyBagObject = blobPropertyBagValue.toObject(&exec);
</ins><span class="cx">
</span><span class="cx"> // Create the dictionary wrapper from the initializer object.
</span><del>- JSDictionary dictionary(exec, blobPropertyBagObject);
</del><ins>+ JSDictionary dictionary(&exec, blobPropertyBagObject);
</ins><span class="cx">
</span><span class="cx"> // Attempt to get the endings property and validate it.
</span><span class="cx"> bool containsEndings = dictionary.get("endings", endings);
</span><del>- if (exec->hadException())
</del><ins>+ if (exec.hadException())
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx">
</span><span class="cx"> if (containsEndings) {
</span><span class="cx"> if (endings != "transparent" && endings != "native")
</span><del>- return throwVMTypeError(exec, "The endings property must be either \"transparent\" or \"native\"");
</del><ins>+ return throwVMTypeError(&exec, "The endings property must be either \"transparent\" or \"native\"");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Attempt to get the type property.
</span><span class="cx"> dictionary.get("type", type);
</span><del>- if (exec->hadException())
</del><ins>+ if (exec.hadException())
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -113,8 +113,8 @@
</span><span class="cx"> BlobBuilder blobBuilder;
</span><span class="cx">
</span><span class="cx"> for (unsigned i = 0; i < blobPartsLength; ++i) {
</span><del>- JSValue item = blobParts->get(exec, i);
- if (exec->hadException())
</del><ins>+ JSValue item = blobParts->get(&exec, i);
+ if (exec.hadException())
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx">
</span><span class="cx"> if (ArrayBuffer* arrayBuffer = toArrayBuffer(item))
</span><span class="lines">@@ -124,8 +124,8 @@
</span><span class="cx"> else if (Blob* blob = JSBlob::toWrapped(item))
</span><span class="cx"> blobBuilder.append(blob);
</span><span class="cx"> else {
</span><del>- String string = item.toString(exec)->value(exec);
- if (exec->hadException())
</del><ins>+ String string = item.toWTFString(&exec);
+ if (exec.hadException())
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> blobBuilder.append(string, endings);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDOMFormDataCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDOMFormDataCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDOMFormDataCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSDOMFormDataCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -46,27 +46,27 @@
</span><span class="cx"> return value.inherits(JSHTMLFormElement::info()) ? &jsCast<JSHTMLFormElement*>(asObject(value))->wrapped() : nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSDOMFormData(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSDOMFormData(ExecState& exec)
</ins><span class="cx"> {
</span><del>- DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec->callee());
</del><ins>+ DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec.callee());
</ins><span class="cx">
</span><del>- HTMLFormElement* form = toHTMLFormElementOrNull(exec->argument(0));
</del><ins>+ HTMLFormElement* form = toHTMLFormElementOrNull(exec.argument(0));
</ins><span class="cx"> auto domFormData = DOMFormData::create(form);
</span><del>- return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), domFormData)));
</del><ins>+ return JSValue::encode(toJSNewlyCreated(&exec, jsConstructor->globalObject(), WTFMove(domFormData)));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-JSValue JSDOMFormData::append(ExecState& state)
</del><ins>+JSValue JSDOMFormData::append(ExecState& exec)
</ins><span class="cx"> {
</span><del>- if (state.argumentCount() >= 2) {
- String name = state.argument(0).toString(&state)->value(&state);
- JSValue value = state.argument(1);
</del><ins>+ if (exec.argumentCount() >= 2) {
+ String name = exec.uncheckedArgument(0).toWTFString(&exec);
+ JSValue value = exec.uncheckedArgument(1);
</ins><span class="cx"> if (value.inherits(JSBlob::info())) {
</span><span class="cx"> String filename;
</span><del>- if (state.argumentCount() >= 3 && !state.argument(2).isUndefinedOrNull())
- filename = state.argument(2).toString(&state)->value(&state);
</del><ins>+ if (exec.argumentCount() >= 3 && !exec.uncheckedArgument(2).isUndefinedOrNull())
+ filename = exec.uncheckedArgument(2).toWTFString(&exec);
</ins><span class="cx"> wrapped().append(name, JSBlob::toWrapped(value), filename);
</span><span class="cx"> } else
</span><del>- wrapped().append(name, value.toString(&state)->value(&state));
</del><ins>+ wrapped().append(name, value.toWTFString(&exec));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> return jsUndefined();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSDataCueCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSDataCueCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -47,61 +47,56 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSDataCue(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSDataCue(ExecState& exec)
</ins><span class="cx"> {
</span><del>- DOMConstructorObject* castedThis = jsCast<DOMConstructorObject*>(exec->callee());
- if (exec->argumentCount() < 3)
- return throwVMError(exec, createNotEnoughArgumentsError(exec));
</del><ins>+ DOMConstructorObject* castedThis = jsCast<DOMConstructorObject*>(exec.callee());
+ if (exec.argumentCount() < 3)
+ return throwVMError(&exec, createNotEnoughArgumentsError(&exec));
</ins><span class="cx">
</span><del>- double startTime(exec->argument(0).toNumber(exec));
- if (UNLIKELY(exec->hadException()))
</del><ins>+ double startTime(exec.uncheckedArgument(0).toNumber(&exec));
+ if (UNLIKELY(exec.hadException()))
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx">
</span><del>- double endTime(exec->argument(1).toNumber(exec));
- if (UNLIKELY(exec->hadException()))
</del><ins>+ double endTime(exec.uncheckedArgument(1).toNumber(&exec));
+ if (UNLIKELY(exec.hadException()))
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx">
</span><span class="cx"> ScriptExecutionContext* context = castedThis->scriptExecutionContext();
</span><span class="cx"> if (!context)
</span><del>- return throwConstructorDocumentUnavailableError(*exec, "DataCue");
</del><ins>+ return throwConstructorDocumentUnavailableError(exec, "DataCue");
</ins><span class="cx">
</span><span class="cx"> String type;
</span><span class="cx"> #if ENABLE(DATACUE_VALUE)
</span><del>- if (exec->argumentCount() > 3) {
- if (!exec->argument(3).isString())
- return throwVMTypeError(exec, ASCIILiteral("Second argument of the constructor is not of type String"));
- type = exec->argument(3).getString(exec);
</del><ins>+ if (exec.argumentCount() > 3) {
+ if (!exec.uncheckedArgument(3).isString())
+ return throwVMTypeError(&exec, ASCIILiteral("Second argument of the constructor is not of type String"));
+ type = exec.uncheckedArgument(3).getString(&exec);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- JSValue valueArgument = exec->argument(2);
</del><ins>+ JSValue valueArgument = exec.uncheckedArgument(2);
</ins><span class="cx"> if (valueArgument.isUndefinedOrNull()) {
</span><del>- setDOMException(exec, TypeError);
</del><ins>+ setDOMException(&exec, TypeError);
</ins><span class="cx"> return JSValue::encode(JSValue());
</span><span class="cx"> }
</span><span class="cx">
</span><del>- RefPtr<DataCue> object;
</del><span class="cx"> if (valueArgument.isCell() && valueArgument.asCell()->inherits(std::remove_pointer<JSArrayBuffer*>::type::info())) {
</span><span class="cx">
</span><span class="cx"> ArrayBuffer* data = toArrayBuffer(valueArgument);
</span><del>- if (UNLIKELY(exec->hadException()))
</del><ins>+ if (UNLIKELY(exec.hadException()))
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx">
</span><span class="cx"> if (UNLIKELY(!data)) {
</span><del>- setDOMException(exec, TypeError);
</del><ins>+ setDOMException(&exec, TypeError);
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><del>-
- object = DataCue::create(*context, MediaTime::createWithDouble(startTime), MediaTime::createWithDouble(endTime), *data, type);
-
- return JSValue::encode(asObject(toJS(exec, castedThis->globalObject(), object.get())));
</del><ins>+ return JSValue::encode(CREATE_DOM_WRAPPER(castedThis->globalObject(), DataCue, DataCue::create(*context, MediaTime::createWithDouble(startTime), MediaTime::createWithDouble(endTime), *data, type)));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if !ENABLE(DATACUE_VALUE)
</span><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> #else
</span><del>- object = DataCue::create(*context, MediaTime::createWithDouble(startTime), MediaTime::createWithDouble(endTime), valueArgument, type);
- return JSValue::encode(asObject(toJS(exec, castedThis->globalObject(), object.get())));
</del><ins>+ return JSValue::encode(CREATE_DOM_WRAPPER(castedThis->globalObject(), DataCue,DataCue::create(*context, MediaTime::createWithDouble(startTime), MediaTime::createWithDouble(endTime), valueArgument, type)));
</ins><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSFileCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSFileCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSFileCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSFileCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -40,47 +40,47 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSFile(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSFile(ExecState& exec)
</ins><span class="cx"> {
</span><del>- auto* constructor = jsCast<DOMConstructorObject*>(exec->callee());
</del><ins>+ auto* constructor = jsCast<DOMConstructorObject*>(exec.callee());
</ins><span class="cx"> ScriptExecutionContext* context = constructor->scriptExecutionContext();
</span><span class="cx"> if (!context)
</span><del>- return throwVMError(exec, createReferenceError(exec, "File constructor associated document is unavailable"));
</del><ins>+ return throwVMError(&exec, createReferenceError(&exec, "File constructor associated document is unavailable"));
</ins><span class="cx">
</span><del>- JSValue arg = exec->argument(0);
</del><ins>+ JSValue arg = exec.argument(0);
</ins><span class="cx"> if (arg.isUndefinedOrNull())
</span><del>- return throwVMTypeError(exec, ASCIILiteral("First argument to File constructor must be a valid sequence, was undefined or null"));
</del><ins>+ return throwVMTypeError(&exec, ASCIILiteral("First argument to File constructor must be a valid sequence, was undefined or null"));
</ins><span class="cx">
</span><span class="cx"> unsigned blobPartsLength = 0;
</span><del>- JSObject* blobParts = toJSSequence(exec, arg, blobPartsLength);
- if (exec->hadException())
</del><ins>+ JSObject* blobParts = toJSSequence(&exec, arg, blobPartsLength);
+ if (exec.hadException())
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> ASSERT(blobParts);
</span><span class="cx">
</span><del>- arg = exec->argument(1);
</del><ins>+ arg = exec.argument(1);
</ins><span class="cx"> if (arg.isUndefined())
</span><del>- return throwVMTypeError(exec, ASCIILiteral("Second argument to File constructor must be a valid string, was undefined"));
</del><ins>+ return throwVMTypeError(&exec, ASCIILiteral("Second argument to File constructor must be a valid string, was undefined"));
</ins><span class="cx">
</span><del>- String filename = arg.toWTFString(exec).replace('/', ':');
- if (exec->hadException())
</del><ins>+ String filename = arg.toWTFString(&exec).replace('/', ':');
+ if (exec.hadException())
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx">
</span><span class="cx"> String normalizedType;
</span><span class="cx"> Optional<int64_t> lastModified;
</span><span class="cx">
</span><del>- arg = exec->argument(2);
</del><ins>+ arg = exec.argument(2);
</ins><span class="cx"> if (!arg.isUndefinedOrNull()) {
</span><span class="cx"> JSObject* filePropertyBagObject = arg.getObject();
</span><span class="cx"> if (!filePropertyBagObject)
</span><del>- return throwVMTypeError(exec, ASCIILiteral("Third argument of the constructor is not of type Object"));
</del><ins>+ return throwVMTypeError(&exec, ASCIILiteral("Third argument of the constructor is not of type Object"));
</ins><span class="cx">
</span><span class="cx"> // Create the dictionary wrapper from the initializer object.
</span><del>- JSDictionary dictionary(exec, filePropertyBagObject);
</del><ins>+ JSDictionary dictionary(&exec, filePropertyBagObject);
</ins><span class="cx">
</span><span class="cx"> // Attempt to get the type property.
</span><span class="cx"> String type;
</span><span class="cx"> dictionary.get("type", type);
</span><del>- if (exec->hadException())
</del><ins>+ if (exec.hadException())
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx">
</span><span class="cx"> normalizedType = Blob::normalizedContentType(type);
</span><span class="lines">@@ -88,7 +88,7 @@
</span><span class="cx"> // Only try to parse the lastModified date if there was not an invalid type argument.
</span><span class="cx"> if (type.isEmpty() || !normalizedType.isEmpty()) {
</span><span class="cx"> dictionary.get("lastModified", lastModified);
</span><del>- if (exec->hadException())
</del><ins>+ if (exec.hadException())
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="lines">@@ -99,8 +99,8 @@
</span><span class="cx"> BlobBuilder blobBuilder;
</span><span class="cx">
</span><span class="cx"> for (unsigned i = 0; i < blobPartsLength; ++i) {
</span><del>- JSValue item = blobParts->get(exec, i);
- if (exec->hadException())
</del><ins>+ JSValue item = blobParts->get(&exec, i);
+ if (exec.hadException())
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx">
</span><span class="cx"> if (ArrayBuffer* arrayBuffer = toArrayBuffer(item))
</span><span class="lines">@@ -110,8 +110,8 @@
</span><span class="cx"> else if (Blob* blob = JSBlob::toWrapped(item))
</span><span class="cx"> blobBuilder.append(blob);
</span><span class="cx"> else {
</span><del>- String string = item.toWTFString(exec);
- if (exec->hadException())
</del><ins>+ String string = item.toWTFString(&exec);
+ if (exec.hadException())
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> blobBuilder.append(string, ASCIILiteral("transparent"));
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSHTMLElementCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSHTMLElementCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -38,31 +38,31 @@
</span><span class="cx"> using namespace JSC;
</span><span class="cx">
</span><span class="cx"> #if ENABLE(CUSTOM_ELEMENTS)
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSHTMLElement(ExecState* state)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSHTMLElement(ExecState& exec)
</ins><span class="cx"> {
</span><del>- auto* jsConstructor = jsCast<DOMConstructorObject*>(state->callee());
</del><ins>+ auto* jsConstructor = jsCast<DOMConstructorObject*>(exec.callee());
</ins><span class="cx">
</span><span class="cx"> auto* context = jsConstructor->scriptExecutionContext();
</span><span class="cx"> if (!is<Document>(context))
</span><del>- return throwConstructorDocumentUnavailableError(*state, "HTMLElement");
</del><ins>+ return throwConstructorDocumentUnavailableError(exec, "HTMLElement");
</ins><span class="cx"> auto& document = downcast<Document>(*context);
</span><span class="cx">
</span><span class="cx"> auto* definitions = document.customElementDefinitions();
</span><span class="cx"> if (!definitions)
</span><del>- return throwVMTypeError(state, "new.target is not a valid custom element constructor");
</del><ins>+ return throwVMTypeError(&exec, "new.target is not a valid custom element constructor");
</ins><span class="cx">
</span><del>- VM& vm = state->vm();
- JSValue newTargetValue = state->thisValue();
</del><ins>+ VM& vm = exec.vm();
+ JSValue newTargetValue = exec.thisValue();
</ins><span class="cx"> JSObject* newTarget = newTargetValue.getObject();
</span><span class="cx"> auto* elementInterface = definitions->findInterface(newTarget);
</span><span class="cx"> if (!elementInterface)
</span><del>- return throwVMTypeError(state, "new.target does not define a custom element");
</del><ins>+ return throwVMTypeError(&exec, "new.target does not define a custom element");
</ins><span class="cx">
</span><span class="cx"> if (!elementInterface->isUpgradingElement()) {
</span><span class="cx"> auto* globalObject = jsConstructor->globalObject();
</span><span class="cx"> Structure* baseStructure = getDOMStructure<JSHTMLElement>(vm, *globalObject);
</span><del>- auto* newElementStructure = InternalFunction::createSubclassStructure(state, newTargetValue, baseStructure);
- if (UNLIKELY(state->hadException()))
</del><ins>+ auto* newElementStructure = InternalFunction::createSubclassStructure(&exec, newTargetValue, baseStructure);
+ if (UNLIKELY(exec.hadException()))
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx">
</span><span class="cx"> Ref<HTMLElement> element = HTMLElement::create(elementInterface->name(), document);
</span><span class="lines">@@ -74,20 +74,20 @@
</span><span class="cx">
</span><span class="cx"> Element* elementToUpgrade = elementInterface->lastElementInConstructionStack();
</span><span class="cx"> if (!elementToUpgrade) {
</span><del>- throwInvalidStateError(*state, "Cannot instantiate a custom element inside its own constrcutor during upgrades");
</del><ins>+ throwInvalidStateError(exec, "Cannot instantiate a custom element inside its own constrcutor during upgrades");
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx"> }
</span><span class="cx">
</span><del>- JSValue elementWrapperValue = toJS(state, jsConstructor->globalObject(), *elementToUpgrade);
</del><ins>+ JSValue elementWrapperValue = toJS(&exec, jsConstructor->globalObject(), *elementToUpgrade);
</ins><span class="cx"> ASSERT(elementWrapperValue.isObject());
</span><span class="cx">
</span><del>- JSValue newPrototype = newTarget->get(state, vm.propertyNames->prototype);
- if (state->hadException())
</del><ins>+ JSValue newPrototype = newTarget->get(&exec, vm.propertyNames->prototype);
+ if (exec.hadException())
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx">
</span><span class="cx"> JSObject* elementWrapperObject = asObject(elementWrapperValue);
</span><del>- JSObject::setPrototype(elementWrapperObject, state, newPrototype, true /* shouldThrowIfCantSet */);
- if (state->hadException())
</del><ins>+ JSObject::setPrototype(elementWrapperObject, &exec, newPrototype, true /* shouldThrowIfCantSet */);
+ if (exec.hadException())
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><span class="cx">
</span><span class="cx"> elementInterface->didUpgradeLastElementInConstructionStack();
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMediaSessionCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMediaSessionCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMediaSessionCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSMediaSessionCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -39,26 +39,26 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSMediaSession(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSMediaSession(ExecState& exec)
</ins><span class="cx"> {
</span><del>- auto* castedThis = jsCast<DOMConstructorObject*>(exec->callee());
</del><ins>+ auto* castedThis = jsCast<DOMConstructorObject*>(exec.callee());
+
</ins><span class="cx"> auto* context = castedThis->scriptExecutionContext();
</span><span class="cx"> if (!context)
</span><del>- return throwConstructorDocumentUnavailableError(*exec, "MediaSession");
</del><ins>+ return throwConstructorDocumentUnavailableError(exec, "MediaSession");
</ins><span class="cx">
</span><span class="cx"> String kind;
</span><del>- if (exec->argumentCount() > 0) {
- JSString* kindString = exec->argument(0).toString(exec);
- if (UNLIKELY(exec->hadException()))
</del><ins>+ if (exec.argumentCount() > 0) {
+ JSString* kindString = exec.uncheckedArgument(0).toString(&exec);
+ if (UNLIKELY(exec.hadException()))
</ins><span class="cx"> return JSValue::encode(jsUndefined());
</span><del>- kind = kindString->value(exec);
</del><ins>+ kind = kindString->value(&exec);
</ins><span class="cx"> if (kind != "content" && kind != "transient" && kind != "transient-solo" && kind != "ambient")
</span><del>- return throwArgumentMustBeEnumError(*exec, 0, "kind", "MediaSession", nullptr, "\"content\", \"transient\", \"transient-solo\", \"ambient\"");
</del><ins>+ return throwArgumentMustBeEnumError(exec, 0, "kind", "MediaSession", nullptr, "\"content\", \"transient\", \"transient-solo\", \"ambient\"");
</ins><span class="cx"> } else
</span><span class="cx"> kind = "content";
</span><span class="cx">
</span><del>- auto object = MediaSession::create(*context, kind);
- return JSValue::encode(asObject(toJS(exec, castedThis->globalObject(), object)));
</del><ins>+ return JSValue::encode(toJSNewlyCreated(&exec, castedThis->globalObject(), MediaSession::create(*context, kind)));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSMutationObserverCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -42,19 +42,19 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSMutationObserver(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSMutationObserver(ExecState& exec)
</ins><span class="cx"> {
</span><del>- if (exec->argumentCount() < 1)
- return throwVMError(exec, createNotEnoughArgumentsError(exec));
</del><ins>+ if (exec.argumentCount() < 1)
+ return throwVMError(&exec, createNotEnoughArgumentsError(&exec));
</ins><span class="cx">
</span><del>- JSObject* object = exec->argument(0).getObject();
</del><ins>+ JSObject* object = exec.uncheckedArgument(0).getObject();
</ins><span class="cx"> CallData callData;
</span><span class="cx"> if (!object || object->methodTable()->getCallData(object, callData) == CallType::None)
</span><del>- return throwVMTypeError(exec, ASCIILiteral("Callback argument must be a function"));
</del><ins>+ return throwVMTypeError(&exec, ASCIILiteral("Callback argument must be a function"));
</ins><span class="cx">
</span><del>- DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec->callee());
</del><ins>+ DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec.callee());
</ins><span class="cx"> auto callback = JSMutationCallback::create(object, jsConstructor->globalObject());
</span><del>- JSObject* jsObserver = asObject(toJS(exec, jsConstructor->globalObject(), MutationObserver::create(WTFMove(callback))));
</del><ins>+ JSObject* jsObserver = asObject(toJSNewlyCreated(&exec, jsConstructor->globalObject(), MutationObserver::create(WTFMove(callback))));
</ins><span class="cx"> PrivateName propertyName;
</span><span class="cx"> jsObserver->putDirect(jsConstructor->globalObject()->vm(), propertyName, object);
</span><span class="cx"> return JSValue::encode(jsObserver);
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSReadableStreamPrivateConstructorscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSReadableStreamPrivateConstructors.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -34,23 +34,23 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> // Public JS ReadableStreamReder and ReadableStreamController constructor callbacks.
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSReadableStreamController(ExecState* state)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSReadableStreamController(ExecState& exec)
</ins><span class="cx"> {
</span><del>- return throwVMTypeError(state, ASCIILiteral("ReadableStreamController constructor should not be called directly"));
</del><ins>+ return throwVMTypeError(&exec, ASCIILiteral("ReadableStreamController constructor should not be called directly"));
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSReadableStreamReader(ExecState* state)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSReadableStreamReader(ExecState& exec)
</ins><span class="cx"> {
</span><del>- JSReadableStream* stream = jsDynamicCast<JSReadableStream*>(state->argument(0));
</del><ins>+ JSReadableStream* stream = jsDynamicCast<JSReadableStream*>(exec.argument(0));
</ins><span class="cx"> if (!stream)
</span><del>- return throwVMTypeError(state, ASCIILiteral("ReadableStreamReader constructor parameter is not a ReadableStream"));
</del><ins>+ return throwVMTypeError(&exec, ASCIILiteral("ReadableStreamReader constructor parameter is not a ReadableStream"));
</ins><span class="cx">
</span><del>- JSValue jsFunction = stream->get(state, Identifier::fromString(state, "getReader"));
</del><ins>+ JSValue jsFunction = stream->get(&exec, Identifier::fromString(&exec, "getReader"));
</ins><span class="cx">
</span><span class="cx"> CallData callData;
</span><span class="cx"> CallType callType = getCallData(jsFunction, callData);
</span><span class="cx"> MarkedArgumentBuffer noArguments;
</span><del>- return JSValue::encode(call(state, jsFunction, callType, callData, stream, noArguments));
</del><ins>+ return JSValue::encode(call(&exec, jsFunction, callType, callData, stream, noArguments));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> // Private JS ReadableStreamReder and ReadableStreamController constructors.
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWebKitPointCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSWebKitPointCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWebKitPointCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSWebKitPointCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -32,21 +32,21 @@
</span><span class="cx">
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSWebKitPoint(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSWebKitPoint(ExecState& exec)
</ins><span class="cx"> {
</span><del>- DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec->callee());
</del><ins>+ DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec.callee());
</ins><span class="cx">
</span><span class="cx"> float x = 0;
</span><span class="cx"> float y = 0;
</span><del>- if (exec->argumentCount() >= 2) {
- x = static_cast<float>(exec->argument(0).toNumber(exec));
- y = static_cast<float>(exec->argument(1).toNumber(exec));
</del><ins>+ if (exec.argumentCount() >= 2) {
+ x = static_cast<float>(exec.uncheckedArgument(0).toNumber(&exec));
+ y = static_cast<float>(exec.uncheckedArgument(1).toNumber(&exec));
</ins><span class="cx"> if (std::isnan(x))
</span><span class="cx"> x = 0;
</span><span class="cx"> if (std::isnan(y))
</span><span class="cx"> y = 0;
</span><span class="cx"> }
</span><del>- return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), WebKitPoint::create(x, y))));
</del><ins>+ return JSValue::encode(asObject(toJSNewlyCreated(&exec, jsConstructor->globalObject(), WebKitPoint::create(x, y))));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsjsJSWorkerCustomcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/js/JSWorkerCustom.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -45,29 +45,29 @@
</span><span class="cx"> return handlePostMessage(state, &wrapped());
</span><span class="cx"> }
</span><span class="cx">
</span><del>-EncodedJSValue JSC_HOST_CALL constructJSWorker(ExecState* exec)
</del><ins>+EncodedJSValue JSC_HOST_CALL constructJSWorker(ExecState& exec)
</ins><span class="cx"> {
</span><del>- DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec->callee());
</del><ins>+ DOMConstructorObject* jsConstructor = jsCast<DOMConstructorObject*>(exec.callee());
</ins><span class="cx">
</span><del>- if (!exec->argumentCount())
- return throwVMError(exec, createNotEnoughArgumentsError(exec));
</del><ins>+ if (!exec.argumentCount())
+ return throwVMError(&exec, createNotEnoughArgumentsError(&exec));
</ins><span class="cx">
</span><del>- String scriptURL = exec->argument(0).toString(exec)->value(exec);
- if (exec->hadException())
</del><ins>+ String scriptURL = exec.uncheckedArgument(0).toWTFString(&exec);
+ if (exec.hadException())
</ins><span class="cx"> return JSValue::encode(JSValue());
</span><span class="cx">
</span><del>- // See section 4.8.2 step 14 of WebWorkers for why this is the lexicalGlobalObject.
- DOMWindow& window = asJSDOMWindow(exec->lexicalGlobalObject())->wrapped();
</del><ins>+ // See section 4.8.2 step 14 of WebWorkers for why this is the lexicalGlobalObject.
+ DOMWindow& window = asJSDOMWindow(exec.lexicalGlobalObject())->wrapped();
</ins><span class="cx">
</span><span class="cx"> ExceptionCode ec = 0;
</span><span class="cx"> ASSERT(window.document());
</span><span class="cx"> RefPtr<Worker> worker = Worker::create(*window.document(), scriptURL, ec);
</span><span class="cx"> if (ec) {
</span><del>- setDOMException(exec, ec);
</del><ins>+ setDOMException(&exec, ec);
</ins><span class="cx"> return JSValue::encode(JSValue());
</span><span class="cx"> }
</span><span class="cx">
</span><del>- return JSValue::encode(asObject(toJS(exec, jsConstructor->globalObject(), *worker)));
</del><ins>+ return JSValue::encode(asObject(toJSNewlyCreated(&exec, jsConstructor->globalObject(), WTFMove(worker))));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptsCodeGeneratorJSpm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/scripts/CodeGeneratorJS.pm        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -1534,7 +1534,7 @@
</span><span class="cx">
</span><span class="cx"> if (HasCustomConstructor($interface)) {
</span><span class="cx"> push(@headerContent, "// Custom constructor\n");
</span><del>- push(@headerContent, "JSC::EncodedJSValue JSC_HOST_CALL construct${className}(JSC::ExecState*);\n\n");
</del><ins>+ push(@headerContent, "JSC::EncodedJSValue JSC_HOST_CALL construct${className}(JSC::ExecState&);\n\n");
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if ($codeGenerator->IsConstructorTemplate($interface, "Event")) {
</span><span class="lines">@@ -5089,9 +5089,10 @@
</span><span class="cx">
</span><span class="cx"> END
</span><span class="cx"> } elsif ($interface->extendedAttributes->{"CustomConstructor"}) {
</span><del>- push(@$outputArray, "template<> JSC::EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct(JSC::ExecState* state)\n");
</del><ins>+ push(@$outputArray, "template<> JSC::EncodedJSValue JSC_HOST_CALL ${constructorClassName}::construct(JSC::ExecState* exec)\n");
</ins><span class="cx"> push(@$outputArray, "{\n");
</span><del>- push(@$outputArray, " return construct${className}(state);\n");
</del><ins>+ push(@$outputArray, " ASSERT(exec);\n");
+ push(@$outputArray, " return construct${className}(*exec);\n");
</ins><span class="cx"> push(@$outputArray, "}\n\n");
</span><span class="cx"> } elsif (!HasCustomConstructor($interface) && (!$interface->extendedAttributes->{"NamedConstructor"} || $generatingNamedConstructor)) {
</span><span class="cx"> if ($function->{overloadedIndex} && $function->{overloadedIndex} > 0) {
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCustomConstructorWithNoInterfaceObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.cpp        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -62,9 +62,10 @@
</span><span class="cx">
</span><span class="cx"> typedef JSDOMConstructor<JSTestCustomConstructorWithNoInterfaceObject> JSTestCustomConstructorWithNoInterfaceObjectConstructor;
</span><span class="cx">
</span><del>-template<> JSC::EncodedJSValue JSC_HOST_CALL JSTestCustomConstructorWithNoInterfaceObjectConstructor::construct(JSC::ExecState* state)
</del><ins>+template<> JSC::EncodedJSValue JSC_HOST_CALL JSTestCustomConstructorWithNoInterfaceObjectConstructor::construct(JSC::ExecState* exec)
</ins><span class="cx"> {
</span><del>- return constructJSTestCustomConstructorWithNoInterfaceObject(state);
</del><ins>+ ASSERT(exec);
+ return constructJSTestCustomConstructorWithNoInterfaceObject(*exec);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> template<> JSValue JSTestCustomConstructorWithNoInterfaceObjectConstructor::prototypeForStructure(JSC::VM& vm, const JSDOMGlobalObject& globalObject)
</span></span></pre></div>
<a id="trunkSourceWebCorebindingsscriptstestJSJSTestCustomConstructorWithNoInterfaceObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h (202980 => 202981)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h        2016-07-08 15:48:23 UTC (rev 202980)
+++ trunk/Source/WebCore/bindings/scripts/test/JS/JSTestCustomConstructorWithNoInterfaceObject.h        2016-07-08 15:52:57 UTC (rev 202981)
</span><span class="lines">@@ -82,7 +82,7 @@
</span><span class="cx"> inline JSC::JSValue toJSNewlyCreated(JSC::ExecState* state, JSDOMGlobalObject* globalObject, RefPtr<TestCustomConstructorWithNoInterfaceObject>&& impl) { return impl ? toJSNewlyCreated(state, globalObject, impl.releaseNonNull()) : JSC::jsNull(); }
</span><span class="cx">
</span><span class="cx"> // Custom constructor
</span><del>-JSC::EncodedJSValue JSC_HOST_CALL constructJSTestCustomConstructorWithNoInterfaceObject(JSC::ExecState*);
</del><ins>+JSC::EncodedJSValue JSC_HOST_CALL constructJSTestCustomConstructorWithNoInterfaceObject(JSC::ExecState&);
</ins><span class="cx">
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre>
</div>
</div>
</body>
</html>