[JSC] Offer @makeTypeError instead of exposing @TypeError
authorysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Mar 2019 18:56:22 +0000 (18:56 +0000)
committerysuzuki@apple.com <ysuzuki@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 4 Mar 2019 18:56:22 +0000 (18:56 +0000)
commitb3f4d1de2f0cf7a0e1de021d126c84a289741d7b
tree7ecbea6998ba0fc0c6833e181315515772e1aa2b
parent5f32cd7a0e13be596e129148970727567be865a0
[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):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@242365 268f45cc-cd09-0410-ab3c-d52691b4dbfc
18 files changed:
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/builtins/AsyncFromSyncIteratorPrototype.js
Source/JavaScriptCore/builtins/AsyncGeneratorPrototype.js
Source/JavaScriptCore/builtins/BuiltinNames.h
Source/JavaScriptCore/builtins/PromiseOperations.js
Source/JavaScriptCore/runtime/JSGlobalObject.cpp
Source/JavaScriptCore/runtime/JSGlobalObject.h
Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.cpp
Source/JavaScriptCore/runtime/JSGlobalObjectFunctions.h
Source/WebCore/ChangeLog
Source/WebCore/Modules/mediastream/RTCPeerConnection.js
Source/WebCore/Modules/mediastream/RTCPeerConnectionInternals.js
Source/WebCore/Modules/streams/ReadableByteStreamInternals.js
Source/WebCore/Modules/streams/ReadableStream.js
Source/WebCore/Modules/streams/ReadableStreamBYOBReader.js
Source/WebCore/Modules/streams/ReadableStreamDefaultReader.js
Source/WebCore/Modules/streams/ReadableStreamInternals.js
Source/WebCore/Modules/streams/WritableStream.js