aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/bindings/webcore/JSReadableByteStreamController.cpp
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <jarred@jarredsumner.com> 2022-08-27 23:46:05 -0700
committerGravatar GitHub <noreply@github.com> 2022-08-27 23:46:05 -0700
commitaf5c4dedca550a856486ec8bbc9f6da76396496e (patch)
tree618a42aed0eb46e9a726fc58731358b3bb7cbc27 /src/bun.js/bindings/webcore/JSReadableByteStreamController.cpp
parent8b3afa5831b7ac5fcabb47138c67d60e86247cd3 (diff)
downloadbun-af5c4dedca550a856486ec8bbc9f6da76396496e.tar.gz
bun-af5c4dedca550a856486ec8bbc9f6da76396496e.tar.zst
bun-af5c4dedca550a856486ec8bbc9f6da76396496e.zip
Update WebKit (#1165)
* Update WebKit * Fix `DataView` and non-8 bit sized typed arrays with TextDecoder * New WebKit Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
Diffstat (limited to 'src/bun.js/bindings/webcore/JSReadableByteStreamController.cpp')
-rw-r--r--src/bun.js/bindings/webcore/JSReadableByteStreamController.cpp38
1 files changed, 17 insertions, 21 deletions
diff --git a/src/bun.js/bindings/webcore/JSReadableByteStreamController.cpp b/src/bun.js/bindings/webcore/JSReadableByteStreamController.cpp
index 7f151188f..884547adc 100644
--- a/src/bun.js/bindings/webcore/JSReadableByteStreamController.cpp
+++ b/src/bun.js/bindings/webcore/JSReadableByteStreamController.cpp
@@ -40,13 +40,11 @@
#include <wtf/GetPtr.h>
#include <wtf/PointerPreparations.h>
-
namespace WebCore {
using namespace JSC;
// Functions
-
// Attributes
static JSC_DECLARE_CUSTOM_GETTER(jsReadableByteStreamControllerConstructor);
@@ -109,14 +107,13 @@ template<> FunctionExecutable* JSReadableByteStreamControllerDOMConstructor::ini
/* Hash table for prototype */
-static const HashTableValue JSReadableByteStreamControllerPrototypeTableValues[] =
-{
- { "constructor"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { (intptr_t)static_cast<PropertySlot::GetValueFunc>(jsReadableByteStreamControllerConstructor), (intptr_t) static_cast<PutPropertySlot::PutValueFunc>(0) } },
- { "byobRequest"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Accessor | JSC::PropertyAttribute::Builtin), NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(readableByteStreamControllerByobRequestCodeGenerator), (intptr_t) (0) } },
- { "desiredSize"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Accessor | JSC::PropertyAttribute::Builtin), NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(readableByteStreamControllerDesiredSizeCodeGenerator), (intptr_t) (0) } },
- { "enqueue"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::Builtin), NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(readableByteStreamControllerEnqueueCodeGenerator), (intptr_t) (0) } },
- { "close"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::Builtin), NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(readableByteStreamControllerCloseCodeGenerator), (intptr_t) (0) } },
- { "error"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::Builtin), NoIntrinsic, { (intptr_t)static_cast<BuiltinGenerator>(readableByteStreamControllerErrorCodeGenerator), (intptr_t) (0) } },
+static const HashTableValue JSReadableByteStreamControllerPrototypeTableValues[] = {
+ { "constructor"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum), NoIntrinsic, { HashTableValue::GetterSetterType, jsReadableByteStreamControllerConstructor, 0 } },
+ { "byobRequest"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Accessor | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinAccessorType, readableByteStreamControllerByobRequestCodeGenerator, 0 } },
+ { "desiredSize"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::ReadOnly | JSC::PropertyAttribute::Accessor | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinAccessorType, readableByteStreamControllerDesiredSizeCodeGenerator, 0 } },
+ { "enqueue"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, readableByteStreamControllerEnqueueCodeGenerator, 0 } },
+ { "close"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, readableByteStreamControllerCloseCodeGenerator, 0 } },
+ { "error"_s, static_cast<unsigned>(JSC::PropertyAttribute::DontEnum | JSC::PropertyAttribute::Builtin), NoIntrinsic, { HashTableValue::BuiltinGeneratorType, readableByteStreamControllerErrorCodeGenerator, 0 } },
};
const ClassInfo JSReadableByteStreamControllerPrototype::s_info = { "ReadableByteStreamController"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSReadableByteStreamControllerPrototype) };
@@ -131,13 +128,14 @@ void JSReadableByteStreamControllerPrototype::finishCreation(VM& vm)
const ClassInfo JSReadableByteStreamController::s_info = { "ReadableByteStreamController"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSReadableByteStreamController) };
JSReadableByteStreamController::JSReadableByteStreamController(Structure* structure, JSDOMGlobalObject& globalObject)
- : JSDOMObject(structure, globalObject) { }
+ : JSDOMObject(structure, globalObject)
+{
+}
void JSReadableByteStreamController::finishCreation(VM& vm)
{
Base::finishCreation(vm);
ASSERT(inherits(info()));
-
}
JSObject* JSReadableByteStreamController::createPrototype(VM& vm, JSDOMGlobalObject& globalObject)
@@ -161,7 +159,7 @@ void JSReadableByteStreamController::destroy(JSC::JSCell* cell)
thisObject->JSReadableByteStreamController::~JSReadableByteStreamController();
}
-JSC_DEFINE_CUSTOM_GETTER(jsReadableByteStreamControllerConstructor, (JSGlobalObject* lexicalGlobalObject, EncodedJSValue thisValue, PropertyName))
+JSC_DEFINE_CUSTOM_GETTER(jsReadableByteStreamControllerConstructor, (JSGlobalObject * lexicalGlobalObject, EncodedJSValue thisValue, PropertyName))
{
VM& vm = JSC::getVM(lexicalGlobalObject);
auto throwScope = DECLARE_THROW_SCOPE(vm);
@@ -173,13 +171,11 @@ JSC_DEFINE_CUSTOM_GETTER(jsReadableByteStreamControllerConstructor, (JSGlobalObj
JSC::GCClient::IsoSubspace* JSReadableByteStreamController::subspaceForImpl(JSC::VM& vm)
{
- return WebCore::subspaceForImpl<JSReadableByteStreamController, UseCustomHeapCellType::No>(vm,
- [] (auto& spaces) { return spaces.m_clientSubspaceForReadableByteStreamController.get(); },
- [] (auto& spaces, auto&& space) { spaces.m_clientSubspaceForReadableByteStreamController = WTFMove(space); },
- [] (auto& spaces) { return spaces.m_subspaceForReadableByteStreamController.get(); },
- [] (auto& spaces, auto&& space) { spaces.m_subspaceForReadableByteStreamController = WTFMove(space); }
- );
+ return WebCore::subspaceForImpl<JSReadableByteStreamController, UseCustomHeapCellType::No>(
+ vm,
+ [](auto& spaces) { return spaces.m_clientSubspaceForReadableByteStreamController.get(); },
+ [](auto& spaces, auto&& space) { spaces.m_clientSubspaceForReadableByteStreamController = WTFMove(space); },
+ [](auto& spaces) { return spaces.m_subspaceForReadableByteStreamController.get(); },
+ [](auto& spaces, auto&& space) { spaces.m_subspaceForReadableByteStreamController = WTFMove(space); });
}
-
-
}