<!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>[242365] trunk/Source</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/242365">242365</a></dd>
<dt>Author</dt> <dd>ysuzuki@apple.com</dd>
<dt>Date</dt> <dd>2019-03-04 10:56:22 -0800 (Mon, 04 Mar 2019)</dd>
</dl>

<h3>Log Message</h3>
<pre>[JSC] Offer @makeTypeError instead of exposing @TypeError
https://bugs.webkit.org/show_bug.cgi?id=193858

Reviewed by Mark Lam.

Source/JavaScriptCore:

Instead of exposing @TypeError, we expose @makeTypeError function.
And we make TypeError and Error lazily-allocated objects in non JIT environment.
In JIT environment, only TypeError becomes lazily-allocated since WebAssembly errors
touch Error prototype anyway. But we can make them lazy in a subsequent patch.

* builtins/AsyncFromSyncIteratorPrototype.js:
* builtins/AsyncGeneratorPrototype.js:
(globalPrivate.asyncGeneratorEnqueue):
* builtins/BuiltinNames.h:
* builtins/PromiseOperations.js:
(globalPrivate.createResolvingFunctions.resolve):
* runtime/JSGlobalObject.cpp:
(JSC::JSGlobalObject::initializeErrorConstructor):
(JSC::JSGlobalObject::init):
(JSC::JSGlobalObject::visitChildren):
* runtime/JSGlobalObject.h:
(JSC::JSGlobalObject::errorPrototype const):
(JSC::JSGlobalObject::errorStructure const):
* runtime/JSGlobalObjectFunctions.cpp:
(JSC::globalFuncMakeTypeError):
* runtime/JSGlobalObjectFunctions.h:

Source/WebCore:

Use @makeTypeError instead.

