From fc40c690ea30a632a8d0d9490321c50ec898d8a5 Mon Sep 17 00:00:00 2001 From: dave caruso Date: Mon, 22 May 2023 18:51:05 -0700 Subject: Write out builtins with TypeScript + Minify them (#2999) * start work drafting how builtins will work * work on ts builtin * builtins stuff so far * builtins * done for today * continue work * working on it * bindings so far * well, it builds. doesnt run * IT RUNS * still lots of ts errors but it is functional * sloppy mode --- .../cpp/ReadableStreamBYOBRequestBuiltins.h | 155 --------------------- 1 file changed, 155 deletions(-) delete mode 100644 src/bun.js/builtins/cpp/ReadableStreamBYOBRequestBuiltins.h (limited to 'src/bun.js/builtins/cpp/ReadableStreamBYOBRequestBuiltins.h') diff --git a/src/bun.js/builtins/cpp/ReadableStreamBYOBRequestBuiltins.h b/src/bun.js/builtins/cpp/ReadableStreamBYOBRequestBuiltins.h deleted file mode 100644 index 497a17bb0..000000000 --- a/src/bun.js/builtins/cpp/ReadableStreamBYOBRequestBuiltins.h +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2015 Igalia - * Copyright (c) 2015 Igalia S.L. - * Copyright (c) 2015 Igalia. - * Copyright (c) 2015, 2016 Canon Inc. All rights reserved. - * Copyright (c) 2015, 2016, 2017 Canon Inc. - * Copyright (c) 2016, 2020 Apple Inc. All rights reserved. - * Copyright (c) 2023 Codeblog Corp. All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * 2. Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * - * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' - * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, - * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS - * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR - * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF - * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN - * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF - * THE POSSIBILITY OF SUCH DAMAGE. - * - */ - -// DO NOT EDIT THIS FILE. It is automatically generated from JavaScript files for -// builtins by the script: Source/JavaScriptCore/Scripts/generate-js-builtins.py - -#pragma once - -#include -#include -#include -#include - -namespace JSC { -class FunctionExecutable; -} - -namespace WebCore { - -/* ReadableStreamBYOBRequest */ -extern const char* const s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCode; -extern const int s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeLength; -extern const JSC::ConstructAbility s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeImplementationVisibility; -extern const char* const s_readableStreamBYOBRequestRespondCode; -extern const int s_readableStreamBYOBRequestRespondCodeLength; -extern const JSC::ConstructAbility s_readableStreamBYOBRequestRespondCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamBYOBRequestRespondCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestRespondCodeImplementationVisibility; -extern const char* const s_readableStreamBYOBRequestRespondWithNewViewCode; -extern const int s_readableStreamBYOBRequestRespondWithNewViewCodeLength; -extern const JSC::ConstructAbility s_readableStreamBYOBRequestRespondWithNewViewCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamBYOBRequestRespondWithNewViewCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestRespondWithNewViewCodeImplementationVisibility; -extern const char* const s_readableStreamBYOBRequestViewCode; -extern const int s_readableStreamBYOBRequestViewCodeLength; -extern const JSC::ConstructAbility s_readableStreamBYOBRequestViewCodeConstructAbility; -extern const JSC::ConstructorKind s_readableStreamBYOBRequestViewCodeConstructorKind; -extern const JSC::ImplementationVisibility s_readableStreamBYOBRequestViewCodeImplementationVisibility; - -#define WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_DATA(macro) \ - macro(initializeReadableStreamBYOBRequest, readableStreamBYOBRequestInitializeReadableStreamBYOBRequest, 2) \ - macro(respond, readableStreamBYOBRequestRespond, 1) \ - macro(respondWithNewView, readableStreamBYOBRequestRespondWithNewView, 1) \ - macro(view, readableStreamBYOBRequestView, 0) \ - -#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_INITIALIZEREADABLESTREAMBYOBREQUEST 1 -#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_RESPOND 1 -#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_RESPONDWITHNEWVIEW 1 -#define WEBCORE_BUILTIN_READABLESTREAMBYOBREQUEST_VIEW 1 - -#define WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(macro) \ - macro(readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCode, initializeReadableStreamBYOBRequest, ASCIILiteral(), s_readableStreamBYOBRequestInitializeReadableStreamBYOBRequestCodeLength) \ - macro(readableStreamBYOBRequestRespondCode, respond, ASCIILiteral(), s_readableStreamBYOBRequestRespondCodeLength) \ - macro(readableStreamBYOBRequestRespondWithNewViewCode, respondWithNewView, ASCIILiteral(), s_readableStreamBYOBRequestRespondWithNewViewCodeLength) \ - macro(readableStreamBYOBRequestViewCode, view, "get view"_s, s_readableStreamBYOBRequestViewCodeLength) \ - -#define WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(macro) \ - macro(initializeReadableStreamBYOBRequest) \ - macro(respond) \ - macro(respondWithNewView) \ - macro(view) \ - -#define DECLARE_BUILTIN_GENERATOR(codeName, functionName, overriddenName, argumentCount) \ - JSC::FunctionExecutable* codeName##Generator(JSC::VM&); - -WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DECLARE_BUILTIN_GENERATOR) -#undef DECLARE_BUILTIN_GENERATOR - -class ReadableStreamBYOBRequestBuiltinsWrapper : private JSC::WeakHandleOwner { -public: - explicit ReadableStreamBYOBRequestBuiltinsWrapper(JSC::VM& vm) - : m_vm(vm) - WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(INITIALIZE_BUILTIN_NAMES) -#define INITIALIZE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) , m_##name##Source(JSC::makeSource(StringImpl::createWithoutCopying(s_##name, length), { })) - WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(INITIALIZE_BUILTIN_SOURCE_MEMBERS) -#undef INITIALIZE_BUILTIN_SOURCE_MEMBERS - { - } - -#define EXPOSE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ - JSC::UnlinkedFunctionExecutable* name##Executable(); \ - const JSC::SourceCode& name##Source() const { return m_##name##Source; } - WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(EXPOSE_BUILTIN_EXECUTABLES) -#undef EXPOSE_BUILTIN_EXECUTABLES - - WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_IDENTIFIER_ACCESSOR) - - void exportNames(); - -private: - JSC::VM& m_vm; - - WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(DECLARE_BUILTIN_NAMES) - -#define DECLARE_BUILTIN_SOURCE_MEMBERS(name, functionName, overriddenName, length) \ - JSC::SourceCode m_##name##Source;\ - JSC::Weak m_##name##Executable; - WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DECLARE_BUILTIN_SOURCE_MEMBERS) -#undef DECLARE_BUILTIN_SOURCE_MEMBERS - -}; - -#define DEFINE_BUILTIN_EXECUTABLES(name, functionName, overriddenName, length) \ -inline JSC::UnlinkedFunctionExecutable* ReadableStreamBYOBRequestBuiltinsWrapper::name##Executable() \ -{\ - if (!m_##name##Executable) {\ - JSC::Identifier executableName = functionName##PublicName();\ - if (overriddenName)\ - executableName = JSC::Identifier::fromString(m_vm, overriddenName);\ - m_##name##Executable = JSC::Weak(JSC::createBuiltinExecutable(m_vm, m_##name##Source, executableName, s_##name##ImplementationVisibility, s_##name##ConstructorKind, s_##name##ConstructAbility), this, &m_##name##Executable);\ - }\ - return m_##name##Executable.get();\ -} -WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_CODE(DEFINE_BUILTIN_EXECUTABLES) -#undef DEFINE_BUILTIN_EXECUTABLES - -inline void ReadableStreamBYOBRequestBuiltinsWrapper::exportNames() -{ -#define EXPORT_FUNCTION_NAME(name) m_vm.propertyNames->appendExternalName(name##PublicName(), name##PrivateName()); - WEBCORE_FOREACH_READABLESTREAMBYOBREQUEST_BUILTIN_FUNCTION_NAME(EXPORT_FUNCTION_NAME) -#undef EXPORT_FUNCTION_NAME -} - -} // namespace WebCore -- cgit v1.2.3 ption> Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
AgeCommit message (Expand)AuthorFilesLines
2022-06-22WebSocket is a globalGravatar Jarred Sumner 23-266/+350
2022-06-22Fix most of the errorsGravatar Jarred Sumner 6-119/+117
2022-06-22more codeGravatar Jarred Sumner 4-58/+209
2022-06-22WIP WebSocketGravatar Jarred Sumner 19-22/+3701
2022-06-20Group zsh completion options by type (#194)Gravatar Alexander Kuznetsov 1-28/+16
2022-06-17Import most of `MessageEvent` from WebKitGravatar Jarred Sumner 18-12/+1410
2022-06-15some more testsGravatar Jarred Sumner 2-10/+62
2022-06-15Update WebKitGravatar Jarred Sumner 1-0/+0
2022-06-15[web standards] Add `CloseEvent` from WebKitGravatar Jarred Sumner 9-6/+636
2022-06-15Fix lazy loading internal streamsGravatar Jarred Sumner 13-360/+424
2022-06-15direct streams mostly workjarred/directGravatar Jarred Sumner 26-1167/+1782
2022-06-15wip direct streamsGravatar Jarred Sumner 24-398/+2276
2022-06-12ArrayBufferSink works and it's good.Gravatar Jarred Sumner 26-170/+2054
2022-06-12Fix build issueGravatar Jarred Sumner 2-0/+6
2022-06-12Delete broken submoduleGravatar Jarred Sumner 1-0/+0
2022-06-10Update Dockerfile.baseGravatar Jarred Sumner 1-1/+1
2022-06-10Update WebKitGravatar Jarred Sumner 1-0/+0
2022-06-10Update event_loop.zigGravatar Jarred Sumner 1-0/+1
2022-06-10Missing errno on linuxGravatar Jarred Sumner 1-3/+1
2022-06-10Update js_parser.zigGravatar Jarred Sumner 1-21/+200
2022-06-10Update MakefileGravatar Jarred Sumner 1-4/+4
2022-06-10wip fix linux buildGravatar Jarred Sumner 1-9/+11
2022-06-10Don't show generic crash info when given invalid bunfig.tomlGravatar Jarred Sumner 1-0/+4
2022-06-10Update logger.zigGravatar Jarred Sumner 1-0/+4
2022-06-10Show tracingGravatar Jarred Sumner 1-1/+1
2022-06-10Update bunfig.zigGravatar Jarred Sumner 1-0/+1
2022-06-10Update jest.zigGravatar Jarred Sumner 1-6/+9
2022-06-09Update bun.d.tsGravatar Jarred Sumner 1-2/+5
2022-06-09Add typesGravatar Jarred Sumner 1-2/+32
2022-06-09`new Response(stream).arrayBuffer()` + 3 moreGravatar Jarred Sumner 16-39/+478
2022-06-09fix some memory leaks with stringsGravatar Jarred Sumner 4-28/+45
2022-06-09Support console.log(myBigInt)Gravatar Jarred Sumner 1-1/+6
2022-06-09Fix defaultProps with JSX optimizationGravatar Jarred Sumner 6-34/+73
2022-06-09small perf improvements to encodingGravatar Jarred Sumner 1-43/+37
2022-06-07Update event_loop.zigGravatar Jarred Sumner 1-1/+2