/* * Copyright (C) 1999-2001 Harri Porten (porten@kde.org) * Copyright (C) 2003-2020 Apple Inc. All rights reserved. * Copyright (C) 2007 Samuel Weinig * Copyright (C) 2009 Google, Inc. All rights reserved. * Copyright (C) 2012 Ericsson AB. All rights reserved. * Copyright (C) 2013 Michael Pruett * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #pragma once #include "JSDOMCastThisValue.h" #include "JSDOMExceptionHandling.h" namespace WebCore { template class IDLOperation { public: using ClassParameter = JSClass*; using Operation = JSC::EncodedJSValue(JSC::JSGlobalObject*, JSC::CallFrame*, ClassParameter); using StaticOperation = JSC::EncodedJSValue(JSC::JSGlobalObject*, JSC::CallFrame*); // FIXME: Remove this after FunctionCallResolveNode is fixed not to pass resolved scope as |this| value. // https://bugs.webkit.org/show_bug.cgi?id=225397 static JSClass* cast(JSC::JSGlobalObject& lexicalGlobalObject, JSC::CallFrame& callFrame) { if constexpr (std::is_base_of_v) return castThisValue(lexicalGlobalObject, callFrame.thisValue().toThis(&lexicalGlobalObject, JSC::ECMAMode::strict())); else return castThisValue(lexicalGlobalObject, callFrame.thisValue()); } template static JSC::EncodedJSValue call(JSC::JSGlobalObject& lexicalGlobalObject, JSC::CallFrame& callFrame, const char* operationName) { auto throwScope = DECLARE_THROW_SCOPE(JSC::getVM(&lexicalGlobalObject)); auto* thisObject = cast(lexicalGlobalObject, callFrame); if constexpr (shouldThrow != CastedThisErrorBehavior::Assert) { if (UNLIKELY(!thisObject)) return throwThisTypeError(lexicalGlobalObject, throwScope, JSClass::info()->className, operationName); } else ASSERT(thisObject); ASSERT_GC_OBJECT_INHERITS(thisObject, JSClass::info()); // FIXME: We should refactor the binding generated code to use references for lexicalGlobalObject and thisObject. RELEASE_AND_RETURN(throwScope, (operation(&lexicalGlobalObject, &callFrame, thisObject))); } template static JSC::EncodedJSValue callStatic(JSC::JSGlobalObject& lexicalGlobalObject, JSC::CallFrame& callFrame, const char*) { // FIXME: We should refactor the binding generated code to use references for lexicalGlobalObject. return operation(&lexicalGlobalObject, &callFrame); } }; } // namespace WebCore d25519-tests Unnamed repository; edit this file 'description' to name the repository.
aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)AuthorFilesLines
2023-08-21Tweak helptextbun-jsonGravatar Colin McDonnell 1-2/+2
2023-08-21Add test for absolute pathsGravatar Colin McDonnell 2-0/+49
2023-08-21Clean upGravatar Colin McDonnell 2-10/+0
2023-08-21Clean upGravatar Colin McDonnell 1-15/+4
2023-08-21Remove commentGravatar Colin McDonnell 1-1/+0
2023-08-21Fix priority orderGravatar Colin McDonnell 1-6/+6
2023-08-21Add testsGravatar Colin McDonnell 2-2/+96
2023-08-21Support bun.jsonGravatar Colin McDonnell 5-42/+159
2023-08-21Fix typoGravatar Colin McDonnell 1-1/+1
2023-08-21Fix crypto.EC constructor (#4242)Gravatar dave caruso 2-3/+4
* Fix EC constructor * make js
2023-08-21Implement `napi_ref_threadsafe_function` (#4156)Gravatar dave caruso 10-7/+65
* Implement napi_ref_threadsafe_function * work on this * i hate event loops * little better * clean
2023-08-21feat: Implement Bun.inspect.custom (#4243)Gravatar dave caruso 6-8/+26
* add Bun.inspect.custom * test * Add Types
2023-08-21Fixes #4089 (#4105)Gravatar Jarred Sumner 3-36/+136
* Fixes #4089 * Update bindings.cpp * address PR feedback --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-2140x faster .toString('hex') (#4237)Gravatar Jarred Sumner 3-17/+105
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-21Fix memory leak in `buffer.toString("hex")` (#4235)Gravatar Jarred Sumner 2-1/+6
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-21Update README.md (#4232)Gravatar xxxhussein 1-1/+1
Fix typo in README.md
2023-08-21Add missing header changeGravatar Jarred Sumner 1-1/+1
2023-08-21Add LazyPropertyGravatar Jarred Sumner 1-0/+3
2023-08-21Fix BigIntStats generated classGravatar Jarred Sumner 1-1/+1
cc @paperdave, code generator script misses a constructor decl when this isn't true
2023-08-21RegenerateGravatar Jarred Sumner 1-8/+15
2023-08-21Implement FileGravatar Jarred Sumner 12-12/+387
2023-08-20Fixes #1675 (#4230)Gravatar Jarred Sumner 8-70/+297
* Fixes https://github.com/oven-sh/bun/issues/1675 * Add fallback for Bun.write * Update blob.zig * Fix test --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-20Implement `--inspect-brk` (#4222)Gravatar Jarred Sumner 17-41/+101
* Implement `--inspect-brk` * Bump WebKit --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-20Fix test failures from 3a9a6c63a (#4231)Gravatar Jarred Sumner 4-32/+34
cc @Hanaasagi Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-20Fix(bundler): use different alias mappings based on the target. (#4163)Gravatar Ai Hoshino 8-18/+90
* Fix(bundler): use different alias mappings based on the target. Close: #3844 * chore: reduce duplicated code. * chore: split to two separate ComptimeStringMap.
2023-08-19Update BunDebugger.cppGravatar Jarred Sumner 1-1/+3
2023-08-19Introduce `bun --inspect-wait`Gravatar Jarred Sumner 3-19/+47
This waits for the inspector to connect before beginning execution
2023-08-19misc non-posix fixesGravatar Jarred Sumner 2-3/+3
2023-08-19Update lockfile.mdGravatar Jarred Sumner 1-1/+8
2023-08-19Update lockfile.mdGravatar Jarred Sumner 1-4/+4
2023-08-19Update lockfile.mdGravatar Jarred Sumner 1-1/+29
2023-08-19Update Dockerfile-distroless (#4210)Gravatar Omar 1-0/+1
2023-08-19Fix symbol visibilityGravatar Jarred Sumner 1-0/+1
2023-08-19[napi] Implement `node_api_create_syntax_error`, `node_api_symbol_for`, ↵Gravatar Jarred Sumner 5-1/+70
`node_api_throw_syntax_error` These were marked as experimental
2023-08-19Fix crash impacting sharp & resvg (#4221)Gravatar Jarred Sumner 5-73/+73
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-19Fixes #172 (#4220)Gravatar Jarred Sumner 7-9/+87
Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-19Add inline sourcemaps when `--inspect` is enabled (#4213)Gravatar Jarred Sumner 3-3/+64
* Add inline sourcemaps when --inspect is enabled * Add some assertions * Update javascript.zig --------- Co-authored-by: Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com>
2023-08-19tty `ReadStream`, `WriteStream`, and readline rawmode (#4179)Gravatar Dylan Conway 23-722/+821
* tty `WriteStream`, `ReadStream`, and rawmode * tests * refactor prototypes * fix failing test * fix test and library usage * more merge * fix child_process test * create pseudo terminal for tty tests * match node logic * handle invalid tty * close descriptors * move tests to another process * fix test again * fix test on linux
2023-08-18Fix make headers (again)Gravatar Jarred Sumner 1-0/+2