* Modules/mediastream/RTCPeerConnection.js:
* Modules/mediastream/RTCPeerConnectionInternals.js:
* Modules/streams/ReadableByteStreamInternals.js:
(readableByteStreamControllerClose):
(readableByteStreamControllerPullInto):
* Modules/streams/ReadableStream.js:
(cancel):
(pipeTo):
* Modules/streams/ReadableStreamBYOBReader.js:
(cancel):
(read):
* Modules/streams/ReadableStreamDefaultReader.js:
(cancel):
(read):
* Modules/streams/ReadableStreamInternals.js:
(readableStreamReaderGenericRelease):
* Modules/streams/WritableStream.js:
(abort):
(close):
(write):
(getter.closed):
(getter.ready):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkSourceJavaScriptCoreChangeLog">trunk/Source/JavaScriptCore/ChangeLog</a></li>
<li><a href="#trunkSourceJavaScriptCorebuiltinsAsyncFromSyncIteratorPrototypejs">trunk/Source/JavaScriptCore/builtins/AsyncFromSyncIteratorPrototype.js</a></li>
<li><a href="#trunkSourceJavaScriptCorebuiltinsAsyncGeneratorPrototypejs">trunk/Source/JavaScriptCore/builtins/AsyncGeneratorPrototype.js</a></li>
<li><a href="#trunkSourceJavaScriptCorebuiltinsBuiltinNamesh">trunk/Source/JavaScriptCore/builtins/BuiltinNames.h</a></li>
<li><a href="#trunkSourceJavaScriptCorebuiltinsPromiseOperationsjs">trunk/Source/JavaScriptCore/builtins/PromiseOperations.js</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjecth">trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectFunctionscpp">trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp</a></li>
<li><a href="#trunkSourceJavaScriptCoreruntimeJSGlobalObjectFunctionsh">trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCPeerConnectionjs">trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.js</a></li>
<li><a href="#trunkSourceWebCoreModulesmediastreamRTCPeerConnectionInternalsjs">trunk/Source/WebCore/Modules/mediastream/RTCPeerConnectionInternals.js</a></li>
<li><a href="#trunkSourceWebCoreModulesstreamsReadableByteStreamInternalsjs">trunk/Source/WebCore/Modules/streams/ReadableByteStreamInternals.js</a></li>
<li><a href="#trunkSourceWebCoreModulesstreamsReadableStreamjs">trunk/Source/WebCore/Modules/streams/ReadableStream.js</a></li>
<li><a href="#trunkSourceWebCoreModulesstreamsReadableStreamBYOBReaderjs">trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.js</a></li>
<li><a href="#trunkSourceWebCoreModulesstreamsReadableStreamDefaultReaderjs">trunk/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.js</a></li>
<li><a href="#trunkSourceWebCoreModulesstreamsReadableStreamInternalsjs">trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js</a></li>
<li><a href="#trunkSourceWebCoreModulesstreamsWritableStreamjs">trunk/Source/WebCore/Modules/streams/WritableStream.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkSourceJavaScriptCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/ChangeLog (242364 => 242365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/ChangeLog    2019-03-04 18:06:18 UTC (rev 242364)
+++ trunk/Source/JavaScriptCore/ChangeLog       2019-03-04 18:56:22 UTC (rev 242365)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2019-03-04  Yusuke Suzuki  <ysuzuki@apple.com>
+
+        [JSC] Offer @makeTypeError instead of exposing @TypeError
+        https://bugs.webkit.org/show_bug.cgi?id=193858
+
+        Reviewed by Mark Lam.
+
+        Instead of exposing @TypeError, we expose @makeTypeError function.
+        And we make TypeError and Error lazily-allocated objects in non JIT environment.
+        In JIT environment, only TypeError becomes lazily-allocated since WebAssembly errors
+        touch Error prototype anyway. But we can make them lazy in a subsequent patch.
+
+        * builtins/AsyncFromSyncIteratorPrototype.js:
+        * builtins/AsyncGeneratorPrototype.js:
+        (globalPrivate.asyncGeneratorEnqueue):
+        * builtins/BuiltinNames.h:
+        * builtins/PromiseOperations.js:
+        (globalPrivate.createResolvingFunctions.resolve):
+        * runtime/JSGlobalObject.cpp:
+        (JSC::JSGlobalObject::initializeErrorConstructor):
+        (JSC::JSGlobalObject::init):
+        (JSC::JSGlobalObject::visitChildren):
+        * runtime/JSGlobalObject.h:
+        (JSC::JSGlobalObject::errorPrototype const):
+        (JSC::JSGlobalObject::errorStructure const):
+        * runtime/JSGlobalObjectFunctions.cpp:
+        (JSC::globalFuncMakeTypeError):
+        * runtime/JSGlobalObjectFunctions.h:
+
</ins><span class="cx"> 2019-03-04  Carlos Garcia Campos  <cgarcia@igalia.com>
</span><span class="cx"> 
</span><span class="cx">         [GLib] Returning G_TYPE_OBJECT from a constructor does not work
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsAsyncFromSyncIteratorPrototypejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/builtins/AsyncFromSyncIteratorPrototype.js (242364 => 242365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/builtins/AsyncFromSyncIteratorPrototype.js   2019-03-04 18:06:18 UTC (rev 242364)
+++ trunk/Source/JavaScriptCore/builtins/AsyncFromSyncIteratorPrototype.js      2019-03-04 18:56:22 UTC (rev 242365)
</span><span class="lines">@@ -30,7 +30,7 @@
</span><span class="cx">     const promiseCapability = @newPromiseCapability(@Promise);
</span><span class="cx"> 
</span><span class="cx">     if (!@isObject(this) || !@isObject(@getByIdDirectPrivate(this, "syncIterator"))) {
</span><del>-        promiseCapability.@reject.@call(@undefined, new @TypeError('Iterator is not an object.'));
</del><ins>+        promiseCapability.@reject.@call(@undefined, @makeTypeError('Iterator is not an object.'));
</ins><span class="cx">         return promiseCapability.@promise;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -57,7 +57,7 @@
</span><span class="cx">     const promiseCapability = @newPromiseCapability(@Promise);
</span><span class="cx"> 
</span><span class="cx">     if (!@isObject(this) || !@isObject(@getByIdDirectPrivate(this, "syncIterator"))) {
</span><del>-        promiseCapability.@reject.@call(@undefined, new @TypeError('Iterator is not an object.'));
</del><ins>+        promiseCapability.@reject.@call(@undefined, @makeTypeError('Iterator is not an object.'));
</ins><span class="cx">         return promiseCapability.@promise;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -81,7 +81,7 @@
</span><span class="cx">         const returnResult = returnMethod.@call(syncIterator, value);
</span><span class="cx"> 
</span><span class="cx">         if (!@isObject(returnResult)) {
</span><del>-            promiseCapability.@reject.@call(@undefined, new @TypeError('Iterator result interface is not an object.'));
</del><ins>+            promiseCapability.@reject.@call(@undefined, @makeTypeError('Iterator result interface is not an object.'));
</ins><span class="cx">             return promiseCapability.@promise;
</span><span class="cx">         }
</span><span class="cx"> 
</span><span class="lines">@@ -106,7 +106,7 @@
</span><span class="cx">     const promiseCapability = @newPromiseCapability(@Promise);
</span><span class="cx"> 
</span><span class="cx">     if (!@isObject(this) || !@isObject(@getByIdDirectPrivate(this, "syncIterator"))) {
</span><del>-        promiseCapability.@reject.@call(@undefined, new @TypeError('Iterator is not an object.'));
</del><ins>+        promiseCapability.@reject.@call(@undefined, @makeTypeError('Iterator is not an object.'));
</ins><span class="cx">         return promiseCapability.@promise;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -130,7 +130,7 @@
</span><span class="cx">         const throwResult = throwMethod.@call(syncIterator, exception);
</span><span class="cx">         
</span><span class="cx">         if (!@isObject(throwResult)) {
</span><del>-            promiseCapability.@reject.@call(@undefined, new @TypeError('Iterator result interface is not an object.'));
</del><ins>+            promiseCapability.@reject.@call(@undefined, @makeTypeError('Iterator result interface is not an object.'));
</ins><span class="cx">             return promiseCapability.@promise;
</span><span class="cx">         }
</span><span class="cx">         
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsAsyncGeneratorPrototypejs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/builtins/AsyncGeneratorPrototype.js (242364 => 242365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/builtins/AsyncGeneratorPrototype.js  2019-03-04 18:06:18 UTC (rev 242364)
+++ trunk/Source/JavaScriptCore/builtins/AsyncGeneratorPrototype.js     2019-03-04 18:56:22 UTC (rev 242365)
</span><span class="lines">@@ -265,7 +265,7 @@
</span><span class="cx">     
</span><span class="cx">     const promiseCapability = @newPromiseCapability(@Promise);
</span><span class="cx">     if (!@isObject(generator) || typeof @getByIdDirectPrivate(generator, "asyncGeneratorSuspendReason") !== 'number') {
</span><del>-        promiseCapability.@reject.@call(@undefined, new @TypeError('|this| should be an async generator'));
</del><ins>+        promiseCapability.@reject.@call(@undefined, @makeTypeError('|this| should be an async generator'));
</ins><span class="cx">         return promiseCapability.@promise;
</span><span class="cx">     }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsBuiltinNamesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/builtins/BuiltinNames.h (242364 => 242365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/builtins/BuiltinNames.h      2019-03-04 18:06:18 UTC (rev 242364)
+++ trunk/Source/JavaScriptCore/builtins/BuiltinNames.h 2019-03-04 18:56:22 UTC (rev 242365)
</span><span class="lines">@@ -74,7 +74,6 @@
</span><span class="cx">     macro(getOwnPropertyNames) \
</span><span class="cx">     macro(ownKeys) \
</span><span class="cx">     macro(Set) \
</span><del>-    macro(TypeError) \
</del><span class="cx">     macro(typedArrayLength) \
</span><span class="cx">     macro(typedArraySort) \
</span><span class="cx">     macro(typedArrayGetOriginalConstructor) \
</span><span class="lines">@@ -143,6 +142,7 @@
</span><span class="cx">     macro(regExpCreate) \
</span><span class="cx">     macro(replaceUsingRegExp) \
</span><span class="cx">     macro(replaceUsingStringSearch) \
</span><ins>+    macro(makeTypeError) \
</ins><span class="cx">     macro(mapBucket) \
</span><span class="cx">     macro(mapBucketHead) \
</span><span class="cx">     macro(mapBucketNext) \
</span></span></pre></div>
<a id="trunkSourceJavaScriptCorebuiltinsPromiseOperationsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/builtins/PromiseOperations.js (242364 => 242365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/builtins/PromiseOperations.js        2019-03-04 18:06:18 UTC (rev 242364)
+++ trunk/Source/JavaScriptCore/builtins/PromiseOperations.js   2019-03-04 18:56:22 UTC (rev 242365)
</span><span class="lines">@@ -148,7 +148,7 @@
</span><span class="cx">         alreadyResolved = true;
</span><span class="cx"> 
</span><span class="cx">         if (resolution === promise)
</span><del>-            return @rejectPromise(promise, new @TypeError("Resolve a promise with itself"));
</del><ins>+            return @rejectPromise(promise, @makeTypeError("Resolve a promise with itself"));
</ins><span class="cx"> 
</span><span class="cx">         if (!@isObject(resolution))
</span><span class="cx">             return @fulfillPromise(promise, resolution);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp (242364 => 242365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp   2019-03-04 18:06:18 UTC (rev 242364)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.cpp      2019-03-04 18:56:22 UTC (rev 242365)
</span><span class="lines">@@ -335,6 +335,7 @@
</span><span class="cx">   Float64Array          JSGlobalObject::m_typedArrayFloat64          DontEnum|ClassStructure
</span><span class="cx">   DataView              JSGlobalObject::m_typedArrayDataView         DontEnum|ClassStructure
</span><span class="cx">   Date                  JSGlobalObject::m_dateStructure              DontEnum|ClassStructure
</span><ins>+  Error                 JSGlobalObject::m_errorStructure             DontEnum|ClassStructure
</ins><span class="cx">   Boolean               JSGlobalObject::m_booleanObjectStructure     DontEnum|ClassStructure
</span><span class="cx">   Number                JSGlobalObject::m_numberObjectStructure      DontEnum|ClassStructure
</span><span class="cx">   Symbol                JSGlobalObject::m_symbolObjectStructure      DontEnum|ClassStructure
</span><span class="lines">@@ -409,9 +410,9 @@
</span><span class="cx"> template<ErrorType errorType>
</span><span class="cx"> void JSGlobalObject::initializeErrorConstructor(LazyClassStructure::Initializer& init)
</span><span class="cx"> {
</span><del>-    init.setPrototype(NativeErrorPrototype::create(init.vm, NativeErrorPrototype::createStructure(init.vm, this, m_errorPrototype.get()), errorTypeName(errorType)));
</del><ins>+    init.setPrototype(NativeErrorPrototype::create(init.vm, NativeErrorPrototype::createStructure(init.vm, this, m_errorStructure.prototype(this)), errorTypeName(errorType)));
</ins><span class="cx">     init.setStructure(ErrorInstance::createStructure(init.vm, this, init.prototype));
</span><del>-    init.setConstructor(NativeErrorConstructor<errorType>::create(init.vm, NativeErrorConstructor<errorType>::createStructure(init.vm, this, m_errorConstructor.get()), jsCast<NativeErrorPrototype*>(init.prototype)));
</del><ins>+    init.setConstructor(NativeErrorConstructor<errorType>::create(init.vm, NativeErrorConstructor<errorType>::createStructure(init.vm, this, m_errorStructure.constructor(this)), jsCast<NativeErrorPrototype*>(init.prototype)));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void JSGlobalObject::init(VM& vm)
</span><span class="lines">@@ -726,7 +727,6 @@
</span><span class="cx">     m_promiseConstructor.set(vm, this, promiseConstructor);
</span><span class="cx">     m_internalPromiseConstructor.set(vm, this, internalPromiseConstructor);
</span><span class="cx">     
</span><del>-    m_errorConstructor.set(vm, this, errorConstructor);
</del><span class="cx">     m_evalErrorStructure.initLater(
</span><span class="cx">         [] (LazyClassStructure::Initializer& init) {
</span><span class="cx">             init.global->initializeErrorConstructor<ErrorType::EvalError>(init);
</span><span class="lines">@@ -854,6 +854,7 @@
</span><span class="cx"> 
</span><span class="cx">     JSFunction* privateFuncPropertyIsEnumerable = JSFunction::create(vm, this, 0, String(), globalFuncPropertyIsEnumerable);
</span><span class="cx">     JSFunction* privateFuncImportModule = JSFunction::create(vm, this, 0, String(), globalFuncImportModule);
</span><ins>+    JSFunction* privateFuncMakeTypeError = JSFunction::create(vm, this, 0, String(), globalFuncMakeTypeError);
</ins><span class="cx">     JSFunction* privateFuncTypedArrayLength = JSFunction::create(vm, this, 0, String(), typedArrayViewPrivateFuncLength);
</span><span class="cx">     JSFunction* privateFuncTypedArrayGetOriginalConstructor = JSFunction::create(vm, this, 0, String(), typedArrayViewPrivateFuncGetOriginalConstructor);
</span><span class="cx">     JSFunction* privateFuncTypedArraySort = JSFunction::create(vm, this, 0, String(), typedArrayViewPrivateFuncSort);
</span><span class="lines">@@ -925,9 +926,7 @@
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames->builtinNames().propertyIsEnumerablePrivateName(), privateFuncPropertyIsEnumerable, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames->builtinNames().importModulePrivateName(), privateFuncImportModule, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames->builtinNames().enqueueJobPrivateName(), JSFunction::create(vm, this, 0, String(), enqueueJob), PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
</span><del>-        // FIXME: Offer @makeTypeError function instead of exposing @TypeError here.
-        // https://bugs.webkit.org/show_bug.cgi?id=193858
-        GlobalPropertyInfo(vm.propertyNames->builtinNames().TypeErrorPrivateName(), m_typeErrorStructure.constructor(this), PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
</del><ins>+        GlobalPropertyInfo(vm.propertyNames->builtinNames().makeTypeErrorPrivateName(), privateFuncMakeTypeError, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
</ins><span class="cx">         GlobalPropertyInfo(vm.propertyNames->builtinNames().typedArrayLengthPrivateName(), privateFuncTypedArrayLength, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames->builtinNames().typedArrayGetOriginalConstructorPrivateName(), privateFuncTypedArrayGetOriginalConstructor, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
</span><span class="cx">         GlobalPropertyInfo(vm.propertyNames->builtinNames().typedArraySortPrivateName(), privateFuncTypedArraySort, PropertyAttribute::DontEnum | PropertyAttribute::DontDelete | PropertyAttribute::ReadOnly),
</span><span class="lines">@@ -1031,7 +1030,7 @@
</span><span class="cx">         typedef capitalName ## Prototype Prototype; \
</span><span class="cx">         typedef capitalName ## Constructor Constructor; \
</span><span class="cx">         typedef JS ## capitalName JSObj; \
</span><del>-        auto* base = m_ ## prototypeBase ## Prototype.get(); \
</del><ins>+        auto* base = prototypeBase ## Prototype(); \
</ins><span class="cx">         auto* prototype = Prototype::create(vm, this, Prototype::createStructure(vm, this, base)); \
</span><span class="cx">         auto* structure = JSObj::createStructure(vm, this, prototype); \
</span><span class="cx">         auto* constructor = Constructor::create(vm, Constructor::createStructure(vm, this, this->functionPrototype()), prototype); \
</span><span class="lines">@@ -1587,7 +1586,6 @@
</span><span class="cx">     visitor.append(thisObject->m_globalScopeExtension);
</span><span class="cx">     visitor.append(thisObject->m_globalCallee);
</span><span class="cx">     visitor.append(thisObject->m_stackOverflowFrameCallee);
</span><del>-    visitor.append(thisObject->m_errorConstructor);
</del><span class="cx">     thisObject->m_evalErrorStructure.visit(visitor);
</span><span class="cx">     thisObject->m_rangeErrorStructure.visit(visitor);
</span><span class="cx">     thisObject->m_referenceErrorStructure.visit(visitor);
</span><span class="lines">@@ -1630,7 +1628,6 @@
</span><span class="cx">     visitor.append(thisObject->m_objectPrototype);
</span><span class="cx">     visitor.append(thisObject->m_functionPrototype);
</span><span class="cx">     visitor.append(thisObject->m_arrayPrototype);
</span><del>-    visitor.append(thisObject->m_errorPrototype);
</del><span class="cx">     visitor.append(thisObject->m_iteratorPrototype);
</span><span class="cx">     visitor.append(thisObject->m_generatorFunctionPrototype);
</span><span class="cx">     visitor.append(thisObject->m_generatorPrototype);
</span><span class="lines">@@ -1664,7 +1661,6 @@
</span><span class="cx">     thisObject->m_glibWrapperObjectStructure.visit(visitor);
</span><span class="cx"> #endif
</span><span class="cx">     visitor.append(thisObject->m_nullPrototypeObjectStructure);
</span><del>-    visitor.append(thisObject->m_errorStructure);
</del><span class="cx">     visitor.append(thisObject->m_calleeStructure);
</span><span class="cx"> 
</span><span class="cx">     visitor.append(thisObject->m_hostFunctionStructure);
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjecth"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h (242364 => 242365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h     2019-03-04 18:06:18 UTC (rev 242364)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObject.h        2019-03-04 18:56:22 UTC (rev 242365)
</span><span class="lines">@@ -128,7 +128,6 @@
</span><span class="cx"> 
</span><span class="cx"> #define FOR_EACH_SIMPLE_BUILTIN_TYPE_WITH_CONSTRUCTOR(macro) \
</span><span class="cx">     macro(String, string, stringObject, StringObject, String, object) \
</span><del>-    macro(Error, error, error, ErrorInstance, Error, object) \
</del><span class="cx">     macro(Map, map, map, JSMap, Map, object) \
</span><span class="cx">     macro(Set, set, set, JSSet, Set, object) \
</span><span class="cx">     macro(JSPromise, promise, promise, JSPromise, Promise, object)
</span><span class="lines">@@ -146,6 +145,7 @@
</span><span class="cx"> #define FOR_EACH_LAZY_BUILTIN_TYPE(macro) \
</span><span class="cx">     macro(Boolean, boolean, booleanObject, BooleanObject, Boolean, object) \
</span><span class="cx">     macro(Date, date, date, DateInstance, Date, object) \
</span><ins>+    macro(Error, error, error, ErrorInstance, Error, object) \
</ins><span class="cx">     macro(Number, number, numberObject, NumberObject, Number, object) \
</span><span class="cx">     macro(Symbol, symbol, symbolObject, SymbolObject, Symbol, object) \
</span><span class="cx">     DEFINE_STANDARD_BUILTIN(macro, WeakMap, weakMap) \
</span><span class="lines">@@ -631,7 +631,7 @@
</span><span class="cx">     JSObject* datePrototype() const { return m_dateStructure.prototype(this); }
</span><span class="cx">     JSObject* symbolPrototype() const { return m_symbolObjectStructure.prototypeInitializedOnMainThread(this); }
</span><span class="cx">     RegExpPrototype* regExpPrototype() const { return m_regExpPrototype.get(); }
</span><del>-    ErrorPrototype* errorPrototype() const { return m_errorPrototype.get(); }
</del><ins>+    JSObject* errorPrototype() const { return m_errorStructure.prototype(this); }
</ins><span class="cx">     IteratorPrototype* iteratorPrototype() const { return m_iteratorPrototype.get(); }
</span><span class="cx">     AsyncIteratorPrototype* asyncIteratorPrototype() const { return m_asyncIteratorPrototype.get(); }
</span><span class="cx">     GeneratorFunctionPrototype* generatorFunctionPrototype() const { return m_generatorFunctionPrototype.get(); }
</span><span class="lines">@@ -692,7 +692,7 @@
</span><span class="cx">     Structure* dateStructure() const { return m_dateStructure.get(this); }
</span><span class="cx">     Structure* symbolObjectStructure() const { return m_symbolObjectStructure.get(this); }
</span><span class="cx">     Structure* nullPrototypeObjectStructure() const { return m_nullPrototypeObjectStructure.get(); }
</span><del>-    Structure* errorStructure() const { return m_errorStructure.get(); }
</del><ins>+    Structure* errorStructure() const { return m_errorStructure.get(this); }
</ins><span class="cx">     Structure* errorStructure(ErrorType errorType) const
</span><span class="cx">     {
</span><span class="cx">         switch (errorType) {
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectFunctionscpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp (242364 => 242365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp  2019-03-04 18:06:18 UTC (rev 242364)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp     2019-03-04 18:56:22 UTC (rev 242365)
</span><span class="lines">@@ -698,6 +698,13 @@
</span><span class="cx">     return throwVMTypeError(exec, scope, "'arguments', 'callee', and 'caller' cannot be accessed in this context.");
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+EncodedJSValue JSC_HOST_CALL globalFuncMakeTypeError(ExecState* exec)
+{
+    JSGlobalObject* globalObject = exec->lexicalGlobalObject();
+    Structure* errorStructure = globalObject->errorStructure(ErrorType::TypeError);
+    return JSValue::encode(ErrorInstance::create(exec, errorStructure, exec->argument(0), nullptr, TypeNothing, false));
+}
+
</ins><span class="cx"> EncodedJSValue JSC_HOST_CALL globalFuncProtoGetter(ExecState* exec)
</span><span class="cx"> {
</span><span class="cx">     VM& vm = exec->vm();
</span></span></pre></div>
<a id="trunkSourceJavaScriptCoreruntimeJSGlobalObjectFunctionsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h (242364 => 242365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h    2019-03-04 18:06:18 UTC (rev 242364)
+++ trunk/Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h       2019-03-04 18:56:22 UTC (rev 242365)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL globalFuncUnescape(ExecState*);
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL globalFuncThrowTypeError(ExecState*);
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL globalFuncThrowTypeErrorArgumentsCalleeAndCaller(ExecState*);
</span><ins>+EncodedJSValue JSC_HOST_CALL globalFuncMakeTypeError(ExecState*);
</ins><span class="cx"> EncodedJSValue JSC_HOST_CALL globalFuncProtoGetter(ExecState*);
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL globalFuncProtoSetter(ExecState*);
</span><span class="cx"> EncodedJSValue JSC_HOST_CALL globalFuncHostPromiseRejectionTracker(ExecState*);
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (242364 => 242365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog   2019-03-04 18:06:18 UTC (rev 242364)
+++ trunk/Source/WebCore/ChangeLog      2019-03-04 18:56:22 UTC (rev 242365)
</span><span class="lines">@@ -1,3 +1,35 @@
</span><ins>+2019-03-04  Yusuke Suzuki  <ysuzuki@apple.com>
+
+        [JSC] Offer @makeTypeError instead of exposing @TypeError
+        https://bugs.webkit.org/show_bug.cgi?id=193858
+
+        Reviewed by Mark Lam.
+
+        Use @makeTypeError instead.
+
+        * Modules/mediastream/RTCPeerConnection.js:
+        * Modules/mediastream/RTCPeerConnectionInternals.js:
+        * Modules/streams/ReadableByteStreamInternals.js:
+        (readableByteStreamControllerClose):
+        (readableByteStreamControllerPullInto):
+        * Modules/streams/ReadableStream.js:
+        (cancel):
+        (pipeTo):
+        * Modules/streams/ReadableStreamBYOBReader.js:
+        (cancel):
+        (read):
+        * Modules/streams/ReadableStreamDefaultReader.js:
+        (cancel):
+        (read):
+        * Modules/streams/ReadableStreamInternals.js:
+        (readableStreamReaderGenericRelease):
+        * Modules/streams/WritableStream.js:
+        (abort):
+        (close):
+        (write):
+        (getter.closed):
+        (getter.ready):
+
</ins><span class="cx"> 2019-03-04  Simon Fraser  <simon.fraser@apple.com>
</span><span class="cx"> 
</span><span class="cx">         Share more code between overflow and frame scrolling nodes, fixing overflow scrollbar display
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectionjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.js (242364 => 242365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.js    2019-03-04 18:06:18 UTC (rev 242364)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnection.js       2019-03-04 18:56:22 UTC (rev 242365)
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx">         return @Promise.@reject(@makeThisTypeError("RTCPeerConnection", "setLocalDescription"));
</span><span class="cx"> 
</span><span class="cx">     if (arguments.length < 1)
</span><del>-        return @Promise.@reject(new @TypeError("Not enough arguments"));
</del><ins>+        return @Promise.@reject(@makeTypeError("Not enough arguments"));
</ins><span class="cx"> 
</span><span class="cx">     // FIXME 169644: According the spec, we should throw when receiving a RTCSessionDescription.
</span><span class="cx">     const objectInfo = {
</span><span class="lines">@@ -103,7 +103,7 @@
</span><span class="cx">         return @Promise.@reject(@makeThisTypeError("RTCPeerConnection", "setRemoteDescription"));
</span><span class="cx"> 
</span><span class="cx">     if (arguments.length < 1)
</span><del>-        return @Promise.@reject(new @TypeError("Not enough arguments"));
</del><ins>+        return @Promise.@reject(@makeTypeError("Not enough arguments"));
</ins><span class="cx"> 
</span><span class="cx">     // FIXME: According the spec, we should only expect RTCSessionDescriptionInit.
</span><span class="cx">     const objectInfo = {
</span><span class="lines">@@ -127,7 +127,7 @@
</span><span class="cx">         return @Promise.@reject(@makeThisTypeError("RTCPeerConnection", "addIceCandidate"));
</span><span class="cx"> 
</span><span class="cx">     if (arguments.length < 1)
</span><del>-        return @Promise.@reject(new @TypeError("Not enough arguments"));
</del><ins>+        return @Promise.@reject(@makeTypeError("Not enough arguments"));
</ins><span class="cx"> 
</span><span class="cx">     const objectInfo = {
</span><span class="cx">         "constructor": @RTCIceCandidate,
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesmediastreamRTCPeerConnectionInternalsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/mediastream/RTCPeerConnectionInternals.js (242364 => 242365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/mediastream/RTCPeerConnectionInternals.js   2019-03-04 18:06:18 UTC (rev 242364)
+++ trunk/Source/WebCore/Modules/mediastream/RTCPeerConnectionInternals.js      2019-03-04 18:56:22 UTC (rev 242365)
</span><span class="lines">@@ -76,7 +76,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!objectArgOk)
</span><del>-        return @Promise.@reject(new @TypeError(`Argument 1 ('${objectInfo.argName}') to RTCPeerConnection.${functionName} must be an instance of ${objectInfo.argType}`));
</del><ins>+        return @Promise.@reject(@makeTypeError(`Argument 1 ('${objectInfo.argName}') to RTCPeerConnection.${functionName} must be an instance of ${objectInfo.argType}`));
</ins><span class="cx"> 
</span><span class="cx">     return promiseMode(objectArg);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesstreamsReadableByteStreamInternalsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/streams/ReadableByteStreamInternals.js (242364 => 242365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/streams/ReadableByteStreamInternals.js      2019-03-04 18:06:18 UTC (rev 242364)
+++ trunk/Source/WebCore/Modules/streams/ReadableByteStreamInternals.js 2019-03-04 18:56:22 UTC (rev 242365)
</span><span class="lines">@@ -149,7 +149,7 @@
</span><span class="cx">     var pendingPullIntos = @getByIdDirectPrivate(controller, "pendingPullIntos");
</span><span class="cx">     if (pendingPullIntos.length > 0) {
</span><span class="cx">         if (pendingPullIntos[0].bytesFilled > 0) {
</span><del>-            const e = new @TypeError("Close requested while there remain pending bytes");
</del><ins>+            const e = @makeTypeError("Close requested while there remain pending bytes");
</ins><span class="cx">             @readableByteStreamControllerError(controller, e);
</span><span class="cx">             throw e;
</span><span class="cx">         }
</span><span class="lines">@@ -648,7 +648,7 @@
</span><span class="cx">             return @Promise.@resolve({ value: filledView, done: false });
</span><span class="cx">         }
</span><span class="cx">         if (@getByIdDirectPrivate(controller, "closeRequested")) {
</span><del>-            const e = new @TypeError("Closing stream has been requested");
</del><ins>+            const e = @makeTypeError("Closing stream has been requested");
</ins><span class="cx">             @readableByteStreamControllerError(controller, e);
</span><span class="cx">             return @Promise.@reject(e);
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesstreamsReadableStreamjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/streams/ReadableStream.js (242364 => 242365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/streams/ReadableStream.js   2019-03-04 18:06:18 UTC (rev 242364)
+++ trunk/Source/WebCore/Modules/streams/ReadableStream.js      2019-03-04 18:56:22 UTC (rev 242365)
</span><span class="lines">@@ -80,7 +80,7 @@
</span><span class="cx">         return @Promise.@reject(@makeThisTypeError("ReadableStream", "cancel"));
</span><span class="cx"> 
</span><span class="cx">     if (@isReadableStreamLocked(this))
</span><del>-        return @Promise.@reject(new @TypeError("ReadableStream is locked"));
</del><ins>+        return @Promise.@reject(@makeTypeError("ReadableStream is locked"));
</ins><span class="cx"> 
</span><span class="cx">     return @readableStreamCancel(this, reason);
</span><span class="cx"> }
</span><span class="lines">@@ -198,7 +198,7 @@
</span><span class="cx">     @Promise.prototype.@then.@call(destination.closed,
</span><span class="cx">         function() {
</span><span class="cx">             if (!closedPurposefully)
</span><del>-                cancelSource(new @TypeError('destination is closing or closed and cannot be piped to anymore'));
</del><ins>+                cancelSource(@makeTypeError('destination is closing or closed and cannot be piped to anymore'));
</ins><span class="cx">         },
</span><span class="cx">         cancelSource
</span><span class="cx">     );
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesstreamsReadableStreamBYOBReaderjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.js (242364 => 242365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.js 2019-03-04 18:06:18 UTC (rev 242364)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamBYOBReader.js    2019-03-04 18:56:22 UTC (rev 242365)
</span><span class="lines">@@ -49,7 +49,7 @@
</span><span class="cx">         return @Promise.@reject(@makeThisTypeError("ReadableStreamBYOBReader", "cancel"));
</span><span class="cx"> 
</span><span class="cx">     if (!@getByIdDirectPrivate(this, "ownerReadableStream"))
</span><del>-        return @Promise.@reject(new @TypeError("cancel() called on a reader owned by no readable stream"));
</del><ins>+        return @Promise.@reject(@makeTypeError("cancel() called on a reader owned by no readable stream"));
</ins><span class="cx"> 
</span><span class="cx">     return @readableStreamReaderGenericCancel(this, reason);
</span><span class="cx"> }
</span><span class="lines">@@ -62,16 +62,16 @@
</span><span class="cx">         return @Promise.@reject(@makeThisTypeError("ReadableStreamBYOBReader", "read"));
</span><span class="cx"> 
</span><span class="cx">     if (!@getByIdDirectPrivate(this, "ownerReadableStream"))
</span><del>-        return @Promise.@reject(new @TypeError("read() called on a reader owned by no readable stream"));
</del><ins>+        return @Promise.@reject(@makeTypeError("read() called on a reader owned by no readable stream"));
</ins><span class="cx"> 
</span><span class="cx">     if (!@isObject(view))
</span><del>-        return @Promise.@reject(new @TypeError("Provided view is not an object"));
</del><ins>+        return @Promise.@reject(@makeTypeError("Provided view is not an object"));
</ins><span class="cx"> 
</span><span class="cx">     if (!@ArrayBuffer.@isView(view))
</span><del>-        return @Promise.@reject(new @TypeError("Provided view is not an ArrayBufferView"));
</del><ins>+        return @Promise.@reject(@makeTypeError("Provided view is not an ArrayBufferView"));
</ins><span class="cx"> 
</span><span class="cx">     if (view.byteLength === 0)
</span><del>-        return @Promise.@reject(new @TypeError("Provided view cannot have a 0 byteLength"));
</del><ins>+        return @Promise.@reject(@makeTypeError("Provided view cannot have a 0 byteLength"));
</ins><span class="cx"> 
</span><span class="cx">     return @readableStreamBYOBReaderRead(this, view);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesstreamsReadableStreamDefaultReaderjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.js (242364 => 242365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.js      2019-03-04 18:06:18 UTC (rev 242364)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamDefaultReader.js 2019-03-04 18:56:22 UTC (rev 242365)
</span><span class="lines">@@ -48,7 +48,7 @@
</span><span class="cx">         return @Promise.@reject(@makeThisTypeError("ReadableStreamDefaultReader", "cancel"));
</span><span class="cx"> 
</span><span class="cx">     if (!@getByIdDirectPrivate(this, "ownerReadableStream"))
</span><del>-        return @Promise.@reject(new @TypeError("cancel() called on a reader owned by no readable stream"));
</del><ins>+        return @Promise.@reject(@makeTypeError("cancel() called on a reader owned by no readable stream"));
</ins><span class="cx"> 
</span><span class="cx">     return @readableStreamReaderGenericCancel(this, reason);
</span><span class="cx"> }
</span><span class="lines">@@ -60,7 +60,7 @@
</span><span class="cx">     if (!@isReadableStreamDefaultReader(this))
</span><span class="cx">         return @Promise.@reject(@makeThisTypeError("ReadableStreamDefaultReader", "read"));
</span><span class="cx">     if (!@getByIdDirectPrivate(this, "ownerReadableStream"))
</span><del>-        return @Promise.@reject(new @TypeError("read() called on a reader owned by no readable stream"));
</del><ins>+        return @Promise.@reject(@makeTypeError("read() called on a reader owned by no readable stream"));
</ins><span class="cx"> 
</span><span class="cx">     return @readableStreamDefaultReaderRead(this);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesstreamsReadableStreamInternalsjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js (242364 => 242365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js  2019-03-04 18:06:18 UTC (rev 242364)
+++ trunk/Source/WebCore/Modules/streams/ReadableStreamInternals.js     2019-03-04 18:56:22 UTC (rev 242365)
</span><span class="lines">@@ -514,9 +514,9 @@
</span><span class="cx">     @assert(@getByIdDirectPrivate(@getByIdDirectPrivate(reader, "ownerReadableStream"), "reader") === reader);
</span><span class="cx"> 
</span><span class="cx">     if (@getByIdDirectPrivate(@getByIdDirectPrivate(reader, "ownerReadableStream"), "state") === @streamReadable)
</span><del>-        @getByIdDirectPrivate(reader, "closedPromiseCapability").@reject.@call(@undefined, new @TypeError("releasing lock of reader whose stream is still in readable state"));
</del><ins>+        @getByIdDirectPrivate(reader, "closedPromiseCapability").@reject.@call(@undefined, @makeTypeError("releasing lock of reader whose stream is still in readable state"));
</ins><span class="cx">     else
</span><del>-        @putByIdDirectPrivate(reader, "closedPromiseCapability", { @promise: @newHandledRejectedPromise(new @TypeError("reader released lock")) });
</del><ins>+        @putByIdDirectPrivate(reader, "closedPromiseCapability", { @promise: @newHandledRejectedPromise(@makeTypeError("reader released lock")) });
</ins><span class="cx"> 
</span><span class="cx">     @putByIdDirectPrivate(@getByIdDirectPrivate(reader, "closedPromiseCapability").@promise, "promiseIsHandled", true);
</span><span class="cx">     @putByIdDirectPrivate(@getByIdDirectPrivate(reader, "ownerReadableStream"), "reader", @undefined);
</span></span></pre></div>
<a id="trunkSourceWebCoreModulesstreamsWritableStreamjs"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/Modules/streams/WritableStream.js (242364 => 242365)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/Modules/streams/WritableStream.js   2019-03-04 18:06:18 UTC (rev 242364)
+++ trunk/Source/WebCore/Modules/streams/WritableStream.js      2019-03-04 18:56:22 UTC (rev 242365)
</span><span class="lines">@@ -70,7 +70,7 @@
</span><span class="cx">     "use strict";
</span><span class="cx"> 
</span><span class="cx">     if (!@isWritableStream(this))
</span><del>-        return @Promise.@reject(new @TypeError("The WritableStream.abort method can only be used on instances of WritableStream"));
</del><ins>+        return @Promise.@reject(@makeTypeError("The WritableStream.abort method can only be used on instances of WritableStream"));
</ins><span class="cx"> 
</span><span class="cx">     const state = @getByIdDirectPrivate(this, "state");
</span><span class="cx">     if (state === @streamClosed)
</span><span class="lines">@@ -89,11 +89,11 @@
</span><span class="cx">     "use strict";
</span><span class="cx"> 
</span><span class="cx">     if (!@isWritableStream(this))
</span><del>-        return @Promise.@reject(new @TypeError("The WritableStream.close method can only be used on instances of WritableStream"));
</del><ins>+        return @Promise.@reject(@makeTypeError("The WritableStream.close method can only be used on instances of WritableStream"));
</ins><span class="cx"> 
</span><span class="cx">     const state = @getByIdDirectPrivate(this, "state");
</span><span class="cx">     if (state === @streamClosed || state === @streamClosing)
</span><del>-        return @Promise.@reject(new @TypeError("Cannot close a WritableString that is closed or closing"));
</del><ins>+        return @Promise.@reject(@makeTypeError("Cannot close a WritableString that is closed or closing"));
</ins><span class="cx"> 
</span><span class="cx">     if (state === @streamErrored)
</span><span class="cx">         return @Promise.@reject(@getByIdDirectPrivate(this, "storedError"));
</span><span class="lines">@@ -113,11 +113,11 @@
</span><span class="cx">     "use strict";
</span><span class="cx"> 
</span><span class="cx">     if (!@isWritableStream(this))
</span><del>-        return @Promise.@reject(new @TypeError("The WritableStream.write method can only be used on instances of WritableStream"));
</del><ins>+        return @Promise.@reject(@makeTypeError("The WritableStream.write method can only be used on instances of WritableStream"));
</ins><span class="cx"> 
</span><span class="cx">     const state = @getByIdDirectPrivate(this, "state");
</span><span class="cx">     if (state === @streamClosed || state === @streamClosing)
</span><del>-        return @Promise.@reject(new @TypeError("Cannot write on a WritableString that is closed or closing"));
</del><ins>+        return @Promise.@reject(@makeTypeError("Cannot write on a WritableString that is closed or closing"));
</ins><span class="cx"> 
</span><span class="cx">     if (state === @streamErrored)
</span><span class="cx">         return @Promise.@reject(this.@storedError);
</span><span class="lines">@@ -154,7 +154,7 @@
</span><span class="cx">     "use strict";
</span><span class="cx"> 
</span><span class="cx">     if (!@isWritableStream(this))
</span><del>-        return @Promise.@reject(new @TypeError("The WritableStream.closed getter can only be used on instances of WritableStream"));
</del><ins>+        return @Promise.@reject(@makeTypeError("The WritableStream.closed getter can only be used on instances of WritableStream"));
</ins><span class="cx"> 
</span><span class="cx">     return @getByIdDirectPrivate(this, "closedPromiseCapability").@promise;
</span><span class="cx"> }
</span><span class="lines">@@ -165,7 +165,7 @@
</span><span class="cx">     "use strict";
</span><span class="cx"> 
</span><span class="cx">     if (!@isWritableStream(this))
</span><del>-        return @Promise.@reject(new @TypeError("The WritableStream.ready getter can only be used on instances of WritableStream"));
</del><ins>+        return @Promise.@reject(@makeTypeError("The WritableStream.ready getter can only be used on instances of WritableStream"));
</ins><span class="cx"> 
</span><span class="cx">     return @getByIdDirectPrivate(this, "readyPromiseCapability").@promise;
</span><span class="cx"> }
</span></span></pre>
</div>
</div>

</body>
</html>