From 699d8b1e1ce6714f4dd06fcdc623c74cbf9f94b1 Mon Sep 17 00:00:00 2001 From: SUZUKI Sosuke Date: Fri, 26 Dec 2025 07:00:58 +0900 Subject: [PATCH] Upgrade WebKit Dec 24, 2025 (#25684) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - WTFMove → WTF::move / std::move: Replaced WTFMove() macro with WTF::move() function for WTF types, std::move() for std types - SortedArrayMap removed: Replaced with if-else chains in EventFactory.cpp, JSCryptoKeyUsage.cpp - Wasm::Memory::create signature changed: Removed VM parameter - URLPattern allocation: Changed from WTF_MAKE_ISO_ALLOCATED to WTF_MAKE_TZONE_ALLOCATED --------- Co-authored-by: Claude Opus 4.5 Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com> --- cmake/tools/SetupWebKit.cmake | 2 +- src/bake/BakeGlobalObject.cpp | 4 +- src/bake/BakeSourceProvider.cpp | 8 +- src/bake/BakeSourceProvider.h | 4 +- src/bake/DevServerSourceProvider.h | 4 +- src/bun.js/bindings/BunCPUProfiler.cpp | 6 +- src/bun.js/bindings/BunClientData.cpp | 4 +- src/bun.js/bindings/BunClientData.h | 4 +- src/bun.js/bindings/BunDebugger.cpp | 6 +- src/bun.js/bindings/BunInjectedScriptHost.cpp | 2 +- src/bun.js/bindings/BunInspector.cpp | 6 +- src/bun.js/bindings/BunObject.cpp | 6 +- src/bun.js/bindings/BunPlugin.cpp | 2 +- src/bun.js/bindings/BunProcess.cpp | 2 +- src/bun.js/bindings/BunProcess.h | 4 +- src/bun.js/bindings/BunString.cpp | 12 +- src/bun.js/bindings/ConsoleObject.cpp | 6 +- src/bun.js/bindings/CookieMap.cpp | 14 +- src/bun.js/bindings/DOMFormData.cpp | 4 +- src/bun.js/bindings/DOMURL.cpp | 10 +- src/bun.js/bindings/ErrorStackTrace.h | 6 +- src/bun.js/bindings/EventLoopTask.h | 6 +- src/bun.js/bindings/EventLoopTaskNoContext.h | 2 +- src/bun.js/bindings/Exception.h | 4 +- src/bun.js/bindings/ExceptionOr.h | 14 +- src/bun.js/bindings/FormatStackTraceForJS.cpp | 2 +- .../InspectorBunFrontendDevServerAgent.cpp | 6 +- .../bindings/InspectorHTTPServerAgent.cpp | 16 +- .../bindings/InspectorLifecycleAgent.cpp | 4 +- .../bindings/InternalModuleRegistry.cpp | 2 +- src/bun.js/bindings/JSBuffer.cpp | 16 +- src/bun.js/bindings/JSBunRequest.cpp | 4 +- src/bun.js/bindings/JSBundlerPlugin.cpp | 4 +- src/bun.js/bindings/JSBundlerPlugin.h | 4 +- src/bun.js/bindings/JSCTaskScheduler.cpp | 10 +- src/bun.js/bindings/JSCommonJSModule.cpp | 8 +- .../bindings/JSDOMExceptionHandling.cpp | 2 +- src/bun.js/bindings/JSDOMExceptionHandling.h | 4 +- src/bun.js/bindings/JSDOMWrapper.h | 2 +- src/bun.js/bindings/JSDOMWrapperCache.h | 4 +- src/bun.js/bindings/JSFFIFunction.cpp | 8 +- src/bun.js/bindings/JSSecrets.cpp | 6 +- src/bun.js/bindings/JSStringDecoder.cpp | 2 +- src/bun.js/bindings/JSX509Certificate.cpp | 12 +- src/bun.js/bindings/ModuleLoader.cpp | 32 +-- src/bun.js/bindings/NodeDirent.cpp | 4 +- src/bun.js/bindings/NodeHTTP.cpp | 6 +- src/bun.js/bindings/NodeVM.cpp | 8 +- src/bun.js/bindings/NodeVMModule.cpp | 8 +- src/bun.js/bindings/NodeVMModule.h | 2 +- src/bun.js/bindings/NodeVMScript.cpp | 6 +- src/bun.js/bindings/NodeVMScript.h | 4 +- .../bindings/NodeVMSourceTextModule.cpp | 16 +- src/bun.js/bindings/NodeVMSourceTextModule.h | 4 +- src/bun.js/bindings/NodeVMSyntheticModule.cpp | 2 +- src/bun.js/bindings/NodeVMSyntheticModule.h | 4 +- .../bindings/ScriptExecutionContext.cpp | 14 +- src/bun.js/bindings/Serialization.cpp | 4 +- src/bun.js/bindings/ShellBindings.cpp | 2 +- src/bun.js/bindings/TextCodecCJK.cpp | 4 +- src/bun.js/bindings/TextEncodingRegistry.cpp | 2 +- src/bun.js/bindings/URLSearchParams.cpp | 4 +- src/bun.js/bindings/Uint8Array.cpp | 4 +- src/bun.js/bindings/ZigGlobalObject.cpp | 34 +-- src/bun.js/bindings/ZigSourceProvider.cpp | 6 +- src/bun.js/bindings/ZigSourceProvider.h | 2 +- src/bun.js/bindings/bindings.cpp | 58 ++--- src/bun.js/bindings/helpers.h | 4 +- src/bun.js/bindings/napi.cpp | 36 +-- src/bun.js/bindings/napi.h | 2 +- src/bun.js/bindings/ncrypto.cpp | 38 +-- src/bun.js/bindings/ncrypto.h | 6 +- .../bindings/node/crypto/CryptoDhJob.cpp | 6 +- src/bun.js/bindings/node/crypto/CryptoDhJob.h | 10 +- .../node/crypto/CryptoGenDhKeyPair.cpp | 10 +- .../bindings/node/crypto/CryptoGenDhKeyPair.h | 4 +- .../node/crypto/CryptoGenDsaKeyPair.cpp | 4 +- .../node/crypto/CryptoGenEcKeyPair.cpp | 4 +- .../bindings/node/crypto/CryptoGenKeyPair.cpp | 12 +- .../node/crypto/CryptoGenNidKeyPair.cpp | 4 +- .../node/crypto/CryptoGenRsaKeyPair.cpp | 6 +- .../bindings/node/crypto/CryptoHkdf.cpp | 28 +-- .../bindings/node/crypto/CryptoKeygen.cpp | 14 +- .../bindings/node/crypto/CryptoKeys.cpp | 14 +- .../bindings/node/crypto/CryptoPrimes.cpp | 22 +- .../bindings/node/crypto/CryptoSignJob.cpp | 24 +- .../bindings/node/crypto/CryptoSignJob.h | 10 +- .../bindings/node/crypto/CryptoUtil.cpp | 10 +- .../node/crypto/DiffieHellmanFunctions.h | 4 +- src/bun.js/bindings/node/crypto/JSCipher.cpp | 10 +- src/bun.js/bindings/node/crypto/JSCipher.h | 4 +- .../node/crypto/JSCipherConstructor.cpp | 2 +- .../node/crypto/JSCipherPrototype.cpp | 6 +- .../bindings/node/crypto/JSDiffieHellman.h | 4 +- .../crypto/JSDiffieHellmanConstructor.cpp | 4 +- .../node/crypto/JSDiffieHellmanGroup.h | 4 +- .../JSDiffieHellmanGroupConstructor.cpp | 2 +- src/bun.js/bindings/node/crypto/JSECDH.h | 4 +- .../node/crypto/JSECDHConstructor.cpp | 2 +- .../bindings/node/crypto/JSECDHPrototype.cpp | 2 +- src/bun.js/bindings/node/crypto/JSKeyObject.h | 4 +- .../bindings/node/crypto/JSPrivateKeyObject.h | 4 +- .../bindings/node/crypto/JSPublicKeyObject.h | 4 +- .../bindings/node/crypto/JSSecretKeyObject.h | 4 +- src/bun.js/bindings/node/crypto/JSSign.cpp | 10 +- src/bun.js/bindings/node/crypto/JSVerify.cpp | 12 +- src/bun.js/bindings/node/crypto/KeyObject.cpp | 60 ++--- src/bun.js/bindings/node/crypto/KeyObject.h | 2 +- .../bindings/node/crypto/KeyObjectData.h | 8 +- .../node/crypto/node_crypto_binding.cpp | 2 +- src/bun.js/bindings/webcore/AbortSignal.cpp | 8 +- .../bindings/webcore/ActiveDOMObject.cpp | 12 +- src/bun.js/bindings/webcore/ActiveDOMObject.h | 10 +- .../webcore/AddEventListenerOptions.h | 2 +- .../bindings/webcore/BroadcastChannel.cpp | 20 +- src/bun.js/bindings/webcore/BufferSource.h | 2 +- .../webcore/BunBroadcastChannelRegistry.cpp | 2 +- src/bun.js/bindings/webcore/CallbackResult.h | 4 +- src/bun.js/bindings/webcore/DOMPromiseProxy.h | 8 +- src/bun.js/bindings/webcore/ErrorCallback.cpp | 2 +- src/bun.js/bindings/webcore/Event.cpp | 2 +- src/bun.js/bindings/webcore/EventContext.h | 2 +- src/bun.js/bindings/webcore/EventEmitter.cpp | 2 +- src/bun.js/bindings/webcore/EventFactory.cpp | 174 ++++++------- src/bun.js/bindings/webcore/EventInit.h | 2 +- .../bindings/webcore/EventListenerMap.cpp | 6 +- src/bun.js/bindings/webcore/FetchHeaders.cpp | 8 +- src/bun.js/bindings/webcore/FetchHeaders.h | 6 +- .../bindings/webcore/HTTPHeaderField.cpp | 6 +- src/bun.js/bindings/webcore/HTTPHeaderField.h | 6 +- src/bun.js/bindings/webcore/HTTPHeaderMap.cpp | 6 +- src/bun.js/bindings/webcore/HTTPHeaderMap.h | 10 +- src/bun.js/bindings/webcore/HTTPParsers.h | 2 +- .../webcore/IdentifierEventListenerMap.cpp | 10 +- .../webcore/IdentifierEventListenerMap.h | 4 +- .../bindings/webcore/JSAbortController.cpp | 8 +- .../bindings/webcore/JSAbortController.h | 2 +- src/bun.js/bindings/webcore/JSAbortSignal.cpp | 10 +- src/bun.js/bindings/webcore/JSAbortSignal.h | 2 +- .../bindings/webcore/JSBroadcastChannel.cpp | 10 +- .../bindings/webcore/JSBroadcastChannel.h | 2 +- src/bun.js/bindings/webcore/JSCloseEvent.cpp | 8 +- src/bun.js/bindings/webcore/JSCloseEvent.h | 2 +- src/bun.js/bindings/webcore/JSCookie.cpp | 16 +- src/bun.js/bindings/webcore/JSCookie.h | 2 +- src/bun.js/bindings/webcore/JSCookieMap.cpp | 16 +- src/bun.js/bindings/webcore/JSCookieMap.h | 2 +- src/bun.js/bindings/webcore/JSCustomEvent.cpp | 10 +- src/bun.js/bindings/webcore/JSCustomEvent.h | 2 +- .../bindings/webcore/JSDOMConvertRecord.h | 8 +- .../webcore/JSDOMConvertScheduledAction.h | 2 +- .../bindings/webcore/JSDOMConvertSequences.h | 34 +-- .../bindings/webcore/JSDOMConvertStrings.cpp | 2 +- .../bindings/webcore/JSDOMConvertUnion.h | 10 +- .../bindings/webcore/JSDOMConvertVariadic.h | 2 +- .../bindings/webcore/JSDOMException.cpp | 8 +- src/bun.js/bindings/webcore/JSDOMException.h | 2 +- src/bun.js/bindings/webcore/JSDOMFormData.cpp | 18 +- src/bun.js/bindings/webcore/JSDOMFormData.h | 2 +- .../webcore/JSDOMOperationReturningPromise.h | 4 +- src/bun.js/bindings/webcore/JSDOMPromise.cpp | 4 +- .../bindings/webcore/JSDOMPromiseDeferred.cpp | 12 +- .../bindings/webcore/JSDOMPromiseDeferred.h | 10 +- src/bun.js/bindings/webcore/JSDOMURL.cpp | 34 +-- src/bun.js/bindings/webcore/JSDOMURL.h | 2 +- src/bun.js/bindings/webcore/JSErrorEvent.cpp | 8 +- src/bun.js/bindings/webcore/JSErrorEvent.h | 2 +- src/bun.js/bindings/webcore/JSEvent.cpp | 12 +- src/bun.js/bindings/webcore/JSEvent.h | 2 +- .../bindings/webcore/JSEventEmitter.cpp | 20 +- src/bun.js/bindings/webcore/JSEventEmitter.h | 2 +- .../bindings/webcore/JSEventEmitterCustom.cpp | 4 +- src/bun.js/bindings/webcore/JSEventTarget.cpp | 10 +- src/bun.js/bindings/webcore/JSEventTarget.h | 2 +- .../bindings/webcore/JSEventTargetCustom.cpp | 2 +- .../bindings/webcore/JSFetchHeaders.cpp | 14 +- src/bun.js/bindings/webcore/JSFetchHeaders.h | 2 +- src/bun.js/bindings/webcore/JSMIMEType.cpp | 10 +- src/bun.js/bindings/webcore/JSMIMEType.h | 4 +- .../bindings/webcore/JSMessageChannel.cpp | 6 +- .../bindings/webcore/JSMessageChannel.h | 2 +- .../bindings/webcore/JSMessageEvent.cpp | 10 +- src/bun.js/bindings/webcore/JSMessageEvent.h | 2 +- src/bun.js/bindings/webcore/JSMessagePort.cpp | 8 +- src/bun.js/bindings/webcore/JSMessagePort.h | 2 +- src/bun.js/bindings/webcore/JSPerformance.cpp | 18 +- src/bun.js/bindings/webcore/JSPerformance.h | 2 +- .../bindings/webcore/JSPerformanceEntry.cpp | 2 +- .../bindings/webcore/JSPerformanceEntry.h | 2 +- .../webcore/JSPerformanceEntryCustom.cpp | 12 +- .../bindings/webcore/JSPerformanceMark.cpp | 8 +- .../bindings/webcore/JSPerformanceMark.h | 2 +- .../bindings/webcore/JSPerformanceMeasure.cpp | 2 +- .../bindings/webcore/JSPerformanceMeasure.h | 2 +- .../webcore/JSPerformanceObserver.cpp | 8 +- .../bindings/webcore/JSPerformanceObserver.h | 2 +- .../JSPerformanceObserverEntryList.cpp | 8 +- .../webcore/JSPerformanceObserverEntryList.h | 2 +- .../webcore/JSPerformanceResourceTiming.cpp | 2 +- .../webcore/JSPerformanceResourceTiming.h | 2 +- .../webcore/JSPerformanceServerTiming.cpp | 4 +- .../webcore/JSPerformanceServerTiming.h | 2 +- .../bindings/webcore/JSPerformanceTiming.cpp | 4 +- .../bindings/webcore/JSPerformanceTiming.h | 2 +- .../bindings/webcore/JSReadableStreamSink.cpp | 8 +- .../bindings/webcore/JSReadableStreamSink.h | 2 +- .../webcore/JSReadableStreamSource.cpp | 10 +- .../bindings/webcore/JSReadableStreamSource.h | 2 +- .../webcore/JSReadableStreamSourceCustom.cpp | 4 +- src/bun.js/bindings/webcore/JSTextEncoder.cpp | 6 +- src/bun.js/bindings/webcore/JSTextEncoder.h | 2 +- src/bun.js/bindings/webcore/JSURLPattern.cpp | 22 +- src/bun.js/bindings/webcore/JSURLPattern.h | 2 +- .../bindings/webcore/JSURLSearchParams.cpp | 16 +- .../bindings/webcore/JSURLSearchParams.h | 2 +- .../bindings/webcore/JSValueInWrappedObject.h | 2 +- .../webcore/JSWasmStreamingCompiler.cpp | 4 +- .../webcore/JSWasmStreamingCompiler.h | 2 +- src/bun.js/bindings/webcore/JSWebSocket.cpp | 26 +- src/bun.js/bindings/webcore/JSWebSocket.h | 2 +- src/bun.js/bindings/webcore/JSWorker.cpp | 26 +- src/bun.js/bindings/webcore/JSWorker.h | 2 +- .../bindings/webcore/JSWritableStream.cpp | 8 +- .../bindings/webcore/JSWritableStream.h | 2 +- .../bindings/webcore/JSWritableStreamSink.cpp | 8 +- .../bindings/webcore/JSWritableStreamSink.h | 2 +- src/bun.js/bindings/webcore/MessageEvent.cpp | 26 +- src/bun.js/bindings/webcore/MessagePort.cpp | 30 +-- .../bindings/webcore/MessagePortChannel.cpp | 8 +- .../MessagePortChannelProviderImpl.cpp | 8 +- .../webcore/MessagePortChannelRegistry.cpp | 4 +- .../bindings/webcore/NetworkLoadMetrics.cpp | 34 +-- src/bun.js/bindings/webcore/Performance.cpp | 14 +- .../bindings/webcore/PerformanceMark.cpp | 2 +- .../bindings/webcore/PerformanceMeasure.cpp | 4 +- .../bindings/webcore/PerformanceObserver.cpp | 4 +- .../bindings/webcore/PerformanceObserver.h | 2 +- .../webcore/PerformanceObserverEntryList.cpp | 4 +- .../webcore/PerformanceResourceTiming.cpp | 4 +- .../webcore/PerformanceServerTiming.cpp | 6 +- .../webcore/PerformanceUserTiming.cpp | 6 +- .../ReadableStreamDefaultController.cpp | 2 +- .../bindings/webcore/ReadableStreamSink.cpp | 6 +- .../bindings/webcore/ReadableStreamSink.h | 2 +- .../bindings/webcore/ReadableStreamSource.cpp | 6 +- .../webcore/RegisteredEventListener.h | 4 +- .../bindings/webcore/ResourceTiming.cpp | 10 +- src/bun.js/bindings/webcore/ResourceTiming.h | 8 +- .../webcore/SerializedScriptValue.cpp | 234 +++++++++--------- .../bindings/webcore/SerializedScriptValue.h | 18 +- src/bun.js/bindings/webcore/ServerTiming.cpp | 2 +- src/bun.js/bindings/webcore/ServerTiming.h | 10 +- .../bindings/webcore/ServerTimingParser.cpp | 4 +- .../bindings/webcore/StructuredClone.cpp | 14 +- .../webcore/StructuredSerializeOptions.h | 2 +- src/bun.js/bindings/webcore/URLPattern.cpp | 39 ++- src/bun.js/bindings/webcore/URLPattern.h | 2 +- .../bindings/webcore/URLPatternComponent.cpp | 12 +- .../URLPatternConstructorStringParser.cpp | 18 +- .../bindings/webcore/URLPatternParser.cpp | 20 +- .../bindings/webcore/URLPatternParser.h | 2 +- .../bindings/webcore/URLPatternTokenizer.cpp | 2 +- src/bun.js/bindings/webcore/WebSocket.cpp | 38 +-- src/bun.js/bindings/webcore/Worker.cpp | 40 +-- .../bindings/webcore/WritableStream.cpp | 6 +- .../bindings/webcore/WritableStreamSink.h | 4 +- .../bindings/webcrypto/CryptoAlgorithm.cpp | 8 +- .../webcrypto/CryptoAlgorithmAES_CBC.cpp | 18 +- .../CryptoAlgorithmAES_CBCOpenSSL.cpp | 4 +- .../webcrypto/CryptoAlgorithmAES_CFB.cpp | 18 +- .../CryptoAlgorithmAES_CFBOpenSSL.cpp | 4 +- .../webcrypto/CryptoAlgorithmAES_CTR.cpp | 18 +- .../CryptoAlgorithmAES_CTROpenSSL.cpp | 4 +- .../webcrypto/CryptoAlgorithmAES_GCM.cpp | 18 +- .../CryptoAlgorithmAES_GCMOpenSSL.cpp | 4 +- .../webcrypto/CryptoAlgorithmAES_KW.cpp | 14 +- .../CryptoAlgorithmAES_KWOpenSSL.cpp | 4 +- .../webcrypto/CryptoAlgorithmAesGcmParams.h | 2 +- .../webcrypto/CryptoAlgorithmECDH.cpp | 26 +- .../webcrypto/CryptoAlgorithmECDSA.cpp | 22 +- .../webcrypto/CryptoAlgorithmEd25519.cpp | 22 +- .../webcrypto/CryptoAlgorithmHKDF.cpp | 6 +- .../webcrypto/CryptoAlgorithmHMAC.cpp | 18 +- .../webcrypto/CryptoAlgorithmHMACOpenSSL.cpp | 4 +- .../webcrypto/CryptoAlgorithmPBKDF2.cpp | 6 +- .../CryptoAlgorithmRSAES_PKCS1_v1_5.cpp | 28 +-- .../CryptoAlgorithmRSASSA_PKCS1_v1_5.cpp | 28 +-- .../webcrypto/CryptoAlgorithmRSA_OAEP.cpp | 28 +-- .../webcrypto/CryptoAlgorithmRSA_PSS.cpp | 28 +-- .../webcrypto/CryptoAlgorithmRsaOaepParams.h | 2 +- .../webcrypto/CryptoAlgorithmSHA1.cpp | 8 +- .../webcrypto/CryptoAlgorithmSHA224.cpp | 8 +- .../webcrypto/CryptoAlgorithmSHA256.cpp | 8 +- .../webcrypto/CryptoAlgorithmSHA384.cpp | 8 +- .../webcrypto/CryptoAlgorithmSHA512.cpp | 8 +- .../webcrypto/CryptoAlgorithmX25519.cpp | 26 +- .../bindings/webcrypto/CryptoKeyAES.cpp | 6 +- src/bun.js/bindings/webcrypto/CryptoKeyEC.cpp | 20 +- src/bun.js/bindings/webcrypto/CryptoKeyEC.h | 2 +- .../bindings/webcrypto/CryptoKeyECOpenSSL.cpp | 16 +- .../bindings/webcrypto/CryptoKeyHMAC.cpp | 6 +- .../bindings/webcrypto/CryptoKeyOKP.cpp | 20 +- .../webcrypto/CryptoKeyOKPOpenSSL.cpp | 8 +- .../bindings/webcrypto/CryptoKeyRSA.cpp | 30 +-- src/bun.js/bindings/webcrypto/CryptoKeyRSA.h | 2 +- .../webcrypto/CryptoKeyRSAComponents.cpp | 22 +- .../webcrypto/CryptoKeyRSAComponents.h | 6 +- .../webcrypto/CryptoKeyRSAOpenSSL.cpp | 16 +- .../bindings/webcrypto/CryptoKeyRaw.cpp | 2 +- src/bun.js/bindings/webcrypto/CryptoKeyRaw.h | 2 +- src/bun.js/bindings/webcrypto/JSCryptoKey.cpp | 8 +- src/bun.js/bindings/webcrypto/JSCryptoKey.h | 2 +- .../bindings/webcrypto/JSCryptoKeyUsage.cpp | 4 +- .../bindings/webcrypto/JSSubtleCrypto.cpp | 32 +-- .../bindings/webcrypto/JSSubtleCrypto.h | 2 +- .../bindings/webcrypto/PhonyWorkQueue.cpp | 2 +- .../bindings/webcrypto/SubtleCrypto.cpp | 100 ++++---- src/bun.js/modules/BunJSCModule.h | 10 +- src/codegen/bindgen.ts | 6 +- src/codegen/generate-classes.ts | 12 +- src/vm/SigintWatcher.h | 4 +- 321 files changed, 1623 insertions(+), 1624 deletions(-) diff --git a/cmake/tools/SetupWebKit.cmake b/cmake/tools/SetupWebKit.cmake index 6ff1af55d8..85bac91e7b 100644 --- a/cmake/tools/SetupWebKit.cmake +++ b/cmake/tools/SetupWebKit.cmake @@ -2,7 +2,7 @@ option(WEBKIT_VERSION "The version of WebKit to use") option(WEBKIT_LOCAL "If a local version of WebKit should be used instead of downloading") if(NOT WEBKIT_VERSION) - set(WEBKIT_VERSION 8400ec68b2649d7b95f10576ad648c3aa8a92b77) + set(WEBKIT_VERSION 2317e1413969bff5e86d240f9f50aa2120776414) endif() string(SUBSTRING ${WEBKIT_VERSION} 0 16 WEBKIT_VERSION_PREFIX) diff --git a/src/bake/BakeGlobalObject.cpp b/src/bake/BakeGlobalObject.cpp index f7ca1b4231..b5c25eecac 100644 --- a/src/bake/BakeGlobalObject.cpp +++ b/src/bake/BakeGlobalObject.cpp @@ -141,10 +141,10 @@ JSC::JSInternalPromise* bakeModuleLoaderFetch(JSC::JSGlobalObject* globalObject, globalObject, source.toWTFString(), origin, - WTFMove(moduleKey), + WTF::move(moduleKey), WTF::TextPosition(), JSC::SourceProviderSourceType::Module)); - return resolvedInternalPromise(globalObject, JSC::JSSourceCode::create(vm, WTFMove(sourceCode))); + return resolvedInternalPromise(globalObject, JSC::JSSourceCode::create(vm, WTF::move(sourceCode))); } // We unconditionally prefix the key with "bake:" inside diff --git a/src/bake/BakeSourceProvider.cpp b/src/bake/BakeSourceProvider.cpp index 8efa3d8d34..24353dcb7b 100644 --- a/src/bake/BakeSourceProvider.cpp +++ b/src/bake/BakeSourceProvider.cpp @@ -33,7 +33,7 @@ extern "C" JSC::EncodedJSValue BakeLoadInitialServerCode(JSC::JSGlobalObject* gl global, source.toWTFString(), origin, - WTFMove(string), + WTF::move(string), WTF::TextPosition(), JSC::SourceProviderSourceType::Program )); @@ -67,7 +67,7 @@ extern "C" JSC::EncodedJSValue BakeLoadServerHmrPatch(GlobalObject* global, BunS global, source.toWTFString(), origin, - WTFMove(string), + WTF::move(string), WTF::TextPosition(), JSC::SourceProviderSourceType::Program )); @@ -93,7 +93,7 @@ extern "C" JSC::EncodedJSValue BakeLoadServerHmrPatchWithSourceMap(GlobalObject* sourceMapJSONPtr, sourceMapJSONLength, origin, - WTFMove(string), + WTF::move(string), WTF::TextPosition(), JSC::SourceProviderSourceType::Program ); @@ -159,7 +159,7 @@ extern "C" JSC::EncodedJSValue BakeRegisterProductionChunk(JSC::JSGlobalObject* global, source.toWTFString(), origin, - WTFMove(string), + WTF::move(string), WTF::TextPosition(), JSC::SourceProviderSourceType::Module )); diff --git a/src/bake/BakeSourceProvider.h b/src/bake/BakeSourceProvider.h index 7055fcedbe..2b6ffe495d 100644 --- a/src/bake/BakeSourceProvider.h +++ b/src/bake/BakeSourceProvider.h @@ -20,7 +20,7 @@ public: const TextPosition& startPosition, JSC::SourceProviderSourceType sourceType) { - auto provider = adoptRef(*new SourceProvider(source, sourceOrigin, WTFMove(sourceURL), startPosition, sourceType)); + auto provider = adoptRef(*new SourceProvider(source, sourceOrigin, WTF::move(sourceURL), startPosition, sourceType)); auto* zigGlobalObject = jsCast(globalObject); auto specifier = Bun::toString(provider->sourceURL()); Bun__addBakeSourceProviderSourceMap(zigGlobalObject->bunVM(), provider.ptr(), &specifier); @@ -38,7 +38,7 @@ private: source, sourceOrigin, JSC::SourceTaintedOrigin::Untainted, - WTFMove(sourceURL), + WTF::move(sourceURL), startPosition, sourceType) { diff --git a/src/bake/DevServerSourceProvider.h b/src/bake/DevServerSourceProvider.h index 7667b6f811..d18087dd14 100644 --- a/src/bake/DevServerSourceProvider.h +++ b/src/bake/DevServerSourceProvider.h @@ -25,7 +25,7 @@ public: const TextPosition& startPosition, JSC::SourceProviderSourceType sourceType) { - auto provider = adoptRef(*new DevServerSourceProvider(source, sourceMapJSONPtr, sourceMapJSONLength, sourceOrigin, WTFMove(sourceURL), startPosition, sourceType)); + auto provider = adoptRef(*new DevServerSourceProvider(source, sourceMapJSONPtr, sourceMapJSONLength, sourceOrigin, WTF::move(sourceURL), startPosition, sourceType)); auto* zigGlobalObject = jsCast<::Zig::GlobalObject*>(globalObject); auto specifier = Bun::toString(provider->sourceURL()); provider->m_globalObject = zigGlobalObject; @@ -52,7 +52,7 @@ private: source, sourceOrigin, JSC::SourceTaintedOrigin::Untainted, - WTFMove(sourceURL), + WTF::move(sourceURL), startPosition, sourceType) , m_sourceMapJSON(sourceMapJSONPtr, sourceMapJSONLength) diff --git a/src/bun.js/bindings/BunCPUProfiler.cpp b/src/bun.js/bindings/BunCPUProfiler.cpp index e31dccaae6..6fa40d2881 100644 --- a/src/bun.js/bindings/BunCPUProfiler.cpp +++ b/src/bun.js/bindings/BunCPUProfiler.cpp @@ -34,7 +34,7 @@ void startCPUProfiler(JSC::VM& vm) auto stopwatch = WTF::Stopwatch::create(); stopwatch->start(); - JSC::SamplingProfiler& samplingProfiler = vm.ensureSamplingProfiler(WTFMove(stopwatch)); + JSC::SamplingProfiler& samplingProfiler = vm.ensureSamplingProfiler(WTF::move(stopwatch)); // Set sampling interval to 1ms (1000 microseconds) to match Node.js samplingProfiler.setTimingInterval(WTF::Seconds::fromMicroseconds(1000)); @@ -92,7 +92,7 @@ WTF::String stopCPUProfilerAndGetJSON(JSC::VM& vm) rootNode.lineNumber = -1; rootNode.columnNumber = -1; rootNode.hitCount = 0; - nodes.append(WTFMove(rootNode)); + nodes.append(WTF::move(rootNode)); int nextNodeId = 2; WTF::Vector samples; @@ -229,7 +229,7 @@ WTF::String stopCPUProfilerAndGetJSON(JSC::VM& vm) node.columnNumber = columnNumber; node.hitCount = 0; - nodes.append(WTFMove(node)); + nodes.append(WTF::move(node)); // Add this node as child of parent if (currentParentId > 0) { diff --git a/src/bun.js/bindings/BunClientData.cpp b/src/bun.js/bindings/BunClientData.cpp index 37ebf65dde..aa1285153b 100644 --- a/src/bun.js/bindings/BunClientData.cpp +++ b/src/bun.js/bindings/BunClientData.cpp @@ -85,10 +85,10 @@ void JSVMClientData::create(VM* vm, void* bunVM) JSVMClientData* clientData = new JSVMClientData(*vm, provider); clientData->bunVM = bunVM; vm->deferredWorkTimer->onAddPendingWork = [clientData](Ref&& ticket, JSC::DeferredWorkTimer::WorkType kind) -> void { - Bun::JSCTaskScheduler::onAddPendingWork(clientData, WTFMove(ticket), kind); + Bun::JSCTaskScheduler::onAddPendingWork(clientData, WTF::move(ticket), kind); }; vm->deferredWorkTimer->onScheduleWorkSoon = [clientData](JSC::DeferredWorkTimer::Ticket ticket, JSC::DeferredWorkTimer::Task&& task) -> void { - Bun::JSCTaskScheduler::onScheduleWorkSoon(clientData, ticket, WTFMove(task)); + Bun::JSCTaskScheduler::onScheduleWorkSoon(clientData, ticket, WTF::move(task)); }; vm->deferredWorkTimer->onCancelPendingWork = [clientData](JSC::DeferredWorkTimer::Ticket ticket) -> void { Bun::JSCTaskScheduler::onCancelPendingWork(clientData, ticket); diff --git a/src/bun.js/bindings/BunClientData.h b/src/bun.js/bindings/BunClientData.h index 07ba0cfc95..d0ba38b19d 100644 --- a/src/bun.js/bindings/BunClientData.h +++ b/src/bun.js/bindings/BunClientData.h @@ -170,7 +170,7 @@ ALWAYS_INLINE JSC::GCClient::IsoSubspace* subspaceForImpl(JSC::VM& vm, GetClient uniqueSubspace = makeUnique ISO_SUBSPACE_INIT(heap, heap.cellHeapCellType, T); } space = uniqueSubspace.get(); - setServer(subspaces, WTFMove(uniqueSubspace)); + setServer(subspaces, WTF::move(uniqueSubspace)); IGNORE_WARNINGS_BEGIN("unreachable-code") IGNORE_WARNINGS_BEGIN("tautological-compare") @@ -184,7 +184,7 @@ ALWAYS_INLINE JSC::GCClient::IsoSubspace* subspaceForImpl(JSC::VM& vm, GetClient auto uniqueClientSubspace = makeUnique(*space); auto* clientSpace = uniqueClientSubspace.get(); - setClient(clientSubspaces, WTFMove(uniqueClientSubspace)); + setClient(clientSubspaces, WTF::move(uniqueClientSubspace)); return clientSpace; } diff --git a/src/bun.js/bindings/BunDebugger.cpp b/src/bun.js/bindings/BunDebugger.cpp index 00ee9499e9..25573fb197 100644 --- a/src/bun.js/bindings/BunDebugger.cpp +++ b/src/bun.js/bindings/BunDebugger.cpp @@ -280,7 +280,7 @@ public: } for (auto message : messages) { - dispatcher.dispatchMessageFromRemote(WTFMove(message)); + dispatcher.dispatchMessageFromRemote(WTF::move(message)); if (!debugger) { debugger = reinterpret_cast(globalObject->debugger()); @@ -293,7 +293,7 @@ public: } } else { for (auto message : messages) { - dispatcher.dispatchMessageFromRemote(WTFMove(message)); + dispatcher.dispatchMessageFromRemote(WTF::move(message)); } } @@ -461,7 +461,7 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionSend, (JSC::JSGlobalObject * globalObject, JS messages.append(value.toWTFString(globalObject).isolatedCopy()); return true; }); - jsConnection->connection()->sendMessageToInspectorFromDebuggerThread(WTFMove(messages)); + jsConnection->connection()->sendMessageToInspectorFromDebuggerThread(WTF::move(messages)); } return JSValue::encode(jsUndefined()); diff --git a/src/bun.js/bindings/BunInjectedScriptHost.cpp b/src/bun.js/bindings/BunInjectedScriptHost.cpp index 7141083305..0402d3ec87 100644 --- a/src/bun.js/bindings/BunInjectedScriptHost.cpp +++ b/src/bun.js/bindings/BunInjectedScriptHost.cpp @@ -130,7 +130,7 @@ JSValue BunInjectedScriptHost::getInternalProperties(VM& vm, JSGlobalObject* exe String name = worker->name(); if (!name.isEmpty()) - array->putDirectIndex(exec, index++, constructInternalProperty(vm, exec, "name"_s, jsString(vm, WTFMove(name)))); + array->putDirectIndex(exec, index++, constructInternalProperty(vm, exec, "name"_s, jsString(vm, WTF::move(name)))); array->putDirectIndex(exec, index++, constructInternalProperty(vm, exec, "terminated"_s, jsBoolean(worker->wasTerminated()))); diff --git a/src/bun.js/bindings/BunInspector.cpp b/src/bun.js/bindings/BunInspector.cpp index ef7a9a251d..cbabe4f91e 100644 --- a/src/bun.js/bindings/BunInspector.cpp +++ b/src/bun.js/bindings/BunInspector.cpp @@ -74,7 +74,7 @@ public: Bun__tickWhilePaused(&done); }; } - this->globalObject->inspectorDebuggable().dispatchMessageFromRemote(WTFMove(messageString)); + this->globalObject->inspectorDebuggable().dispatchMessageFromRemote(WTF::move(messageString)); } void drain() @@ -138,7 +138,7 @@ static void addInspector(void* app, JSC::JSGlobalObject* globalObject) delete inspector; } }; - ((uWS::SSLApp*)app)->ws("/bun:inspect", std::move(handler)); + ((uWS::SSLApp*)app)->ws("/bun:inspect", WTF::move(handler)); } else { auto handler = uWS::App::WebSocketBehavior { @@ -174,7 +174,7 @@ static void addInspector(void* app, JSC::JSGlobalObject* globalObject) delete inspector; } }; - ((uWS::App*)app)->ws("/bun:inspect", std::move(handler)); + ((uWS::App*)app)->ws("/bun:inspect", WTF::move(handler)); } } diff --git a/src/bun.js/bindings/BunObject.cpp b/src/bun.js/bindings/BunObject.cpp index 3f83574572..6296b0599f 100644 --- a/src/bun.js/bindings/BunObject.cpp +++ b/src/bun.js/bindings/BunObject.cpp @@ -232,12 +232,12 @@ static inline JSC::EncodedJSValue flattenArrayOfBuffersIntoArrayBufferOrUint8Arr } if (asUint8Array) { - auto uint8array = JSC::JSUint8Array::create(lexicalGlobalObject, lexicalGlobalObject->m_typedArrayUint8.get(lexicalGlobalObject), WTFMove(buffer), 0, byteLength); + auto uint8array = JSC::JSUint8Array::create(lexicalGlobalObject, lexicalGlobalObject->m_typedArrayUint8.get(lexicalGlobalObject), WTF::move(buffer), 0, byteLength); RETURN_IF_EXCEPTION(throwScope, {}); return JSValue::encode(uint8array); } - RELEASE_AND_RETURN(throwScope, JSValue::encode(JSC::JSArrayBuffer::create(vm, lexicalGlobalObject->arrayBufferStructure(), WTFMove(buffer)))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(JSC::JSArrayBuffer::create(vm, lexicalGlobalObject->arrayBufferStructure(), WTF::move(buffer)))); } JSC_DEFINE_HOST_FUNCTION(functionConcatTypedArrays, (JSGlobalObject * globalObject, JSC::CallFrame* callFrame)) @@ -585,7 +585,7 @@ JSC_DEFINE_HOST_FUNCTION(functionPathToFileURL, (JSC::JSGlobalObject * lexicalGl auto fileURL = WTF::URL::fileURLWithFileSystemPath(pathString); auto object = WebCore::DOMURL::create(fileURL.string(), String()); - jsValue = WebCore::toJSNewlyCreated>(*lexicalGlobalObject, globalObject, throwScope, WTFMove(object)); + jsValue = WebCore::toJSNewlyCreated>(*lexicalGlobalObject, globalObject, throwScope, WTF::move(object)); } auto* jsDOMURL = jsCast(jsValue.asCell()); diff --git a/src/bun.js/bindings/BunPlugin.cpp b/src/bun.js/bindings/BunPlugin.cpp index 94bc835023..590037d1a5 100644 --- a/src/bun.js/bindings/BunPlugin.cpp +++ b/src/bun.js/bindings/BunPlugin.cpp @@ -371,7 +371,7 @@ void BunPlugin::Base::append(JSC::VM& vm, JSC::RegExp* filter, JSC::JSObject* fu } else { Group newGroup; newGroup.append(vm, filter, func); - this->groups.append(WTFMove(newGroup)); + this->groups.append(WTF::move(newGroup)); this->namespaces.append(namespaceString); } } diff --git a/src/bun.js/bindings/BunProcess.cpp b/src/bun.js/bindings/BunProcess.cpp index 0c427be8f0..f0e77d579c 100644 --- a/src/bun.js/bindings/BunProcess.cpp +++ b/src/bun.js/bindings/BunProcess.cpp @@ -3740,7 +3740,7 @@ JSC_DEFINE_CUSTOM_GETTER(processTitle, (JSC::JSGlobalObject * globalObject, JSC: BunString str; Bun__Process__getTitle(globalObject, &str); auto value = str.transferToWTFString(); - auto* result = jsString(globalObject->vm(), WTFMove(value)); + auto* result = jsString(globalObject->vm(), WTF::move(value)); RETURN_IF_EXCEPTION(scope, {}); RELEASE_AND_RETURN(scope, JSValue::encode(result)); #else diff --git a/src/bun.js/bindings/BunProcess.h b/src/bun.js/bindings/BunProcess.h index 807b4c0c10..02b049ebf1 100644 --- a/src/bun.js/bindings/BunProcess.h +++ b/src/bun.js/bindings/BunProcess.h @@ -35,7 +35,7 @@ class Process : public WebCore::JSEventEmitter { public: Process(JSC::Structure* structure, WebCore::JSDOMGlobalObject& globalObject, Ref&& impl) - : Base(structure, globalObject, WTFMove(impl)) + : Base(structure, globalObject, WTF::move(impl)) { } @@ -88,7 +88,7 @@ public: static Process* create(WebCore::JSDOMGlobalObject& globalObject, JSC::Structure* structure) { auto emitter = WebCore::EventEmitter::create(*globalObject.scriptExecutionContext()); - Process* accessor = new (NotNull, JSC::allocateCell(globalObject.vm())) Process(structure, globalObject, WTFMove(emitter)); + Process* accessor = new (NotNull, JSC::allocateCell(globalObject.vm())) Process(structure, globalObject, WTF::move(emitter)); accessor->finishCreation(globalObject.vm()); return accessor; } diff --git a/src/bun.js/bindings/BunString.cpp b/src/bun.js/bindings/BunString.cpp index 6c90ec612e..fddb5c8cbe 100644 --- a/src/bun.js/bindings/BunString.cpp +++ b/src/bun.js/bindings/BunString.cpp @@ -102,7 +102,7 @@ extern "C" [[ZIG_EXPORT(zero_is_throw)]] JSC::EncodedJSValue BunString__createUT return {}; } scope.assertNoException(); - return JSValue::encode(jsString(vm, WTFMove(str))); + return JSValue::encode(jsString(vm, WTF::move(str))); } extern "C" JSC::EncodedJSValue BunString__transferToJS(BunString* bunString, JSC::JSGlobalObject* globalObject) @@ -125,12 +125,12 @@ extern "C" JSC::EncodedJSValue BunString__transferToJS(BunString* bunString, JSC #endif bunString->impl.wtf->deref(); *bunString = { .tag = BunStringTag::Dead }; - return JSValue::encode(jsString(vm, WTFMove(str))); + return JSValue::encode(jsString(vm, WTF::move(str))); } WTF::String str = bunString->toWTFString(); *bunString = { .tag = BunStringTag::Dead }; - return JSValue::encode(jsString(vm, WTFMove(str))); + return JSValue::encode(jsString(vm, WTF::move(str))); } // int64_t max to say "not a number" @@ -553,7 +553,7 @@ extern "C" JSC::EncodedJSValue BunString__toJSDOMURL(JSC::JSGlobalObject* lexica auto str = bunString->toWTFString(BunString::ZeroCopy); auto object = WebCore::DOMURL::create(str, String()); - auto jsValue = WebCore::toJSNewlyCreated>(*lexicalGlobalObject, globalObject, throwScope, WTFMove(object)); + auto jsValue = WebCore::toJSNewlyCreated>(*lexicalGlobalObject, globalObject, throwScope, WTF::move(object)); auto* jsDOMURL = jsCast(jsValue.asCell()); vm.heap.reportExtraMemoryAllocated(jsDOMURL, jsDOMURL->wrapped().memoryCostForGC()); RELEASE_AND_RETURN(throwScope, JSC::JSValue::encode(jsValue)); @@ -573,7 +573,7 @@ extern "C" WTF::URL* URL__fromJS(EncodedJSValue encodedValue, JSC::JSGlobalObjec if (!url.isValid() || url.isNull()) return nullptr; - return new WTF::URL(WTFMove(url)); + return new WTF::URL(WTF::move(url)); } extern "C" BunString URL__getHrefFromJS(EncodedJSValue encodedValue, JSC::JSGlobalObject* globalObject) @@ -647,7 +647,7 @@ extern "C" WTF::URL* URL__fromString(BunString* input) if (!url.isValid()) return nullptr; - return new WTF::URL(WTFMove(url)); + return new WTF::URL(WTF::move(url)); } extern "C" BunString URL__protocol(WTF::URL* url) diff --git a/src/bun.js/bindings/ConsoleObject.cpp b/src/bun.js/bindings/ConsoleObject.cpp index beecfc84a1..6d8fddae56 100644 --- a/src/bun.js/bindings/ConsoleObject.cpp +++ b/src/bun.js/bindings/ConsoleObject.cpp @@ -35,7 +35,7 @@ void ConsoleObject::messageWithTypeAndLevel(MessageType type, MessageLevel level Ref&& arguments) { if (globalObject->inspectable()) { - if (auto* client = globalObject->inspectorController().consoleClient().get()) { + if (auto client = globalObject->inspectorController().consoleClient()) { client->messageWithTypeAndLevel(type, level, globalObject, arguments.copyRef()); } } @@ -113,7 +113,7 @@ void ConsoleObject::warnUnimplemented(const String& method) {} void ConsoleObject::profile(JSC::JSGlobalObject* globalObject, const String& title) { if (globalObject->inspectable()) { - if (auto* client = globalObject->inspectorController().consoleClient().get()) { + if (auto client = globalObject->inspectorController().consoleClient()) { client->profile(globalObject, title); } } @@ -122,7 +122,7 @@ void ConsoleObject::profile(JSC::JSGlobalObject* globalObject, const String& tit void ConsoleObject::profileEnd(JSC::JSGlobalObject* globalObject, const String& title) { if (globalObject->inspectable()) { - if (auto* client = globalObject->inspectorController().consoleClient().get()) { + if (auto client = globalObject->inspectorController().consoleClient()) { client->profileEnd(globalObject, title); } } diff --git a/src/bun.js/bindings/CookieMap.cpp b/src/bun.js/bindings/CookieMap.cpp index f2adb476b4..fa84f70939 100644 --- a/src/bun.js/bindings/CookieMap.cpp +++ b/src/bun.js/bindings/CookieMap.cpp @@ -47,12 +47,12 @@ CookieMap::CookieMap() } CookieMap::CookieMap(Vector>&& cookies) - : m_modifiedCookies(WTFMove(cookies)) + : m_modifiedCookies(WTF::move(cookies)) { } CookieMap::CookieMap(Vector>&& cookies) - : m_originalCookies(WTFMove(cookies)) + : m_originalCookies(WTF::move(cookies)) { } @@ -68,7 +68,7 @@ ExceptionOr> CookieMap::create(std::variant return Exception { TypeError, "Invalid cookie string: expected name=value pair"_s }; } } - return adoptRef(*new CookieMap(WTFMove(cookies))); + return adoptRef(*new CookieMap(WTF::move(cookies))); }, [&](const HashMap& pairs) -> ExceptionOr> { Vector> cookies; @@ -76,7 +76,7 @@ ExceptionOr> CookieMap::create(std::variant cookies.append(KeyValuePair(entry.key, entry.value)); } - return adoptRef(*new CookieMap(WTFMove(cookies))); + return adoptRef(*new CookieMap(WTF::move(cookies))); }, [&](const String& cookieString) -> ExceptionOr> { StringView forCookieHeader = cookieString; @@ -121,7 +121,7 @@ ExceptionOr> CookieMap::create(std::variant cookies.append(KeyValuePair(name, value)); } - return adoptRef(*new CookieMap(WTFMove(cookies))); + return adoptRef(*new CookieMap(WTF::move(cookies))); }); return std::visit(visitor, variant); @@ -181,7 +181,7 @@ void CookieMap::set(Ref cookie) { removeInternal(cookie->name()); // Add the new cookie - m_modifiedCookies.append(WTFMove(cookie)); + m_modifiedCookies.append(WTF::move(cookie)); } ExceptionOr CookieMap::remove(const CookieStoreDeleteOptions& options) @@ -198,7 +198,7 @@ ExceptionOr CookieMap::remove(const CookieStoreDeleteOptions& options) return cookie_exception.releaseException(); } auto cookie = cookie_exception.releaseReturnValue(); - m_modifiedCookies.append(WTFMove(cookie)); + m_modifiedCookies.append(WTF::move(cookie)); return {}; } diff --git a/src/bun.js/bindings/DOMFormData.cpp b/src/bun.js/bindings/DOMFormData.cpp index 08c203585f..e866c2704e 100644 --- a/src/bun.js/bindings/DOMFormData.cpp +++ b/src/bun.js/bindings/DOMFormData.cpp @@ -173,7 +173,7 @@ void DOMFormData::set(const String& name, Item&& item) } if (initialMatchLocation) { - m_items[*initialMatchLocation] = WTFMove(item); + m_items[*initialMatchLocation] = WTF::move(item); m_items.removeAllMatching([&name](const auto& item) { return item.name == name; @@ -182,7 +182,7 @@ void DOMFormData::set(const String& name, Item&& item) return; } - m_items.append(WTFMove(item)); + m_items.append(WTF::move(item)); } DOMFormData::Iterator::Iterator(DOMFormData& target) diff --git a/src/bun.js/bindings/DOMURL.cpp b/src/bun.js/bindings/DOMURL.cpp index 2bfc6d4336..61af7c6338 100644 --- a/src/bun.js/bindings/DOMURL.cpp +++ b/src/bun.js/bindings/DOMURL.cpp @@ -56,7 +56,7 @@ static inline String redact(const String& input) } inline DOMURL::DOMURL(URL&& completeURL) - : m_url(WTFMove(completeURL)) + : m_url(WTF::move(completeURL)) , m_initialURLCostForGC(static_cast(std::min(m_url.string().impl()->costDuringGC(), std::numeric_limits::max()))) { ASSERT(m_url.isValid()); @@ -67,7 +67,7 @@ ExceptionOr> DOMURL::create(const String& url) URL completeURL { url }; if (!completeURL.isValid()) return Exception { InvalidURLError, makeString(redact(url), " cannot be parsed as a URL."_s) }; - return adoptRef(*new DOMURL(WTFMove(completeURL))); + return adoptRef(*new DOMURL(WTF::move(completeURL))); } ExceptionOr> DOMURL::create(const String& url, const URL& base) @@ -76,7 +76,7 @@ ExceptionOr> DOMURL::create(const String& url, const URL& base) URL completeURL { base, url }; if (!completeURL.isValid()) return Exception { InvalidURLError, makeString(redact(url), " cannot be parsed as a URL."_s) }; - return adoptRef(*new DOMURL(WTFMove(completeURL))); + return adoptRef(*new DOMURL(WTF::move(completeURL))); } ExceptionOr> DOMURL::create(const String& url, const String& base) @@ -102,7 +102,7 @@ RefPtr DOMURL::parse(const String& url, const String& base) auto completeURL = parseInternal(url, base); if (!completeURL.isValid()) return {}; - return adoptRef(*new DOMURL(WTFMove(completeURL))); + return adoptRef(*new DOMURL(WTF::move(completeURL))); } bool DOMURL::canParse(const String& url, const String& base) @@ -117,7 +117,7 @@ ExceptionOr DOMURL::setHref(const String& url) return Exception { InvalidURLError, makeString(redact(url), " cannot be parsed as a URL."_s) }; } - m_url = WTFMove(completeURL); + m_url = WTF::move(completeURL); if (m_searchParams) m_searchParams->updateFromAssociatedURL(); return {}; diff --git a/src/bun.js/bindings/ErrorStackTrace.h b/src/bun.js/bindings/ErrorStackTrace.h index faaac27a84..1d8f89c70d 100644 --- a/src/bun.js/bindings/ErrorStackTrace.h +++ b/src/bun.js/bindings/ErrorStackTrace.h @@ -169,7 +169,7 @@ public: } JSCStackTrace(WTF::Vector&& frames) - : m_frames(WTFMove(frames)) + : m_frames(WTF::move(frames)) { } @@ -177,7 +177,7 @@ public: bool isEmpty() const { return m_frames.isEmpty(); } JSCStackFrame& at(size_t i) { return m_frames.at(i); } - WTF::Vector&& frames() { return WTFMove(m_frames); } + WTF::Vector&& frames() { return WTF::move(m_frames); } static JSCStackTrace fromExisting(JSC::VM& vm, const WTF::Vector& existingFrames); @@ -203,7 +203,7 @@ public: private: JSCStackTrace(WTF::Vector& frames) - : m_frames(WTFMove(frames)) + : m_frames(WTF::move(frames)) { } }; diff --git a/src/bun.js/bindings/EventLoopTask.h b/src/bun.js/bindings/EventLoopTask.h index 953fc0da85..021c39b1a1 100644 --- a/src/bun.js/bindings/EventLoopTask.h +++ b/src/bun.js/bindings/EventLoopTask.h @@ -11,20 +11,20 @@ public: template::value && std::is_convertible>::value>::type> EventLoopTask(T task) - : m_task(WTFMove(task)) + : m_task(WTF::move(task)) , m_isCleanupTask(false) { } EventLoopTask(Function&& task) - : m_task([task = WTFMove(task)](ScriptExecutionContext&) { task(); }) + : m_task([task = WTF::move(task)](ScriptExecutionContext&) { task(); }) , m_isCleanupTask(false) { } template>::value>::type> EventLoopTask(CleanupTaskTag, T task) - : m_task(WTFMove(task)) + : m_task(WTF::move(task)) , m_isCleanupTask(true) { } diff --git a/src/bun.js/bindings/EventLoopTaskNoContext.h b/src/bun.js/bindings/EventLoopTaskNoContext.h index e795a23ccb..fede33f260 100644 --- a/src/bun.js/bindings/EventLoopTaskNoContext.h +++ b/src/bun.js/bindings/EventLoopTaskNoContext.h @@ -12,7 +12,7 @@ class EventLoopTaskNoContext { public: EventLoopTaskNoContext(JSC::JSGlobalObject* globalObject, Function&& task) : m_createdInBunVm(defaultGlobalObject(globalObject)->bunVM()) - , m_task(WTFMove(task)) + , m_task(WTF::move(task)) { } diff --git a/src/bun.js/bindings/Exception.h b/src/bun.js/bindings/Exception.h index e14b1e01a1..a5b09e9bf4 100644 --- a/src/bun.js/bindings/Exception.h +++ b/src/bun.js/bindings/Exception.h @@ -39,7 +39,7 @@ public: ExceptionCode code() const { return m_code; } const String& message() const { return m_message; } - String&& releaseMessage() { return WTFMove(m_message); } + String&& releaseMessage() { return WTF::move(m_message); } Exception isolatedCopy() const { @@ -55,7 +55,7 @@ Exception isolatedCopy(Exception&&); inline Exception::Exception(ExceptionCode code, String message) : m_code { code } - , m_message { WTFMove(message) } + , m_message { WTF::move(message) } { } diff --git a/src/bun.js/bindings/ExceptionOr.h b/src/bun.js/bindings/ExceptionOr.h index aed54f7375..adad6fe19f 100644 --- a/src/bun.js/bindings/ExceptionOr.h +++ b/src/bun.js/bindings/ExceptionOr.h @@ -92,12 +92,12 @@ private: ExceptionOr isolatedCopy(ExceptionOr&&); template inline ExceptionOr::ExceptionOr(Exception&& exception) - : m_value(makeUnexpected(WTFMove(exception))) + : m_value(makeUnexpected(WTF::move(exception))) { } template inline ExceptionOr::ExceptionOr(ReturnType&& returnValue) - : m_value(WTFMove(returnValue)) + : m_value(WTF::move(returnValue)) { } @@ -118,7 +118,7 @@ template inline const Exception& ExceptionOr::e template inline Exception ExceptionOr::releaseException() { - return WTFMove(m_value.error()); + return WTF::move(m_value.error()); } template inline const ReturnType& ExceptionOr::returnValue() const @@ -128,11 +128,11 @@ template inline const ReturnType& ExceptionOr:: template inline ReturnType ExceptionOr::releaseReturnValue() { - return WTFMove(m_value.value()); + return WTF::move(m_value.value()); } template inline ExceptionOr::ExceptionOr(Exception&& exception) - : m_value(WTFMove(exception)) + : m_value(WTF::move(exception)) { } @@ -167,7 +167,7 @@ template inline ReturnReferenceType& ExceptionOr::ExceptionOr(Exception&& exception) - : m_value(makeUnexpected(WTFMove(exception))) + : m_value(makeUnexpected(WTF::move(exception))) { } @@ -183,7 +183,7 @@ inline const Exception& ExceptionOr::exception() const inline Exception ExceptionOr::releaseException() { - return WTFMove(m_value.error()); + return WTF::move(m_value.error()); } inline ExceptionOr isolatedCopy(ExceptionOr&& value) diff --git a/src/bun.js/bindings/FormatStackTraceForJS.cpp b/src/bun.js/bindings/FormatStackTraceForJS.cpp index c570432ea3..bd53f19267 100644 --- a/src/bun.js/bindings/FormatStackTraceForJS.cpp +++ b/src/bun.js/bindings/FormatStackTraceForJS.cpp @@ -687,7 +687,7 @@ JSC_DEFINE_HOST_FUNCTION(errorConstructorFuncCaptureStackTrace, (JSC::JSGlobalOb JSCStackTrace::getFramesForCaller(vm, callFrame, errorObject, caller, stackTrace, stackTraceLimit); if (auto* instance = jsDynamicCast(errorObject)) { - instance->setStackFrames(vm, WTFMove(stackTrace)); + instance->setStackFrames(vm, WTF::move(stackTrace)); if (instance->hasMaterializedErrorInfo()) { const auto& propertyName = vm.propertyNames->stack; VM::DeletePropertyModeScope scope(vm, VM::DeletePropertyMode::IgnoreConfigurable); diff --git a/src/bun.js/bindings/InspectorBunFrontendDevServerAgent.cpp b/src/bun.js/bindings/InspectorBunFrontendDevServerAgent.cpp index 81039a09de..4cc5e4c659 100644 --- a/src/bun.js/bindings/InspectorBunFrontendDevServerAgent.cpp +++ b/src/bun.js/bindings/InspectorBunFrontendDevServerAgent.cpp @@ -82,7 +82,7 @@ void InspectorBunFrontendDevServerAgent::bundleStart(int devServerId, RefbundleStart(devServerId, WTFMove(triggerFiles)); + m_frontendDispatcher->bundleStart(devServerId, WTF::move(triggerFiles)); } void InspectorBunFrontendDevServerAgent::bundleComplete(int devServerId, double durationMs) @@ -106,7 +106,7 @@ void InspectorBunFrontendDevServerAgent::clientNavigated(int devServerId, int co if (!m_enabled || !m_frontendDispatcher) return; - m_frontendDispatcher->clientNavigated(devServerId, connectionId, url, WTFMove(routeBundleId)); + m_frontendDispatcher->clientNavigated(devServerId, connectionId, url, WTF::move(routeBundleId)); } void InspectorBunFrontendDevServerAgent::clientErrorReported(int devServerId, const String& clientErrorPayloadBase64) @@ -154,7 +154,7 @@ void InspectorBunFrontendDevServerAgent__notifyBundleStart(InspectorBunFrontendD files->addItem(triggerFiles[i].transferToWTFString()); } - agent->bundleStart(devServerId, WTFMove(files)); + agent->bundleStart(devServerId, WTF::move(files)); } void InspectorBunFrontendDevServerAgent__notifyBundleComplete(InspectorBunFrontendDevServerAgent* agent, int devServerId, double durationMs) diff --git a/src/bun.js/bindings/InspectorHTTPServerAgent.cpp b/src/bun.js/bindings/InspectorHTTPServerAgent.cpp index cc376d13ac..e1e1278498 100644 --- a/src/bun.js/bindings/InspectorHTTPServerAgent.cpp +++ b/src/bun.js/bindings/InspectorHTTPServerAgent.cpp @@ -132,7 +132,7 @@ void InspectorHTTPServerAgent::serverRoutesUpdated(int serverId, int hotReloadId return; } - this->m_frontendDispatcher->serverRoutesUpdated(serverId, hotReloadId, WTFMove(routes)); + this->m_frontendDispatcher->serverRoutesUpdated(serverId, hotReloadId, WTF::move(routes)); } void InspectorHTTPServerAgent::requestWillBeSent(Ref&& request) { @@ -140,7 +140,7 @@ void InspectorHTTPServerAgent::requestWillBeSent(Refm_frontendDispatcher->requestWillBeSent(WTFMove(request)); + this->m_frontendDispatcher->requestWillBeSent(WTF::move(request)); } void InspectorHTTPServerAgent::responseReceived(Ref&& response) { @@ -148,7 +148,7 @@ void InspectorHTTPServerAgent::responseReceived(Refm_frontendDispatcher->responseReceived(WTFMove(response)); + this->m_frontendDispatcher->responseReceived(WTF::move(response)); } void InspectorHTTPServerAgent::bodyChunkReceived(Ref&& chunk) { @@ -156,7 +156,7 @@ void InspectorHTTPServerAgent::bodyChunkReceived(Refm_frontendDispatcher->bodyChunkReceived(WTFMove(chunk)); + this->m_frontendDispatcher->bodyChunkReceived(WTF::move(chunk)); } void InspectorHTTPServerAgent::requestFinished(int requestId, int serverId, double timestamp, std::optional&& opt_duration) { @@ -164,7 +164,7 @@ void InspectorHTTPServerAgent::requestFinished(int requestId, int serverId, doub return; } - this->m_frontendDispatcher->requestFinished(requestId, serverId, timestamp, WTFMove(opt_duration)); + this->m_frontendDispatcher->requestFinished(requestId, serverId, timestamp, WTF::move(opt_duration)); } void InspectorHTTPServerAgent::requestHandlerException(Ref&& error) { @@ -172,7 +172,7 @@ void InspectorHTTPServerAgent::requestHandlerException(Refm_frontendDispatcher->requestHandlerException(WTFMove(error)); + this->m_frontendDispatcher->requestHandlerException(WTF::move(error)); } } @@ -258,9 +258,9 @@ struct Route { object->setScriptUrl(route.script_url.toWTFString()); } - routes->addItem(WTFMove(object)); + routes->addItem(WTF::move(object)); } - agent->serverRoutesUpdated(serverId, hotReloadId, WTFMove(routes)); + agent->serverRoutesUpdated(serverId, hotReloadId, WTF::move(routes)); } } diff --git a/src/bun.js/bindings/InspectorLifecycleAgent.cpp b/src/bun.js/bindings/InspectorLifecycleAgent.cpp index 67ae982299..e3c24a1f9a 100644 --- a/src/bun.js/bindings/InspectorLifecycleAgent.cpp +++ b/src/bun.js/bindings/InspectorLifecycleAgent.cpp @@ -122,7 +122,7 @@ void InspectorLifecycleAgent::reportError(ZigException& exception) } // error(const String& message, const String& name, Ref>&& urls, Ref>&& lineColumns, Ref>&& sourceLines); - m_frontendDispatcher->error(WTFMove(message), WTFMove(name), WTFMove(urls), WTFMove(lineColumns), WTFMove(sourceLines)); + m_frontendDispatcher->error(WTF::move(message), WTF::move(name), WTF::move(urls), WTF::move(lineColumns), WTF::move(sourceLines)); } Protocol::ErrorStringOr InspectorLifecycleAgent::preventExit() @@ -206,7 +206,7 @@ Protocol::ErrorStringOr InspectorLifecycleAgent::getModuleGraph() RETURN_IF_EXCEPTION(scope, makeUnexpected(ErrorString("Failed to convert value to string"_s))); } - return ModuleGraph { WTFMove(esm), WTFMove(cjs), WTFMove(cwd), WTFMove(main), WTFMove(argv) }; + return ModuleGraph { WTF::move(esm), WTF::move(cjs), WTF::move(cwd), WTF::move(main), WTF::move(argv) }; } } diff --git a/src/bun.js/bindings/InternalModuleRegistry.cpp b/src/bun.js/bindings/InternalModuleRegistry.cpp index 1b0837ae73..4e4f6fb428 100644 --- a/src/bun.js/bindings/InternalModuleRegistry.cpp +++ b/src/bun.js/bindings/InternalModuleRegistry.cpp @@ -100,7 +100,7 @@ ALWAYS_INLINE JSC::JSValue generateNativeModule( #ifdef BUN_DYNAMIC_JS_LOAD_PATH JSValue initializeInternalModuleFromDisk(JSGlobalObject* globalObject, VM& vm, const WTF::String& moduleName, WTF::String fileBase, const WTF::String& urlString) { - WTF::String file = makeString(ASCIILiteral::fromLiteralUnsafe(BUN_DYNAMIC_JS_LOAD_PATH), "/"_s, WTFMove(fileBase)); + WTF::String file = makeString(ASCIILiteral::fromLiteralUnsafe(BUN_DYNAMIC_JS_LOAD_PATH), "/"_s, WTF::move(fileBase)); if (auto contents = WTF::FileSystemImpl::readEntireFile(file)) { auto string = WTF::String::fromUTF8(contents.value()); return generateModule(globalObject, vm, string, moduleName, urlString); diff --git a/src/bun.js/bindings/JSBuffer.cpp b/src/bun.js/bindings/JSBuffer.cpp index e3be045a44..90471a55cb 100644 --- a/src/bun.js/bindings/JSBuffer.cpp +++ b/src/bun.js/bindings/JSBuffer.cpp @@ -352,7 +352,7 @@ JSC::EncodedJSValue JSBuffer__bufferFromPointerAndLengthAndDeinit(JSC::JSGlobalO bytesDeallocator(p, ctx); })); - uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, WTFMove(buffer), 0, length); + uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, WTF::move(buffer), 0, length); } else { uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, 0); } @@ -409,7 +409,7 @@ static JSC::EncodedJSValue writeToBuffer(JSC::JSGlobalObject* lexicalGlobalObjec JSC::JSUint8Array* createBuffer(JSC::JSGlobalObject* lexicalGlobalObject, Ref&& backingStore) { size_t length = backingStore->byteLength(); - return JSC::JSUint8Array::create(lexicalGlobalObject, defaultGlobalObject(lexicalGlobalObject)->JSBufferSubclassStructure(), WTFMove(backingStore), 0, length); + return JSC::JSUint8Array::create(lexicalGlobalObject, defaultGlobalObject(lexicalGlobalObject)->JSBufferSubclassStructure(), WTF::move(backingStore), 0, length); } JSC::JSUint8Array* createBuffer(JSC::JSGlobalObject* lexicalGlobalObject, const uint8_t* ptr, size_t length) @@ -1771,7 +1771,7 @@ JSC::EncodedJSValue jsBufferToStringFromBytes(JSGlobalObject* lexicalGlobalObjec } memcpy(data.data(), bytes.data(), bytes.size()); - return JSValue::encode(jsString(vm, WTFMove(str))); + return JSValue::encode(jsString(vm, WTF::move(str))); } case BufferEncodingType::ucs2: case BufferEncodingType::utf16le: { @@ -1786,7 +1786,7 @@ JSC::EncodedJSValue jsBufferToStringFromBytes(JSGlobalObject* lexicalGlobalObjec return {}; } memcpy(reinterpret_cast(data.data()), bytes.data(), u16length * 2); - return JSValue::encode(jsString(vm, WTFMove(str))); + return JSValue::encode(jsString(vm, WTF::move(str))); } case BufferEncodingType::ascii: { std::span data; @@ -1796,7 +1796,7 @@ JSC::EncodedJSValue jsBufferToStringFromBytes(JSGlobalObject* lexicalGlobalObjec return {}; } Bun__encoding__writeLatin1(bytes.data(), bytes.size(), data.data(), data.size(), static_cast(encoding)); - return JSValue::encode(jsString(vm, WTFMove(str))); + return JSValue::encode(jsString(vm, WTF::move(str))); } case WebCore::BufferEncodingType::utf8: @@ -2167,7 +2167,7 @@ extern "C" JSC::EncodedJSValue JSBuffer__fromMmap(Zig::GlobalObject* globalObjec #endif })); - auto* view = JSC::JSUint8Array::create(globalObject, structure, WTFMove(buffer), 0, length); + auto* view = JSC::JSUint8Array::create(globalObject, structure, WTF::move(buffer), 0, length); RETURN_IF_EXCEPTION(scope, {}); if (!view) [[unlikely]] { @@ -2889,7 +2889,7 @@ EncodedJSValue constructBufferFromArrayBuffer(JSC::ThrowScope& throwScope, JSGlo auto isResizableOrGrowableShared = jsBuffer->isResizableOrGrowableShared(); if (isResizableOrGrowableShared) { auto* subclassStructure = globalObject->JSResizableOrGrowableSharedBufferSubclassStructure(); - auto* uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, WTFMove(buffer), offset, std::nullopt); + auto* uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, WTF::move(buffer), offset, std::nullopt); RETURN_IF_EXCEPTION(throwScope, {}); if (!uint8Array) [[unlikely]] { throwOutOfMemoryError(globalObject, throwScope); @@ -2898,7 +2898,7 @@ EncodedJSValue constructBufferFromArrayBuffer(JSC::ThrowScope& throwScope, JSGlo RELEASE_AND_RETURN(throwScope, JSC::JSValue::encode(uint8Array)); } auto* subclassStructure = globalObject->JSBufferSubclassStructure(); - auto* uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, WTFMove(buffer), offset, length); + auto* uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, WTF::move(buffer), offset, length); RETURN_IF_EXCEPTION(throwScope, {}); if (!uint8Array) [[unlikely]] { throwOutOfMemoryError(globalObject, throwScope); diff --git a/src/bun.js/bindings/JSBunRequest.cpp b/src/bun.js/bindings/JSBunRequest.cpp index f72f54a40f..1a40d64dc2 100644 --- a/src/bun.js/bindings/JSBunRequest.cpp +++ b/src/bun.js/bindings/JSBunRequest.cpp @@ -132,7 +132,7 @@ JSBunRequest* JSBunRequest::clone(JSC::VM& vm, JSGlobalObject* globalObject) if (auto* wrapper = jsDynamicCast(cookiesObject)) { auto cookieMap = wrapper->protectedWrapped(); auto cookieMapClone = cookieMap->clone(); - auto cookies = WebCore::toJSNewlyCreated(globalObject, jsCast(globalObject), WTFMove(cookieMapClone)); + auto cookies = WebCore::toJSNewlyCreated(globalObject, jsCast(globalObject), WTF::move(cookieMapClone)); clone->setCookies(cookies.getObject()); } } @@ -266,7 +266,7 @@ JSC_DEFINE_CUSTOM_GETTER(jsJSBunRequestGetCookies, (JSC::JSGlobalObject * global auto cookieMap = cookieMapResult.releaseReturnValue(); // Convert to JS - auto cookies = WebCore::toJSNewlyCreated(globalObject, jsCast(globalObject), WTFMove(cookieMap)); + auto cookies = WebCore::toJSNewlyCreated(globalObject, jsCast(globalObject), WTF::move(cookieMap)); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); request->setCookies(cookies.getObject()); return JSValue::encode(cookies); diff --git a/src/bun.js/bindings/JSBundlerPlugin.cpp b/src/bun.js/bindings/JSBundlerPlugin.cpp index 3bd323e2ef..c1152b494f 100644 --- a/src/bun.js/bindings/JSBundlerPlugin.cpp +++ b/src/bun.js/bindings/JSBundlerPlugin.cpp @@ -71,7 +71,7 @@ void BundlerPlugin::NamespaceList::append(JSC::VM& vm, JSC::RegExp* filter, Stri auto pattern = filter->pattern(); auto filter_regexp = FilterRegExp(pattern, filter->flags()); - nsGroup->append(WTFMove(filter_regexp)); + nsGroup->append(WTF::move(filter_regexp)); } static bool anyMatchesForNamespace(JSC::VM& vm, BundlerPlugin::NamespaceList& list, const BunString* namespaceStr, const BunString* path) @@ -260,7 +260,7 @@ void BundlerPlugin::NativePluginList::append(JSC::VM& vm, JSC::RegExp* filter, S auto pattern = filter->pattern(); auto filter_regexp = FilterRegExp(pattern, filter->flags()); - nsGroup->append(WTFMove(filter_regexp)); + nsGroup->append(WTF::move(filter_regexp)); } if (index == std::numeric_limits::max()) { diff --git a/src/bun.js/bindings/JSBundlerPlugin.h b/src/bun.js/bindings/JSBundlerPlugin.h index 34fb313075..ee59d1e614 100644 --- a/src/bun.js/bindings/JSBundlerPlugin.h +++ b/src/bun.js/bindings/JSBundlerPlugin.h @@ -29,8 +29,8 @@ public: WTF::Lock lock {}; FilterRegExp(FilterRegExp&& other) - : m_pattern(WTFMove(other.m_pattern)) - , regex(WTFMove(other.regex)) + : m_pattern(WTF::move(other.m_pattern)) + , regex(WTF::move(other.regex)) { } diff --git a/src/bun.js/bindings/JSCTaskScheduler.cpp b/src/bun.js/bindings/JSCTaskScheduler.cpp index 7652caabef..171b5c4edc 100644 --- a/src/bun.js/bindings/JSCTaskScheduler.cpp +++ b/src/bun.js/bindings/JSCTaskScheduler.cpp @@ -16,8 +16,8 @@ extern "C" void Bun__eventLoop__incrementRefConcurrently(void* bunVM, int delta) class JSCDeferredWorkTask { public: JSCDeferredWorkTask(Ref ticket, Task&& task) - : ticket(WTFMove(ticket)) - , task(WTFMove(task)) + : ticket(WTF::move(ticket)) + , task(WTF::move(task)) { } @@ -43,14 +43,14 @@ void JSCTaskScheduler::onAddPendingWork(WebCore::JSVMClientData* clientData, Ref Locker holder { scheduler.m_lock }; if (kind == DeferredWorkTimer::WorkType::ImminentlyScheduled) { Bun__eventLoop__incrementRefConcurrently(clientData->bunVM, 1); - scheduler.m_pendingTicketsKeepingEventLoopAlive.add(WTFMove(ticket)); + scheduler.m_pendingTicketsKeepingEventLoopAlive.add(WTF::move(ticket)); } else { - scheduler.m_pendingTicketsOther.add(WTFMove(ticket)); + scheduler.m_pendingTicketsOther.add(WTF::move(ticket)); } } void JSCTaskScheduler::onScheduleWorkSoon(WebCore::JSVMClientData* clientData, Ticket ticket, Task&& task) { - auto* job = new JSCDeferredWorkTask(*ticket, WTFMove(task)); + auto* job = new JSCDeferredWorkTask(*ticket, WTF::move(task)); Bun__queueJSCDeferredWorkTaskConcurrently(clientData->bunVM, job); } diff --git a/src/bun.js/bindings/JSCommonJSModule.cpp b/src/bun.js/bindings/JSCommonJSModule.cpp index b6000602bc..095d305e66 100644 --- a/src/bun.js/bindings/JSCommonJSModule.cpp +++ b/src/bun.js/bindings/JSCommonJSModule.cpp @@ -112,7 +112,7 @@ extern "C" void Bun__VM__setEntryPointEvalResultCJS(void*, EncodedJSValue); static bool evaluateCommonJSModuleOnce(JSC::VM& vm, Zig::GlobalObject* globalObject, JSCommonJSModule* moduleObject, JSString* dirname, JSValue filename) { auto scope = DECLARE_THROW_SCOPE(vm); - SourceCode code = std::move(moduleObject->sourceCode); + SourceCode code = WTF::move(moduleObject->sourceCode); // If an exception occurred somewhere else, we might have cleared the source code. if (code.isNull()) [[unlikely]] { @@ -715,7 +715,7 @@ JSC_DEFINE_HOST_FUNCTION(functionJSCommonJSModule_compile, (JSGlobalObject * glo } moduleObject->sourceCode = makeSource( - WTFMove(wrappedString), + WTF::move(wrappedString), SourceOrigin(URL::fileURLWithFileSystemPath(filenameString)), JSC::SourceTaintedOrigin::Untainted, filenameString, @@ -1365,7 +1365,7 @@ void JSCommonJSModule::evaluate( if (this->hasEvaluated) return; - this->sourceCode = JSC::SourceCode(WTFMove(sourceProvider)); + this->sourceCode = JSC::SourceCode(WTF::move(sourceProvider)); evaluateCommonJSModuleOnce(vm, globalObject, this, this->m_dirname.get(), this->m_filename.get()); } @@ -1466,7 +1466,7 @@ std::optional createCommonJSModule( moduleObject = JSCommonJSModule::create( vm, globalObject->CommonJSModuleObjectStructure(), - requireMapKey, filename, dirname, WTFMove(JSC::SourceCode(WTFMove(sourceProvider)))); + requireMapKey, filename, dirname, JSC::SourceCode(WTF::move(sourceProvider))); moduleObject->putDirect(vm, WebCore::clientData(vm)->builtinNames().exportsPublicName(), diff --git a/src/bun.js/bindings/JSDOMExceptionHandling.cpp b/src/bun.js/bindings/JSDOMExceptionHandling.cpp index f2dc435086..2b8bd8a3ab 100644 --- a/src/bun.js/bindings/JSDOMExceptionHandling.cpp +++ b/src/bun.js/bindings/JSDOMExceptionHandling.cpp @@ -212,7 +212,7 @@ JSValue createDOMException(JSGlobalObject& lexicalGlobalObject, Exception&& exce void propagateExceptionSlowPath(JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& throwScope, Exception&& exception) { throwScope.assertNoExceptionExceptTermination(); - auto jsException = createDOMException(lexicalGlobalObject, WTFMove(exception)); + auto jsException = createDOMException(lexicalGlobalObject, WTF::move(exception)); RETURN_IF_EXCEPTION(throwScope, ); throwException(&lexicalGlobalObject, throwScope, jsException); } diff --git a/src/bun.js/bindings/JSDOMExceptionHandling.h b/src/bun.js/bindings/JSDOMExceptionHandling.h index 600673927e..7f04a6efde 100644 --- a/src/bun.js/bindings/JSDOMExceptionHandling.h +++ b/src/bun.js/bindings/JSDOMExceptionHandling.h @@ -80,7 +80,7 @@ ALWAYS_INLINE void propagateException(JSC::JSGlobalObject& lexicalGlobalObject, { if (throwScope.exception()) return; - propagateExceptionSlowPath(lexicalGlobalObject, throwScope, WTFMove(exception)); + propagateExceptionSlowPath(lexicalGlobalObject, throwScope, WTF::move(exception)); } inline void propagateException(JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& throwScope, ExceptionOr&& value) @@ -91,7 +91,7 @@ inline void propagateException(JSC::JSGlobalObject& lexicalGlobalObject, JSC::Th ALWAYS_INLINE void propagateException(JSC::JSGlobalObject* lexicalGlobalObject, JSC::ThrowScope& throwScope, Exception&& exception) { - return propagateException(*lexicalGlobalObject, throwScope, WTFMove(exception)); + return propagateException(*lexicalGlobalObject, throwScope, WTF::move(exception)); } template void invokeFunctorPropagatingExceptionIfNecessary(JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& throwScope, Functor&& functor) diff --git a/src/bun.js/bindings/JSDOMWrapper.h b/src/bun.js/bindings/JSDOMWrapper.h index bff0179a45..d27d0c24c3 100644 --- a/src/bun.js/bindings/JSDOMWrapper.h +++ b/src/bun.js/bindings/JSDOMWrapper.h @@ -91,7 +91,7 @@ public: protected: JSDOMWrapper(JSC::Structure* structure, JSC::JSGlobalObject& globalObject, Ref&& impl) : Base(structure, globalObject) - , m_wrapped(WTFMove(impl)) + , m_wrapped(WTF::move(impl)) { } diff --git a/src/bun.js/bindings/JSDOMWrapperCache.h b/src/bun.js/bindings/JSDOMWrapperCache.h index 11795651a0..7397ae993c 100644 --- a/src/bun.js/bindings/JSDOMWrapperCache.h +++ b/src/bun.js/bindings/JSDOMWrapperCache.h @@ -186,14 +186,14 @@ template inline auto createWrapper(JSDOMGlobalObj ASSERT(!getCachedWrapper(globalObject->world(), domObject)); auto* domObjectPtr = domObject.ptr(); - auto* wrapper = WrapperClass::create(getDOMStructure(globalObject->vm(), *globalObject), globalObject, WTFMove(domObject)); + auto* wrapper = WrapperClass::create(getDOMStructure(globalObject->vm(), *globalObject), globalObject, WTF::move(domObject)); cacheWrapper(globalObject->world(), domObjectPtr, wrapper); return wrapper; } template inline auto createWrapper(JSDOMGlobalObject* globalObject, Ref&& domObject) -> typename std::enable_if::value, typename JSDOMWrapperConverterTraits::WrapperClass*>::type { - return createWrapper(globalObject, unsafeRefDowncast(WTFMove(domObject))); + return createWrapper(globalObject, unsafeRefDowncast(WTF::move(domObject))); } template inline JSC::JSValue wrap(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, DOMClass& domObject) diff --git a/src/bun.js/bindings/JSFFIFunction.cpp b/src/bun.js/bindings/JSFFIFunction.cpp index 0a66f73665..292f15e875 100644 --- a/src/bun.js/bindings/JSFFIFunction.cpp +++ b/src/bun.js/bindings/JSFFIFunction.cpp @@ -127,7 +127,7 @@ const ClassInfo JSFFIFunction::s_info = { "Function"_s, &Base::s_info, nullptr, JSFFIFunction::JSFFIFunction(VM& vm, NativeExecutable* executable, JSGlobalObject* globalObject, Structure* structure, CFFIFunction&& function) : Base(vm, executable, globalObject, structure) - , m_function(WTFMove(function)) + , m_function(WTF::move(function)) { // used in NAPI dataPtr = nullptr; @@ -153,7 +153,7 @@ JSFFIFunction* JSFFIFunction::create(VM& vm, Zig::GlobalObject* globalObject, un { NativeExecutable* executable = vm.getHostFunction(FFIFunction, ImplementationVisibility::Public, intrinsic, FFIFunction, nullptr, name); Structure* structure = globalObject->FFIFunctionStructure(); - JSFFIFunction* function = new (NotNull, allocateCell(vm)) JSFFIFunction(vm, executable, globalObject, structure, reinterpret_cast(WTFMove(FFIFunction))); + JSFFIFunction* function = new (NotNull, allocateCell(vm)) JSFFIFunction(vm, executable, globalObject, structure, reinterpret_cast(WTF::move(FFIFunction))); function->finishCreation(vm, executable, length, name); return function; } @@ -176,7 +176,7 @@ JSFFIFunction* JSFFIFunction::createForFFI(VM& vm, Zig::GlobalObject* globalObje NativeExecutable* executable = vm.getHostFunction(FFIFunction, ImplementationVisibility::Public, NoIntrinsic, FFIFunction, nullptr, name); #endif Structure* structure = globalObject->FFIFunctionStructure(); - JSFFIFunction* function = new (NotNull, allocateCell(vm)) JSFFIFunction(vm, executable, globalObject, structure, reinterpret_cast(WTFMove(FFIFunction))); + JSFFIFunction* function = new (NotNull, allocateCell(vm)) JSFFIFunction(vm, executable, globalObject, structure, reinterpret_cast(WTF::move(FFIFunction))); function->finishCreation(vm, executable, length, name); return function; } @@ -212,7 +212,7 @@ FFI_Callback_threadsafe_call(FFICallbackFunctionWrapper& wrapper, size_t argCoun for (size_t i = 0; i < argCount; ++i) argsVec.append(args[i]); - WebCore::ScriptExecutionContext::postTaskTo(globalObject->scriptExecutionContext()->identifier(), [argsVec = WTFMove(argsVec), wrapper](WebCore::ScriptExecutionContext& ctx) mutable { + WebCore::ScriptExecutionContext::postTaskTo(globalObject->scriptExecutionContext()->identifier(), [argsVec = WTF::move(argsVec), wrapper](WebCore::ScriptExecutionContext& ctx) mutable { auto* globalObject = JSC::jsCast(ctx.jsGlobalObject()); auto& vm = JSC::getVM(globalObject); JSC::MarkedArgumentBuffer arguments; diff --git a/src/bun.js/bindings/JSSecrets.cpp b/src/bun.js/bindings/JSSecrets.cpp index 94fd771a8c..f86093ec52 100644 --- a/src/bun.js/bindings/JSSecrets.cpp +++ b/src/bun.js/bindings/JSSecrets.cpp @@ -246,13 +246,13 @@ void Bun__SecretsJobOptions__runTask(SecretsJobOptions* opts, JSGlobalObject* gl auto result = Secrets::getPassword(opts->service, opts->name, opts->error); if (result.has_value()) { // Store as String for main thread (String is thread-safe to construct from CString) - opts->resultPassword = WTFMove(result.value()); + opts->resultPassword = WTF::move(result.value()); } break; } case SecretsJobOptions::SET: - opts->error = Secrets::setPassword(opts->service, opts->name, WTFMove(opts->password), opts->allowUnrestrictedAccess); + opts->error = Secrets::setPassword(opts->service, opts->name, WTF::move(opts->password), opts->allowUnrestrictedAccess); break; case SecretsJobOptions::DELETE_OP: @@ -288,7 +288,7 @@ void Bun__SecretsJobOptions__runFromJS(SecretsJobOptions* opts, JSGlobalObject* switch (opts->op) { case SecretsJobOptions::GET: if (opts->resultPassword.has_value()) { - auto resultPassword = WTFMove(opts->resultPassword.value()); + auto resultPassword = WTF::move(opts->resultPassword.value()); result = jsString(vm, String::fromUTF8(resultPassword.span())); RETURN_IF_EXCEPTION(scope, ); memsetSpan(resultPassword.mutableSpan(), 0); diff --git a/src/bun.js/bindings/JSStringDecoder.cpp b/src/bun.js/bindings/JSStringDecoder.cpp index 14b8e51da4..4d6186509d 100644 --- a/src/bun.js/bindings/JSStringDecoder.cpp +++ b/src/bun.js/bindings/JSStringDecoder.cpp @@ -486,7 +486,7 @@ static JSC_DEFINE_CUSTOM_GETTER(jsStringDecoder_lastChar, (JSGlobalObject * lexi RETURN_IF_EXCEPTION(scope, {}); auto buffer = ArrayBuffer::create({ castedThis->m_lastChar, 4 }); auto* globalObject = static_cast(lexicalGlobalObject); - JSC::JSUint8Array* uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTFMove(buffer), 0, 4); + JSC::JSUint8Array* uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTF::move(buffer), 0, 4); RELEASE_AND_RETURN(scope, JSC::JSValue::encode(uint8Array)); } static JSC_DEFINE_CUSTOM_GETTER(jsStringDecoder_lastNeed, (JSGlobalObject * lexicalGlobalObject, JSC::EncodedJSValue thisValue, PropertyName attributeName)) diff --git a/src/bun.js/bindings/JSX509Certificate.cpp b/src/bun.js/bindings/JSX509Certificate.cpp index 36058482cf..0dfee02575 100644 --- a/src/bun.js/bindings/JSX509Certificate.cpp +++ b/src/bun.js/bindings/JSX509Certificate.cpp @@ -265,13 +265,13 @@ JSX509Certificate* JSX509Certificate::create(JSC::VM& vm, JSC::Structure* struct return nullptr; } - return create(vm, structure, globalObject, WTFMove(result.value)); + return create(vm, structure, globalObject, WTF::move(result.value)); } JSX509Certificate* JSX509Certificate::create(JSC::VM& vm, JSC::Structure* structure, JSC::JSGlobalObject* globalObject, ncrypto::X509Pointer&& cert) { auto* certificate = create(vm, structure); - certificate->m_x509 = WTFMove(cert); + certificate->m_x509 = WTF::move(cert); size_t size = i2d_X509(certificate->m_x509.get(), nullptr); certificate->m_extraMemorySizeForGC = size; vm.heap.reportExtraMemoryAllocated(certificate, size); @@ -573,7 +573,7 @@ JSUint8Array* JSX509Certificate::computeRaw(ncrypto::X509View view, JSGlobalObje Ref buffer = JSC::ArrayBuffer::createFromBytes(std::span(reinterpret_cast(bptr->data), bptr->length), createSharedTask([](void* data) { ncrypto::BIOPointer free_me(static_cast(data)); })); - RELEASE_AND_RETURN(scope, Bun::createBuffer(globalObject, WTFMove(buffer))); + RELEASE_AND_RETURN(scope, Bun::createBuffer(globalObject, WTF::move(buffer))); } bool JSX509Certificate::computeIsCA(ncrypto::X509View view, JSGlobalObject* globalObject) @@ -1046,8 +1046,8 @@ JSValue JSX509Certificate::computePublicKey(ncrypto::X509View view, JSGlobalObje return {}; } - auto handle = KeyObject::create(CryptoKeyType::Public, WTFMove(result.value)); - return JSPublicKeyObject::create(vm, globalObject->m_JSPublicKeyObjectClassStructure.get(lexicalGlobalObject), lexicalGlobalObject, WTFMove(handle)); + auto handle = KeyObject::create(CryptoKeyType::Public, WTF::move(result.value)); + return JSPublicKeyObject::create(vm, globalObject->m_JSPublicKeyObjectClassStructure.get(lexicalGlobalObject), lexicalGlobalObject, WTF::move(handle)); } JSValue JSX509Certificate::computeInfoAccess(ncrypto::X509View view, JSGlobalObject* globalObject, bool legacy) @@ -1171,7 +1171,7 @@ extern "C" EncodedJSValue Bun__X509__toJS(X509* cert, JSGlobalObject* globalObje { ncrypto::X509Pointer cert_ptr(cert); auto* zigGlobalObject = defaultGlobalObject(globalObject); - return JSValue::encode(JSX509Certificate::create(zigGlobalObject->vm(), zigGlobalObject->m_JSX509CertificateClassStructure.get(zigGlobalObject), globalObject, WTFMove(cert_ptr))); + return JSValue::encode(JSX509Certificate::create(zigGlobalObject->vm(), zigGlobalObject->m_JSX509CertificateClassStructure.get(zigGlobalObject), globalObject, WTF::move(cert_ptr))); } JSC_DEFINE_HOST_FUNCTION(jsIsX509Certificate, (JSGlobalObject * globalObject, CallFrame* callFrame)) diff --git a/src/bun.js/bindings/ModuleLoader.cpp b/src/bun.js/bindings/ModuleLoader.cpp index fb46b9f127..05ab6649c1 100644 --- a/src/bun.js/bindings/ModuleLoader.cpp +++ b/src/bun.js/bindings/ModuleLoader.cpp @@ -422,10 +422,10 @@ static JSValue handleVirtualModuleResult( globalObject, object); auto source = JSC::SourceCode( - JSC::SyntheticSourceProvider::create(WTFMove(function), + JSC::SyntheticSourceProvider::create(WTF::move(function), JSC::SourceOrigin(), specifier->toWTFString(BunString::ZeroCopy))); JSC::ensureStillAliveHere(object); - RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(globalObject->vm(), WTFMove(source)))); + RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(globalObject->vm(), WTF::move(source)))); } case OnLoadResultTypePromise: { @@ -496,7 +496,7 @@ extern "C" void Bun__onFulfillAsyncModule( auto created = Bun::createCommonJSModule(jsCast(globalObject), specifierValue, res->result.value); EXCEPTION_ASSERT(created.has_value() == !scope.exception()); if (created.has_value()) { - JSSourceCode* code = JSSourceCode::create(vm, WTFMove(created.value())); + JSSourceCode* code = JSSourceCode::create(vm, WTF::move(created.value())); promise->resolve(globalObject, code); scope.assertNoExceptionExceptTermination(); } else { @@ -956,7 +956,7 @@ static JSValue fetchESMSourceCode( auto created = Bun::createCommonJSModule(globalObject, specifierJS, res->result.value); EXCEPTION_ASSERT(created.has_value() == !scope.exception()); if (created.has_value()) { - RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(vm, WTFMove(created.value())))); + RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(vm, WTF::move(created.value())))); } if constexpr (allowPromise) { @@ -978,10 +978,10 @@ static JSValue fetchESMSourceCode( RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(vm, JSC::SourceCode(provider)))); } -#define CASE(str, name) \ - case (SyntheticModuleType::name): { \ - auto source = JSC::SourceCode(JSC::SyntheticSourceProvider::create(generateNativeModule_##name, JSC::SourceOrigin(), WTFMove(moduleKey))); \ - RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(vm, WTFMove(source)))); \ +#define CASE(str, name) \ + case (SyntheticModuleType::name): { \ + auto source = JSC::SourceCode(JSC::SyntheticSourceProvider::create(generateNativeModule_##name, JSC::SourceOrigin(), WTF::move(moduleKey))); \ + RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(vm, WTF::move(source)))); \ } BUN_FOREACH_ESM_NATIVE_MODULE(CASE) #undef CASE @@ -991,7 +991,7 @@ static JSValue fetchESMSourceCode( if (tag & SyntheticModuleType::InternalModuleRegistryFlag) { constexpr auto mask = (SyntheticModuleType::InternalModuleRegistryFlag - 1); auto source = JSC::SourceCode(JSC::SyntheticSourceProvider::create(generateInternalModuleSourceCode(globalObject, static_cast(tag & mask)), JSC::SourceOrigin(URL(makeString("builtins://"_s, moduleKey))), moduleKey)); - RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(vm, WTFMove(source)))); + RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(vm, WTF::move(source)))); } else { auto&& provider = Zig::SourceProvider::create(globalObject, res->result.value, JSC::SourceProviderSourceType::Module, true); RELEASE_AND_RETURN(scope, rejectOrResolve(JSC::JSSourceCode::create(vm, JSC::SourceCode(provider)))); @@ -1022,7 +1022,7 @@ static JSValue fetchESMSourceCode( auto created = Bun::createCommonJSModule(globalObject, specifierJS, res->result.value); EXCEPTION_ASSERT(created.has_value() == !scope.exception()); if (created.has_value()) { - RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(vm, WTFMove(created.value())))); + RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(vm, WTF::move(created.value())))); } if constexpr (allowPromise) { @@ -1067,10 +1067,10 @@ static JSValue fetchESMSourceCode( globalObject, value); auto source = JSC::SourceCode( - JSC::SyntheticSourceProvider::create(WTFMove(function), + JSC::SyntheticSourceProvider::create(WTF::move(function), JSC::SourceOrigin(), specifier->toWTFString(BunString::ZeroCopy))); JSC::ensureStillAliveHere(value); - RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(globalObject->vm(), WTFMove(source)))); + RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(globalObject->vm(), WTF::move(source)))); } // TOML and JSONC may go through here else if (res->result.value.tag == SyntheticModuleType::ExportsObject) { @@ -1084,10 +1084,10 @@ static JSValue fetchESMSourceCode( globalObject, value); auto source = JSC::SourceCode( - JSC::SyntheticSourceProvider::create(WTFMove(function), + JSC::SyntheticSourceProvider::create(WTF::move(function), JSC::SourceOrigin(), specifier->toWTFString(BunString::ZeroCopy))); JSC::ensureStillAliveHere(value); - RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(globalObject->vm(), WTFMove(source)))); + RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(globalObject->vm(), WTF::move(source)))); } else if (res->result.value.tag == SyntheticModuleType::ExportDefaultObject) { JSC::JSValue value = JSC::JSValue::decode(res->result.value.jsvalue_for_export); if (!value) { @@ -1099,10 +1099,10 @@ static JSValue fetchESMSourceCode( globalObject, value); auto source = JSC::SourceCode( - JSC::SyntheticSourceProvider::create(WTFMove(function), + JSC::SyntheticSourceProvider::create(WTF::move(function), JSC::SourceOrigin(), specifier->toWTFString(BunString::ZeroCopy))); JSC::ensureStillAliveHere(value); - RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(globalObject->vm(), WTFMove(source)))); + RELEASE_AND_RETURN(scope, rejectOrResolve(JSSourceCode::create(globalObject->vm(), WTF::move(source)))); } RELEASE_AND_RETURN(scope, rejectOrResolve(JSC::JSSourceCode::create(vm, JSC::SourceCode(Zig::SourceProvider::create(globalObject, res->result.value))))); diff --git a/src/bun.js/bindings/NodeDirent.cpp b/src/bun.js/bindings/NodeDirent.cpp index d4d7fae7a0..ac05a49417 100644 --- a/src/bun.js/bindings/NodeDirent.cpp +++ b/src/bun.js/bindings/NodeDirent.cpp @@ -349,14 +349,14 @@ extern "C" JSC::EncodedJSValue Bun__Dirent__toJS(Zig::GlobalObject* globalObject if (!pathValue) { auto pathString = path->transferToWTFString(); - pathValue = jsString(vm, WTFMove(pathString)); + pathValue = jsString(vm, WTF::move(pathString)); if (previousPath) { *previousPath = pathValue; } } auto nameString = name->transferToWTFString(); - auto nameValue = jsString(vm, WTFMove(nameString)); + auto nameValue = jsString(vm, WTF::move(nameString)); auto typeValue = jsNumber(type); object->putDirectOffset(vm, 0, nameValue); object->putDirectOffset(vm, 1, pathValue); diff --git a/src/bun.js/bindings/NodeHTTP.cpp b/src/bun.js/bindings/NodeHTTP.cpp index 33fcc4e1c6..d315e75249 100644 --- a/src/bun.js/bindings/NodeHTTP.cpp +++ b/src/bun.js/bindings/NodeHTTP.cpp @@ -115,14 +115,14 @@ static void assignHeadersFromUWebSocketsForCall(uWS::HttpRequest* request, JSVal { std::string_view fullURLStdStr = request->getFullUrl(); String fullURL = String::fromUTF8ReplacingInvalidSequences({ reinterpret_cast(fullURLStdStr.data()), fullURLStdStr.length() }); - args.append(jsString(vm, WTFMove(fullURL))); + args.append(jsString(vm, WTF::move(fullURL))); } // Get the method. if (methodString.isUndefinedOrNull()) [[unlikely]] { std::string_view methodView = request->getMethod(); WTF::String methodString = String::fromUTF8ReplacingInvalidSequences({ reinterpret_cast(methodView.data()), methodView.length() }); - args.append(jsString(vm, WTFMove(methodString))); + args.append(jsString(vm, WTF::move(methodString))); } else { args.append(methodString); } @@ -216,7 +216,7 @@ static EncodedJSValue assignHeadersFromUWebSockets(uWS::HttpRequest* request, JS std::string_view fullURLStdStr = request->getFullUrl(); String fullURL = String::fromUTF8ReplacingInvalidSequences({ reinterpret_cast(fullURLStdStr.data()), fullURLStdStr.length() }); PutPropertySlot slot(objectValue, false); - objectValue->put(objectValue, globalObject, builtinNames.urlPublicName(), jsString(vm, WTFMove(fullURL)), slot); + objectValue->put(objectValue, globalObject, builtinNames.urlPublicName(), jsString(vm, WTF::move(fullURL)), slot); RETURN_IF_EXCEPTION(scope, {}); } diff --git a/src/bun.js/bindings/NodeVM.cpp b/src/bun.js/bindings/NodeVM.cpp index baf305f5b4..c8e1053672 100644 --- a/src/bun.js/bindings/NodeVM.cpp +++ b/src/bun.js/bindings/NodeVM.cpp @@ -146,7 +146,7 @@ JSC::JSFunction* constructAnonymousFunction(JSC::JSGlobalObject* globalObject, c EXCEPTION_ASSERT(!!throwScope.exception() == code.isNull()); SourceCode sourceCode( - JSC::StringSourceProvider::create(code, sourceOrigin, WTFMove(options.filename), sourceTaintOrigin, position, SourceProviderSourceType::Program), + JSC::StringSourceProvider::create(code, sourceOrigin, WTF::move(options.filename), sourceTaintOrigin, position, SourceProviderSourceType::Program), position.m_line.oneBasedInt(), position.m_column.oneBasedInt()); CodeCache* cache = vm.codeCache(); @@ -1276,7 +1276,7 @@ JSC_DEFINE_HOST_FUNCTION(vmModuleCompileFunction, (JSGlobalObject * globalObject options.parsingContext->setGlobalScopeExtension(functionScope); // Create the function using constructAnonymousFunction with the appropriate scope chain - JSFunction* function = constructAnonymousFunction(globalObject, ArgList(constructFunctionArgs), sourceOrigin, WTFMove(options), JSC::SourceTaintedOrigin::Untainted, functionScope); + JSFunction* function = constructAnonymousFunction(globalObject, ArgList(constructFunctionArgs), sourceOrigin, WTF::move(options), JSC::SourceTaintedOrigin::Untainted, functionScope); RETURN_IF_EXCEPTION(scope, {}); if (!function) { @@ -1573,12 +1573,12 @@ void configureNodeVM(JSC::VM& vm, Zig::GlobalObject* globalObject) } BaseVMOptions::BaseVMOptions(String filename) - : filename(WTFMove(filename)) + : filename(WTF::move(filename)) { } BaseVMOptions::BaseVMOptions(String filename, OrdinalNumber lineOffset, OrdinalNumber columnOffset) - : filename(WTFMove(filename)) + : filename(WTF::move(filename)) , lineOffset(lineOffset) , columnOffset(columnOffset) { diff --git a/src/bun.js/bindings/NodeVMModule.cpp b/src/bun.js/bindings/NodeVMModule.cpp index ff9489c006..202692f1f5 100644 --- a/src/bun.js/bindings/NodeVMModule.cpp +++ b/src/bun.js/bindings/NodeVMModule.cpp @@ -12,14 +12,14 @@ namespace Bun { NodeVMModuleRequest::NodeVMModuleRequest(WTF::String specifier, WTF::HashMap importAttributes) - : m_specifier(WTFMove(specifier)) - , m_importAttributes(WTFMove(importAttributes)) + : m_specifier(WTF::move(specifier)) + , m_importAttributes(WTF::move(importAttributes)) { } void NodeVMModuleRequest::addImportAttribute(WTF::String key, WTF::String value) { - m_importAttributes.set(WTFMove(key), WTFMove(value)); + m_importAttributes.set(WTF::move(key), WTF::move(value)); } JSArray* NodeVMModuleRequest::toJS(JSGlobalObject* globalObject) const @@ -152,7 +152,7 @@ JSValue NodeVMModule::evaluate(JSGlobalObject* globalObject, uint32_t timeout, b NodeVMModule::NodeVMModule(JSC::VM& vm, JSC::Structure* structure, WTF::String identifier, JSValue context, JSValue moduleWrapper) : Base(vm, structure) - , m_identifier(WTFMove(identifier)) + , m_identifier(WTF::move(identifier)) , m_context(context && context.isObject() ? asObject(context) : nullptr, JSC::WriteBarrierEarlyInit) , m_moduleWrapper(vm, this, moduleWrapper) { diff --git a/src/bun.js/bindings/NodeVMModule.h b/src/bun.js/bindings/NodeVMModule.h index 57179d37f8..67ce3d5ef1 100644 --- a/src/bun.js/bindings/NodeVMModule.h +++ b/src/bun.js/bindings/NodeVMModule.h @@ -56,7 +56,7 @@ public: void namespaceObject(JSC::VM& vm, JSModuleNamespaceObject* value) { m_namespaceObject.set(vm, this, value); } const WTF::Vector& moduleRequests() const { return m_moduleRequests; } - void addModuleRequest(NodeVMModuleRequest request) { m_moduleRequests.append(WTFMove(request)); } + void addModuleRequest(NodeVMModuleRequest request) { m_moduleRequests.append(WTF::move(request)); } // Purposely not virtual. Dispatches to the correct subclass. JSValue createModuleRecord(JSC::JSGlobalObject* globalObject); diff --git a/src/bun.js/bindings/NodeVMScript.cpp b/src/bun.js/bindings/NodeVMScript.cpp index 7602c80a50..b6ae742d67 100644 --- a/src/bun.js/bindings/NodeVMScript.cpp +++ b/src/bun.js/bindings/NodeVMScript.cpp @@ -133,7 +133,7 @@ constructScript(JSGlobalObject* globalObject, CallFrame* callFrame, JSValue newT const bool produceCachedData = options.produceCachedData; auto filename = options.filename; - NodeVMScript* script = NodeVMScript::create(vm, globalObject, structure, WTFMove(source), WTFMove(options)); + NodeVMScript* script = NodeVMScript::create(vm, globalObject, structure, WTF::move(source), WTF::move(options)); RETURN_IF_EXCEPTION(scope, {}); fetcher->owner(vm, script); @@ -150,7 +150,7 @@ constructScript(JSGlobalObject* globalObject, CallFrame* callFrame, JSValue newT JSC::LexicallyScopedFeatures lexicallyScopedFeatures = globalObject->globalScopeExtension() ? JSC::TaintedByWithScopeLexicallyScopedFeature : JSC::NoLexicallyScopedFeatures; JSC::SourceCodeKey key(script->source(), {}, JSC::SourceCodeType::ProgramType, lexicallyScopedFeatures, JSC::JSParserScriptMode::Classic, JSC::DerivedContextType::None, JSC::EvalContextType::None, false, {}, std::nullopt); Ref cachedBytecode = JSC::CachedBytecode::create(std::span(cachedData), nullptr, {}); - JSC::UnlinkedProgramCodeBlock* unlinkedBlock = JSC::decodeCodeBlock(vm, key, WTFMove(cachedBytecode)); + JSC::UnlinkedProgramCodeBlock* unlinkedBlock = JSC::decodeCodeBlock(vm, key, WTF::move(cachedBytecode)); if (!unlinkedBlock) { script->cachedDataRejected(TriState::True); @@ -264,7 +264,7 @@ void NodeVMScriptConstructor::finishCreation(VM& vm, JSObject* prototype) NodeVMScript* NodeVMScript::create(VM& vm, JSGlobalObject* globalObject, Structure* structure, SourceCode source, ScriptOptions options) { - NodeVMScript* ptr = new (NotNull, allocateCell(vm)) NodeVMScript(vm, structure, WTFMove(source), WTFMove(options)); + NodeVMScript* ptr = new (NotNull, allocateCell(vm)) NodeVMScript(vm, structure, WTF::move(source), WTF::move(options)); ptr->finishCreation(vm); return ptr; } diff --git a/src/bun.js/bindings/NodeVMScript.h b/src/bun.js/bindings/NodeVMScript.h index 5637ae939a..356d247a8b 100644 --- a/src/bun.js/bindings/NodeVMScript.h +++ b/src/bun.js/bindings/NodeVMScript.h @@ -91,8 +91,8 @@ private: NodeVMScript(JSC::VM& vm, JSC::Structure* structure, JSC::SourceCode source, ScriptOptions options) : Base(vm, structure) - , m_source(WTFMove(source)) - , m_options(WTFMove(options)) + , m_source(WTF::move(source)) + , m_options(WTF::move(options)) { } diff --git a/src/bun.js/bindings/NodeVMSourceTextModule.cpp b/src/bun.js/bindings/NodeVMSourceTextModule.cpp index af84196723..5c3ad694ec 100644 --- a/src/bun.js/bindings/NodeVMSourceTextModule.cpp +++ b/src/bun.js/bindings/NodeVMSourceTextModule.cpp @@ -97,17 +97,17 @@ NodeVMSourceTextModule* NodeVMSourceTextModule::create(VM& vm, JSGlobalObject* g WTF::String sourceText = sourceTextValue.toWTFString(globalObject); RETURN_IF_EXCEPTION(scope, nullptr); - Ref sourceProvider = StringSourceProvider::create(WTFMove(sourceText), sourceOrigin, String {}, SourceTaintedOrigin::Untainted, + Ref sourceProvider = StringSourceProvider::create(WTF::move(sourceText), sourceOrigin, String {}, SourceTaintedOrigin::Untainted, TextPosition { OrdinalNumber::fromZeroBasedInt(lineOffset), OrdinalNumber::fromZeroBasedInt(columnOffset) }, SourceProviderSourceType::Module); - SourceCode sourceCode(WTFMove(sourceProvider), lineOffset, columnOffset); + SourceCode sourceCode(WTF::move(sourceProvider), lineOffset, columnOffset); auto* zigGlobalObject = defaultGlobalObject(globalObject); WTF::String identifier = identifierValue.toWTFString(globalObject); RETURN_IF_EXCEPTION(scope, nullptr); NodeVMSourceTextModule* ptr = new (NotNull, allocateCell(vm)) NodeVMSourceTextModule( - vm, zigGlobalObject->NodeVMSourceTextModuleStructure(), WTFMove(identifier), contextValue, - WTFMove(sourceCode), moduleWrapper, initializeImportMeta); + vm, zigGlobalObject->NodeVMSourceTextModuleStructure(), WTF::move(identifier), contextValue, + WTF::move(sourceCode), moduleWrapper, initializeImportMeta); RETURN_IF_EXCEPTION(scope, nullptr); ptr->finishCreation(vm); @@ -127,7 +127,7 @@ NodeVMSourceTextModule* NodeVMSourceTextModule::create(VM& vm, JSGlobalObject* g SourceCodeKey key(ptr->sourceCode(), {}, SourceCodeType::ProgramType, lexicallyScopedFeatures, JSParserScriptMode::Classic, DerivedContextType::None, EvalContextType::None, false, {}, std::nullopt); Ref cachedBytecode = CachedBytecode::create(std::span(cachedData), nullptr, {}); RETURN_IF_EXCEPTION(scope, nullptr); - UnlinkedModuleProgramCodeBlock* unlinkedBlock = decodeCodeBlock(vm, key, WTFMove(cachedBytecode)); + UnlinkedModuleProgramCodeBlock* unlinkedBlock = decodeCodeBlock(vm, key, WTF::move(cachedBytecode)); RETURN_IF_EXCEPTION(scope, nullptr); if (unlinkedBlock) { @@ -274,7 +274,7 @@ JSValue NodeVMSourceTextModule::createModuleRecord(JSGlobalObject* globalObject) break; } - attributeMap.set("type"_s, WTFMove(attributesTypeString)); + attributeMap.set("type"_s, WTF::move(attributesTypeString)); attributesObject->putDirect(vm, JSC::Identifier::fromString(vm, "type"_s), attributesType); if (const String& hostDefinedImportType = request.m_attributes->hostDefinedImportType(); !hostDefinedImportType.isEmpty()) { @@ -291,7 +291,7 @@ JSValue NodeVMSourceTextModule::createModuleRecord(JSGlobalObject* globalObject) } requestObject->putDirect(vm, attributesIdentifier, attributesObject); - addModuleRequest({ WTF::String(*request.m_specifier), WTFMove(attributeMap) }); + addModuleRequest({ WTF::String(*request.m_specifier), WTF::move(attributeMap) }); requestsArray->putDirectIndex(globalObject, i, requestObject); } @@ -347,7 +347,7 @@ JSValue NodeVMSourceTextModule::link(JSGlobalObject* globalObject, JSArray* spec record->setImportedModule(globalObject, Identifier::fromString(vm, specifier), resolvedRecord); RETURN_IF_EXCEPTION(scope, {}); - m_resolveCache.set(WTFMove(specifier), WriteBarrier { vm, this, moduleNative }); + m_resolveCache.set(WTF::move(specifier), WriteBarrier { vm, this, moduleNative }); RETURN_IF_EXCEPTION(scope, {}); } } diff --git a/src/bun.js/bindings/NodeVMSourceTextModule.h b/src/bun.js/bindings/NodeVMSourceTextModule.h index e7e27cfdfc..790c1b5cc5 100644 --- a/src/bun.js/bindings/NodeVMSourceTextModule.h +++ b/src/bun.js/bindings/NodeVMSourceTextModule.h @@ -58,9 +58,9 @@ private: SourceCode m_sourceCode; NodeVMSourceTextModule(JSC::VM& vm, JSC::Structure* structure, WTF::String identifier, JSValue context, SourceCode sourceCode, JSValue moduleWrapper, JSValue initializeImportMeta) - : Base(vm, structure, WTFMove(identifier), context, moduleWrapper) + : Base(vm, structure, WTF::move(identifier), context, moduleWrapper) , m_initializeImportMeta(initializeImportMeta && !initializeImportMeta.isUndefined() ? initializeImportMeta : JSValue(), JSC::WriteBarrierEarlyInit) - , m_sourceCode(WTFMove(sourceCode)) + , m_sourceCode(WTF::move(sourceCode)) { } diff --git a/src/bun.js/bindings/NodeVMSyntheticModule.cpp b/src/bun.js/bindings/NodeVMSyntheticModule.cpp index 8455d7d88c..7cc66b429e 100644 --- a/src/bun.js/bindings/NodeVMSyntheticModule.cpp +++ b/src/bun.js/bindings/NodeVMSyntheticModule.cpp @@ -80,7 +80,7 @@ NodeVMSyntheticModule* NodeVMSyntheticModule::create(VM& vm, JSGlobalObject* glo auto* structure = zigGlobalObject->NodeVMSyntheticModuleStructure(); WTF::String identifier = identifierValue.toWTFString(globalObject); RETURN_IF_EXCEPTION(scope, nullptr); - auto* ptr = new (NotNull, allocateCell(vm)) NodeVMSyntheticModule(vm, structure, WTFMove(identifier), contextValue, moduleWrapperValue, WTFMove(exportNames), syntheticEvaluationStepsValue); + auto* ptr = new (NotNull, allocateCell(vm)) NodeVMSyntheticModule(vm, structure, WTF::move(identifier), contextValue, moduleWrapperValue, WTF::move(exportNames), syntheticEvaluationStepsValue); ptr->finishCreation(vm); return ptr; } diff --git a/src/bun.js/bindings/NodeVMSyntheticModule.h b/src/bun.js/bindings/NodeVMSyntheticModule.h index 3d005d804d..e269bd94dc 100644 --- a/src/bun.js/bindings/NodeVMSyntheticModule.h +++ b/src/bun.js/bindings/NodeVMSyntheticModule.h @@ -52,8 +52,8 @@ private: WTF::HashSet m_exportNames; NodeVMSyntheticModule(JSC::VM& vm, JSC::Structure* structure, WTF::String identifier, JSValue context, JSValue moduleWrapper, WTF::HashSet exportNames, JSValue syntheticEvaluationSteps) - : Base(vm, structure, WTFMove(identifier), context, moduleWrapper) - , m_exportNames(WTFMove(exportNames)) + : Base(vm, structure, WTF::move(identifier), context, moduleWrapper) + , m_exportNames(WTF::move(exportNames)) , m_syntheticEvaluationSteps(vm, this, syntheticEvaluationSteps) { } diff --git a/src/bun.js/bindings/ScriptExecutionContext.cpp b/src/bun.js/bindings/ScriptExecutionContext.cpp index e546e7fc29..c314bddd16 100644 --- a/src/bun.js/bindings/ScriptExecutionContext.cpp +++ b/src/bun.js/bindings/ScriptExecutionContext.cpp @@ -137,7 +137,7 @@ ScriptExecutionContext::~ScriptExecutionContext() m_inScriptExecutionContextDestructor = true; #endif // ASSERT_ENABLED - auto postMessageCompletionHandlers = WTFMove(m_processMessageWithMessagePortsSoonHandlers); + auto postMessageCompletionHandlers = WTF::move(m_processMessageWithMessagePortsSoonHandlers); for (auto& completionHandler : postMessageCompletionHandlers) completionHandler(); @@ -157,7 +157,7 @@ bool ScriptExecutionContext::postTaskTo(ScriptExecutionContextIdentifier identif if (!context) return false; - context->postTaskConcurrently(WTFMove(task)); + context->postTaskConcurrently(WTF::move(task)); return true; } @@ -201,7 +201,7 @@ bool ScriptExecutionContext::ensureOnContextThread(ScriptExecutionContextIdentif return false; if (!context->isContextThread()) { - context->postTaskConcurrently(WTFMove(task)); + context->postTaskConcurrently(WTF::move(task)); return true; } } @@ -218,7 +218,7 @@ bool ScriptExecutionContext::ensureOnMainThread(FunctionpostTaskConcurrently(WTFMove(task)); + context->postTaskConcurrently(WTF::move(task)); return true; } @@ -231,7 +231,7 @@ ScriptExecutionContext* ScriptExecutionContext::getMainThreadScriptExecutionCont void ScriptExecutionContext::processMessageWithMessagePortsSoon(CompletionHandler&& completionHandler) { ASSERT(isContextThread()); - m_processMessageWithMessagePortsSoonHandlers.append(WTFMove(completionHandler)); + m_processMessageWithMessagePortsSoonHandlers.append(WTF::move(completionHandler)); if (m_willProcessMessageWithMessagePortsSoon) { return; @@ -368,13 +368,13 @@ ScriptExecutionContext* executionContext(JSC::JSGlobalObject* globalObject) void ScriptExecutionContext::postTaskConcurrently(Function&& lambda) { - auto* task = new EventLoopTask(WTFMove(lambda)); + auto* task = new EventLoopTask(WTF::move(lambda)); static_cast(m_globalObject)->queueTaskConcurrently(task); } // Executes the task on context's thread asynchronously. void ScriptExecutionContext::postTask(Function&& lambda) { - auto* task = new EventLoopTask(WTFMove(lambda)); + auto* task = new EventLoopTask(WTF::move(lambda)); static_cast(m_globalObject)->queueTask(task); } // Executes the task on context's thread asynchronously. diff --git a/src/bun.js/bindings/Serialization.cpp b/src/bun.js/bindings/Serialization.cpp index 9af0d6a492..5385e153db 100644 --- a/src/bun.js/bindings/Serialization.cpp +++ b/src/bun.js/bindings/Serialization.cpp @@ -33,7 +33,7 @@ extern "C" SerializedValueSlice Bun__serializeJSValue(JSGlobalObject* globalObje auto forStorage = (static_cast(flags) & static_cast(SerializedFlags::ForStorage)) ? SerializationForStorage::Yes : SerializationForStorage::No; auto context = SerializationContext::Default; auto forTransferEnum = (static_cast(flags) & static_cast(SerializedFlags::ForCrossProcessTransfer)) ? SerializationForCrossProcessTransfer::Yes : SerializationForCrossProcessTransfer::No; - ExceptionOr> serialized = SerializedScriptValue::create(*globalObject, value, WTFMove(transferList), dummyPorts, forStorage, context, forTransferEnum); + ExceptionOr> serialized = SerializedScriptValue::create(*globalObject, value, WTF::move(transferList), dummyPorts, forStorage, context, forTransferEnum); EXCEPTION_ASSERT(!!scope.exception() == serialized.hasException()); if (serialized.hasException()) { @@ -61,6 +61,6 @@ extern "C" EncodedJSValue Bun__JSValue__deserialize(JSGlobalObject* globalObject { Vector vector(std::span { bytes, size }); /// ?! did i just give ownership of these bytes to JSC? - auto scriptValue = SerializedScriptValue::createFromWireBytes(WTFMove(vector)); + auto scriptValue = SerializedScriptValue::createFromWireBytes(WTF::move(vector)); return JSValue::encode(scriptValue->deserialize(*globalObject, globalObject)); } diff --git a/src/bun.js/bindings/ShellBindings.cpp b/src/bun.js/bindings/ShellBindings.cpp index 5d8cc9d692..db11b91f75 100644 --- a/src/bun.js/bindings/ShellBindings.cpp +++ b/src/bun.js/bindings/ShellBindings.cpp @@ -22,7 +22,7 @@ extern "C" SYSV_ABI EncodedJSValue Bun__createShellInterpreter(Zig::GlobalObject auto* structure = globalObject->JSShellInterpreterStructure(); ASSERT(structure); - auto* result = WebCore::JSShellInterpreter::create(vm, globalObject, structure, ptr, WTFMove(args), resolveFn, rejectFn); + auto* result = WebCore::JSShellInterpreter::create(vm, globalObject, structure, ptr, WTF::move(args), resolveFn, rejectFn); size_t size = ShellInterpreter__estimatedSize(ptr); vm.heap.reportExtraMemoryAllocated(result, size); diff --git a/src/bun.js/bindings/TextCodecCJK.cpp b/src/bun.js/bindings/TextCodecCJK.cpp index c2dc80f276..b09ee61889 100644 --- a/src/bun.js/bindings/TextCodecCJK.cpp +++ b/src/bun.js/bindings/TextCodecCJK.cpp @@ -1081,7 +1081,7 @@ static Vector gbEncodeShared(StringView string, Function gb18030Encode(StringView string, Function&)>&& unencodableHandler) { - return gbEncodeShared(string, WTFMove(unencodableHandler), IsGBK::No); + return gbEncodeShared(string, WTF::move(unencodableHandler), IsGBK::No); } // https://encoding.spec.whatwg.org/#gbk-decoder @@ -1092,7 +1092,7 @@ String TextCodecCJK::gbkDecode(std::span bytes, bool flush, bool static Vector gbkEncode(StringView string, Function&)>&& unencodableHandler) { - return gbEncodeShared(string, WTFMove(unencodableHandler), IsGBK::Yes); + return gbEncodeShared(string, WTF::move(unencodableHandler), IsGBK::Yes); } constexpr size_t maxUChar32Digits = 10; diff --git a/src/bun.js/bindings/TextEncodingRegistry.cpp b/src/bun.js/bindings/TextEncodingRegistry.cpp index cab9ba628f..356537245b 100644 --- a/src/bun.js/bindings/TextEncodingRegistry.cpp +++ b/src/bun.js/bindings/TextEncodingRegistry.cpp @@ -174,7 +174,7 @@ static void addToTextCodecMap(ASCIILiteral name, NewTextCodecFunction&& function { ASCIILiteral atomName = textEncodingNameMap().get(name); ASSERT(!atomName.isNull()); - textCodecMap().add(atomName, WTFMove(function)); + textCodecMap().add(atomName, WTF::move(function)); } static void pruneBlocklistedCodecs() WTF_REQUIRES_LOCK(encodingRegistryLock) diff --git a/src/bun.js/bindings/URLSearchParams.cpp b/src/bun.js/bindings/URLSearchParams.cpp index e8a15e5194..7d5f9d225d 100644 --- a/src/bun.js/bindings/URLSearchParams.cpp +++ b/src/bun.js/bindings/URLSearchParams.cpp @@ -35,7 +35,7 @@ extern "C" JSC::EncodedJSValue URLSearchParams__create(JSDOMGlobalObject* global { String str = Zig::toString(*input); auto result = URLSearchParams::create(str, nullptr); - return JSC::JSValue::encode(WebCore::toJSNewlyCreated(globalObject, globalObject, WTFMove(result))); + return JSC::JSValue::encode(WebCore::toJSNewlyCreated(globalObject, globalObject, WTF::move(result))); } extern "C" WebCore::URLSearchParams* URLSearchParams__fromJS(JSC::EncodedJSValue value) @@ -75,7 +75,7 @@ ExceptionOr> URLSearchParams::create(std::variant>& pairs) -> ExceptionOr> { return adoptRef(*new URLSearchParams(pairs)); }, [&](const String& string) -> ExceptionOr> { return adoptRef(*new URLSearchParams(string, nullptr)); }); + return adoptRef(*new URLSearchParams(WTF::move(pairs))); }, [&](const Vector>& pairs) -> ExceptionOr> { return adoptRef(*new URLSearchParams(pairs)); }, [&](const String& string) -> ExceptionOr> { return adoptRef(*new URLSearchParams(string, nullptr)); }); return std::visit(visitor, variant); } diff --git a/src/bun.js/bindings/Uint8Array.cpp b/src/bun.js/bindings/Uint8Array.cpp index 9e37d9225f..53feafee1e 100644 --- a/src/bun.js/bindings/Uint8Array.cpp +++ b/src/bun.js/bindings/Uint8Array.cpp @@ -15,7 +15,7 @@ extern "C" JSC::EncodedJSValue JSUint8Array__fromDefaultAllocator(JSC::JSGlobalO mi_free(p); })); - uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, lexicalGlobalObject->typedArrayStructureWithTypedArrayType(), WTFMove(buffer), 0, length); + uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, lexicalGlobalObject->typedArrayStructureWithTypedArrayType(), WTF::move(buffer), 0, length); } else { uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, lexicalGlobalObject->typedArrayStructureWithTypedArrayType(), 0); } @@ -36,7 +36,7 @@ extern "C" JSC::EncodedJSValue JSArrayBuffer__fromDefaultAllocator(JSC::JSGlobal buffer = ArrayBuffer::create(0, 1); } - auto arrayBuffer = JSC::JSArrayBuffer::create(lexicalGlobalObject->vm(), lexicalGlobalObject->arrayBufferStructure(), WTFMove(buffer)); + auto arrayBuffer = JSC::JSArrayBuffer::create(lexicalGlobalObject->vm(), lexicalGlobalObject->arrayBufferStructure(), WTF::move(buffer)); return JSC::JSValue::encode(arrayBuffer); } diff --git a/src/bun.js/bindings/ZigGlobalObject.cpp b/src/bun.js/bindings/ZigGlobalObject.cpp index 0e9e1161e2..dbbe784ad0 100644 --- a/src/bun.js/bindings/ZigGlobalObject.cpp +++ b/src/bun.js/bindings/ZigGlobalObject.cpp @@ -531,7 +531,7 @@ extern "C" JSC::JSGlobalObject* Zig__GlobalObject__create(void* console_client, auto& options = worker.options(); if (options.env.has_value()) { - HashMap map = WTFMove(*std::exchange(options.env, std::nullopt)); + HashMap map = *std::exchange(options.env, std::nullopt); auto size = map.size(); // In theory, a GC could happen before we finish putting all the properties on the object. @@ -547,7 +547,7 @@ extern "C" JSC::JSGlobalObject* Zig__GlobalObject__create(void* console_client, for (auto k : map) { // They can have environment variables with numbers as keys. // So we must use putDirectMayBeIndex to handle that. - env->putDirectMayBeIndex(globalObject, JSC::Identifier::fromString(vm, WTFMove(k.key)), strings.at(i++)); + env->putDirectMayBeIndex(globalObject, JSC::Identifier::fromString(vm, WTF::move(k.key)), strings.at(i++)); } globalObject->m_processEnvObject.set(vm, globalObject, env); } @@ -1073,7 +1073,7 @@ JSC_DEFINE_HOST_FUNCTION(functionQueueMicrotask, // The runtime inspects argumentCount to determine which arguments are present, so callers may pass only the subset they need. // Here we pass: function, callback, asyncContext. JSC::QueuedTask task { nullptr, JSC::InternalMicrotask::BunPerformMicrotaskJob, globalObject, function, callback, asyncContext }; - globalObject->vm().queueMicrotask(WTFMove(task)); + globalObject->vm().queueMicrotask(WTF::move(task)); return JSC::JSValue::encode(JSC::jsUndefined()); } @@ -1130,7 +1130,7 @@ JSC_DEFINE_HOST_FUNCTION(functionBTOA, return {}; } WTF::StringImpl::copyCharacters(ptr, encodedString.span16()); - encodedString = WTFMove(dest); + encodedString = WTF::move(dest); } unsigned length = encodedString.length(); @@ -1198,7 +1198,7 @@ extern "C" JSC::EncodedJSValue ArrayBuffer__fromSharedMemfd(int64_t fd, JSC::JSG })); if (type == JSC::Uint8ArrayType) { - auto uint8array = JSC::JSUint8Array::create(globalObject, globalObject->m_typedArrayUint8.get(globalObject), WTFMove(buffer), 0, byteLength); + auto uint8array = JSC::JSUint8Array::create(globalObject, globalObject->m_typedArrayUint8.get(globalObject), WTF::move(buffer), 0, byteLength); return JSValue::encode(uint8array); } @@ -1210,7 +1210,7 @@ extern "C" JSC::EncodedJSValue ArrayBuffer__fromSharedMemfd(int64_t fd, JSC::JSG return JSC::JSValue::encode(JSC::JSValue {}); } - return JSValue::encode(JSC::JSArrayBuffer::create(globalObject->vm(), structure, WTFMove(buffer))); + return JSValue::encode(JSC::JSArrayBuffer::create(globalObject->vm(), structure, WTF::move(buffer))); } else { RELEASE_ASSERT_NOT_REACHED(); } @@ -1232,7 +1232,7 @@ extern "C" JSC::EncodedJSValue Bun__createArrayBufferForCopy(JSC::JSGlobalObject if (len > 0) memcpy(arrayBuffer->data(), ptr, len); - RELEASE_AND_RETURN(scope, JSValue::encode(JSC::JSArrayBuffer::create(globalObject->vm(), globalObject->arrayBufferStructure(JSC::ArrayBufferSharingMode::Default), WTFMove(arrayBuffer)))); + RELEASE_AND_RETURN(scope, JSValue::encode(JSC::JSArrayBuffer::create(globalObject->vm(), globalObject->arrayBufferStructure(JSC::ArrayBufferSharingMode::Default), WTF::move(arrayBuffer)))); } extern "C" JSC::EncodedJSValue Bun__allocUint8ArrayForCopy(JSC::JSGlobalObject* globalObject, size_t len, void** ptr) @@ -1286,7 +1286,7 @@ extern "C" JSC::EncodedJSValue Bun__makeArrayBufferWithBytesNoCopy(JSC::JSGlobal if (deallocator) deallocator(p, deallocatorContext); })); - JSArrayBuffer* jsBuffer = JSArrayBuffer::create(vm, globalObject->arrayBufferStructure(ArrayBufferSharingMode::Default), WTFMove(buffer)); + JSArrayBuffer* jsBuffer = JSArrayBuffer::create(vm, globalObject->arrayBufferStructure(ArrayBufferSharingMode::Default), WTF::move(buffer)); RETURN_IF_EXCEPTION(scope, {}); return JSValue::encode(jsBuffer); } @@ -1299,7 +1299,7 @@ extern "C" JSC::EncodedJSValue Bun__makeTypedArrayWithBytesNoCopy(JSC::JSGlobalO auto buffer_ = ArrayBuffer::createFromBytes({ static_cast(ptr), len }, createSharedTask([=](void* p) { if (deallocator) deallocator(p, deallocatorContext); })); - RefPtr&& buffer = WTFMove(buffer_); + RefPtr&& buffer = WTF::move(buffer_); if (!buffer) { throwOutOfMemoryError(globalObject, scope); return {}; @@ -1313,7 +1313,7 @@ extern "C" JSC::EncodedJSValue Bun__makeTypedArrayWithBytesNoCopy(JSC::JSGlobalO switch (ty) { #define JSC_TYPED_ARRAY_FACTORY(type) \ case Type##type: \ - RELEASE_AND_RETURN(scope, JSValue::encode(JS##type##Array::create(globalObject, globalObject->typedArrayStructure(Type##type, isResizableOrGrowableShared), WTFMove(buffer), offset, length))); + RELEASE_AND_RETURN(scope, JSValue::encode(JS##type##Array::create(globalObject, globalObject->typedArrayStructure(Type##type, isResizableOrGrowableShared), WTF::move(buffer), offset, length))); #undef JSC_TYPED_ARRAY_CHECK FOR_EACH_TYPED_ARRAY_TYPE_EXCLUDING_DATA_VIEW(JSC_TYPED_ARRAY_FACTORY) case NotTypedArray: @@ -1337,7 +1337,7 @@ JSC_DEFINE_HOST_FUNCTION(functionCreateUninitializedArrayBuffer, return {}; } - RELEASE_AND_RETURN(scope, JSValue::encode(JSC::JSArrayBuffer::create(globalObject->vm(), globalObject->arrayBufferStructure(JSC::ArrayBufferSharingMode::Default), WTFMove(arrayBuffer)))); + RELEASE_AND_RETURN(scope, JSValue::encode(JSC::JSArrayBuffer::create(globalObject->vm(), globalObject->arrayBufferStructure(JSC::ArrayBufferSharingMode::Default), WTF::move(arrayBuffer)))); } static inline JSC::EncodedJSValue jsFunctionAddEventListenerBody(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, Zig::GlobalObject* castedThis) @@ -1358,7 +1358,7 @@ static inline JSC::EncodedJSValue jsFunctionAddEventListenerBody(JSC::JSGlobalOb EnsureStillAliveScope argument2 = callFrame->argument(2); auto options = argument2.value().isUndefined() ? false : convert, IDLBoolean>>(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, {}); - auto result = JSValue::encode(WebCore::toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl->addEventListenerForBindings(WTFMove(type), WTFMove(listener), WTFMove(options)); })); + auto result = JSValue::encode(WebCore::toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl->addEventListenerForBindings(WTF::move(type), WTF::move(listener), WTF::move(options)); })); RETURN_IF_EXCEPTION(throwScope, {}); vm.writeBarrier(&static_cast(*castedThis), argument1.value()); return result; @@ -1387,7 +1387,7 @@ static inline JSC::EncodedJSValue jsFunctionRemoveEventListenerBody(JSC::JSGloba EnsureStillAliveScope argument2 = callFrame->argument(2); auto options = argument2.value().isUndefined() ? false : convert, IDLBoolean>>(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, {}); - auto result = JSValue::encode(WebCore::toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl->removeEventListenerForBindings(WTFMove(type), WTFMove(listener), WTFMove(options)); })); + auto result = JSValue::encode(WebCore::toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl->removeEventListenerForBindings(WTF::move(type), WTF::move(listener), WTF::move(options)); })); RETURN_IF_EXCEPTION(throwScope, {}); vm.writeBarrier(&static_cast(*castedThis), argument1.value()); return result; @@ -1503,7 +1503,7 @@ JSC_DEFINE_HOST_FUNCTION(createWritableStreamFromInternal, (JSGlobalObject * glo auto* jsDOMGlobalObject = JSC::jsCast(globalObject); auto internalWritableStream = InternalWritableStream::fromObject(*jsDOMGlobalObject, *callFrame->uncheckedArgument(0).toObject(globalObject)); - return JSValue::encode(toJSNewlyCreated(globalObject, jsDOMGlobalObject, WritableStream::create(WTFMove(internalWritableStream)))); + return JSValue::encode(toJSNewlyCreated(globalObject, jsDOMGlobalObject, WritableStream::create(WTF::move(internalWritableStream)))); } JSC_DEFINE_HOST_FUNCTION(addAbortAlgorithmToSignal, (JSGlobalObject * globalObject, CallFrame* callFrame)) @@ -1518,7 +1518,7 @@ JSC_DEFINE_HOST_FUNCTION(addAbortAlgorithmToSignal, (JSGlobalObject * globalObje Ref abortAlgorithm = JSAbortAlgorithm::create(vm, callFrame->uncheckedArgument(1).getObject()); - auto algorithmIdentifier = AbortSignal::addAbortAlgorithmToSignal(abortSignal->wrapped(), WTFMove(abortAlgorithm)); + auto algorithmIdentifier = AbortSignal::addAbortAlgorithmToSignal(abortSignal->wrapped(), WTF::move(abortAlgorithm)); return JSValue::encode(JSC::jsNumber(algorithmIdentifier)); } @@ -3104,7 +3104,7 @@ extern "C" void JSC__JSGlobalObject__queueMicrotaskCallback(Zig::GlobalObject* g // Do not use JSCell* here because the GC will try to visit it. // Use BunInvokeJobWithArguments to pass the two arguments (ptr and callback) to the trampoline function JSC::QueuedTask task { nullptr, JSC::InternalMicrotask::BunInvokeJobWithArguments, globalObject, function, JSValue(std::bit_cast(reinterpret_cast(ptr))), JSValue(std::bit_cast(reinterpret_cast(callback))) }; - globalObject->vm().queueMicrotask(WTFMove(task)); + globalObject->vm().queueMicrotask(WTF::move(task)); } JSC::Identifier GlobalObject::moduleLoaderResolve(JSGlobalObject* jsGlobalObject, @@ -3450,7 +3450,7 @@ static JSC::JSPromise* handleResponseOnStreamingAction(JSGlobalObject* lexicalGl return promise; } - auto wrapper = WebCore::toJSNewlyCreated(globalObject, globalObject, WTFMove(compiler)); + auto wrapper = WebCore::toJSNewlyCreated(globalObject, globalObject, WTF::move(compiler)); auto builtin = globalObject->wasmStreamingConsumeStreamFunction(); auto callData = JSC::getCallData(builtin); MarkedArgumentBuffer arguments; diff --git a/src/bun.js/bindings/ZigSourceProvider.cpp b/src/bun.js/bindings/ZigSourceProvider.cpp index 021b567551..ff17060d39 100644 --- a/src/bun.js/bindings/ZigSourceProvider.cpp +++ b/src/bun.js/bindings/ZigSourceProvider.cpp @@ -110,7 +110,7 @@ Ref SourceProvider::create( toSourceOrigin(sourceURLString, isBuiltin), sourceURLString.impl(), TextPosition(), sourceType)); - provider->m_cachedBytecode = WTFMove(bytecode); + provider->m_cachedBytecode = WTF::move(bytecode); return provider; } @@ -348,11 +348,11 @@ int SourceProvider::readCache(JSC::VM& vm, const JSC::SourceCode& sourceCode) // if (fileTotalSize == 0) // return 0; - // Ref cachedBytecode = JSC::CachedBytecode::create(WTFMove(mappedFile)); + // Ref cachedBytecode = JSC::CachedBytecode::create(WTF::move(mappedFile)); // // auto key = JSC::sourceCodeKeyForSerializedModule(vm, sourceCode); // // if (isCachedBytecodeStillValid(vm, cachedBytecode.copyRef(), key, // // JSC::SourceCodeType::ModuleType)) { - // m_cachedBytecode = WTFMove(cachedBytecode); + // m_cachedBytecode = WTF::move(cachedBytecode); // return 1; // } else { // FileSystem::truncateFile(fd, 0); diff --git a/src/bun.js/bindings/ZigSourceProvider.h b/src/bun.js/bindings/ZigSourceProvider.h index 2379c883c4..b1d036791d 100644 --- a/src/bun.js/bindings/ZigSourceProvider.h +++ b/src/bun.js/bindings/ZigSourceProvider.h @@ -64,7 +64,7 @@ private: JSC::SourceTaintedOrigin taintedness, const SourceOrigin& sourceOrigin, WTF::String&& sourceURL, const TextPosition& startPosition, JSC::SourceProviderSourceType sourceType) - : Base(sourceOrigin, WTFMove(sourceURL), String(), taintedness, startPosition, sourceType) + : Base(sourceOrigin, WTF::move(sourceURL), String(), taintedness, startPosition, sourceType) , m_globalObject(globalObject) , m_source(sourceImpl) { diff --git a/src/bun.js/bindings/bindings.cpp b/src/bun.js/bindings/bindings.cpp index 0f3b3d07e7..ebaecfbe4d 100644 --- a/src/bun.js/bindings/bindings.cpp +++ b/src/bun.js/bindings/bindings.cpp @@ -722,9 +722,9 @@ bool Bun__deepEquals(JSC::JSGlobalObject* globalObject, JSValue v1, JSValue v2, ASSERT(c2); std::optional isSpecialEqual = specialObjectsDequal(globalObject, gcBuffer, stack, scope, c1, c2); RETURN_IF_EXCEPTION(scope, false); - if (isSpecialEqual.has_value()) return std::move(*isSpecialEqual); + if (isSpecialEqual.has_value()) return WTF::move(*isSpecialEqual); isSpecialEqual = specialObjectsDequal(globalObject, gcBuffer, stack, scope, c2, c1); - if (isSpecialEqual.has_value()) return std::move(*isSpecialEqual); + if (isSpecialEqual.has_value()) return WTF::move(*isSpecialEqual); JSObject* o1 = v1.getObject(); JSObject* o2 = v2.getObject(); @@ -1806,7 +1806,7 @@ WebCore::FetchHeaders* WebCore__FetchHeaders__createFromJS(JSC::JSGlobalObject* // `fill` doesn't set an exception on the VM if it fails, it returns an // ExceptionOr. So we need to check for the exception and, if set, // translate it to JSValue and throw it. - WebCore::propagateException(*lexicalGlobalObject, throwScope, headers->fill(WTFMove(init.value()))); + WebCore::propagateException(*lexicalGlobalObject, throwScope, headers->fill(WTF::move(init.value()))); // If there's an exception, it will be thrown by the above call to fill(). // in that case, let's also free the headers to make memory leaks harder. @@ -1841,7 +1841,7 @@ JSC::EncodedJSValue WebCore__FetchHeaders__clone(WebCore::FetchHeaders* headers, Zig::GlobalObject* globalObject = static_cast(arg1); auto* clone = new WebCore::FetchHeaders({ WebCore::FetchHeaders::Guard::None, {} }); WebCore::propagateException(*arg1, throwScope, clone->fill(*headers)); - return JSC::JSValue::encode(WebCore::toJSNewlyCreated(arg1, globalObject, WTFMove(clone))); + return JSC::JSValue::encode(WebCore::toJSNewlyCreated(arg1, globalObject, WTF::move(clone))); } WebCore::FetchHeaders* WebCore__FetchHeaders__cloneThis(WebCore::FetchHeaders* headers, JSC::JSGlobalObject* lexicalGlobalObject) @@ -1972,7 +1972,7 @@ WebCore::FetchHeaders* WebCore__FetchHeaders__createFromPicoHeaders_(const void* } } - headers->setInternalHeaders(WTFMove(map)); + headers->setInternalHeaders(WTF::move(map)); } return headers; } @@ -1995,12 +1995,12 @@ WebCore::FetchHeaders* WebCore__FetchHeaders__createFromUWS(void* arg1) HTTPHeaderName name; if (WebCore::findHTTPHeaderName(nameView, name)) { - map.add(name, WTFMove(value)); + map.add(name, WTF::move(value)); } else { - map.setUncommonHeader(nameView.toString().isolatedCopy(), WTFMove(value)); + map.setUncommonHeader(nameView.toString().isolatedCopy(), WTF::move(value)); } } - headers->setInternalHeaders(WTFMove(map)); + headers->setInternalHeaders(WTF::move(map)); return headers; } void WebCore__FetchHeaders__deref(WebCore::FetchHeaders* arg0) @@ -2022,7 +2022,7 @@ WebCore::FetchHeaders* WebCore__FetchHeaders__createValueNotJS(JSC::JSGlobalObje auto* headers = new WebCore::FetchHeaders({ WebCore::FetchHeaders::Guard::None, {} }); headers->relaxAdoptionRequirement(); - WebCore::propagateException(*arg0, throwScope, headers->fill(WebCore::FetchHeaders::Init(WTFMove(pairs)))); + WebCore::propagateException(*arg0, throwScope, headers->fill(WebCore::FetchHeaders::Init(WTF::move(pairs)))); if (throwScope.exception()) { headers->deref(); return nullptr; @@ -2043,9 +2043,9 @@ JSC::EncodedJSValue WebCore__FetchHeaders__createValue(JSC::JSGlobalObject* arg0 } Ref headers = WebCore::FetchHeaders::create(); - WebCore::propagateException(*arg0, throwScope, headers->fill(WebCore::FetchHeaders::Init(WTFMove(pairs)))); + WebCore::propagateException(*arg0, throwScope, headers->fill(WebCore::FetchHeaders::Init(WTF::move(pairs)))); - JSValue value = WebCore::toJSNewlyCreated(arg0, static_cast(arg0), WTFMove(headers)); + JSValue value = WebCore::toJSNewlyCreated(arg0, static_cast(arg0), WTF::move(headers)); JSFetchHeaders* fetchHeaders = jsCast(value); fetchHeaders->computeMemoryCost(); @@ -2908,7 +2908,7 @@ JSC::EncodedJSValue JSC__JSModuleLoader__evaluate(JSC::JSGlobalObject* globalObj JSC::SourceCode sourceCode = JSC::makeSource( src, JSC::SourceOrigin { origin }, JSC::SourceTaintedOrigin::Untainted, origin.fileSystemPath(), WTF::TextPosition(), JSC::SourceProviderSourceType::Module); - globalObject->moduleLoader()->provideFetch(globalObject, jsString(vm, origin.fileSystemPath()), WTFMove(sourceCode)); + globalObject->moduleLoader()->provideFetch(globalObject, jsString(vm, origin.fileSystemPath()), WTF::move(sourceCode)); auto* promise = JSC::importModule(globalObject, JSC::Identifier::fromString(vm, origin.fileSystemPath()), JSValue(jsString(vm, referrer.fileSystemPath())), JSValue(), JSValue()); auto scope = DECLARE_THROW_SCOPE(vm); @@ -3138,8 +3138,8 @@ JSC::EncodedJSValue JSC__JSGlobalObject__createAggregateError(JSC::JSGlobalObjec auto& vm = JSC::getVM(globalObject); auto scope = DECLARE_THROW_SCOPE(vm); - JSC::JSValue message = JSC::jsOwnedString(vm, Zig::toString(*arg3)); - JSC::JSValue options = JSC::jsUndefined(); + WTF::String message = Zig::toString(*arg3); + JSC::JSValue cause = JSC::jsUndefined(); JSC::JSArray* array = nullptr; { JSC::ObjectInitializationScope initializationScope(vm); @@ -3160,14 +3160,14 @@ JSC::EncodedJSValue JSC__JSGlobalObject__createAggregateError(JSC::JSGlobalObjec JSC::Structure* errorStructure = globalObject->errorStructure(JSC::ErrorType::AggregateError); - RELEASE_AND_RETURN(scope, JSC::JSValue::encode(JSC::createAggregateError(globalObject, vm, errorStructure, array, message, options, nullptr, JSC::TypeNothing, false))); + RELEASE_AND_RETURN(scope, JSC::JSValue::encode(JSC::createAggregateError(vm, errorStructure, array, message, cause, nullptr, JSC::TypeNothing, false))); } -JSC::EncodedJSValue JSC__JSGlobalObject__createAggregateErrorWithArray(JSC::JSGlobalObject* global, JSC::JSArray* array, BunString message, JSValue options) +JSC::EncodedJSValue JSC__JSGlobalObject__createAggregateErrorWithArray(JSC::JSGlobalObject* global, JSC::JSArray* array, BunString message, JSValue cause) { auto& vm = JSC::getVM(global); JSC::Structure* errorStructure = global->errorStructure(JSC::ErrorType::AggregateError); WTF::String messageString = message.toWTFString(); - return JSC::JSValue::encode(JSC::createAggregateError(global, vm, errorStructure, array, JSC::jsString(vm, messageString), options, nullptr, JSC::TypeNothing, false)); + return JSC::JSValue::encode(JSC::createAggregateError(vm, errorStructure, array, messageString, cause, nullptr, JSC::TypeNothing, false)); } JSC::EncodedJSValue ZigString__toAtomicValue(const ZigString* arg0, JSC::JSGlobalObject* arg1) @@ -3178,11 +3178,11 @@ JSC::EncodedJSValue ZigString__toAtomicValue(const ZigString* arg0, JSC::JSGloba if (isTaggedUTF16Ptr(arg0->ptr)) { if (auto impl = WTF::AtomStringImpl::lookUp(std::span { reinterpret_cast(untag(arg0->ptr)), arg0->len })) { - return JSC::JSValue::encode(JSC::jsString(arg1->vm(), WTF::String(WTFMove(impl)))); + return JSC::JSValue::encode(JSC::jsString(arg1->vm(), WTF::String(WTF::move(impl)))); } } else { if (auto impl = WTF::AtomStringImpl::lookUp(std::span { untag(arg0->ptr), arg0->len })) { - return JSC::JSValue::encode(JSC::jsString(arg1->vm(), WTF::String(WTFMove(impl)))); + return JSC::JSValue::encode(JSC::jsString(arg1->vm(), WTF::String(WTF::move(impl)))); } } @@ -3203,7 +3203,7 @@ JSC::EncodedJSValue ZigString__toExternalU16(const uint16_t* arg0, size_t len, J auto ref = String(ExternalStringImpl::create({ reinterpret_cast(arg0), len }, reinterpret_cast(const_cast(arg0)), free_global_string)); - return JSC::JSValue::encode(JSC::jsString(global->vm(), WTFMove(ref))); + return JSC::JSValue::encode(JSC::jsString(global->vm(), WTF::move(ref))); } // This must be a globally allocated string @@ -3215,10 +3215,10 @@ JSC::EncodedJSValue ZigString__toExternalU16(const uint16_t* arg0, size_t len, J } if (Zig::isTaggedUTF16Ptr(str.ptr)) { auto ref = String(ExternalStringImpl::create({ reinterpret_cast(Zig::untag(str.ptr)), str.len }, Zig::untagVoid(str.ptr), free_global_string)); - return JSC::JSValue::encode(JSC::jsString(arg1->vm(), WTFMove(ref))); + return JSC::JSValue::encode(JSC::jsString(arg1->vm(), WTF::move(ref))); } else { auto ref = String(ExternalStringImpl::create({ Zig::untag(str.ptr), str.len }, Zig::untagVoid(str.ptr), free_global_string)); - return JSC::JSValue::encode(JSC::jsString(arg1->vm(), WTFMove(ref))); + return JSC::JSValue::encode(JSC::jsString(arg1->vm(), WTF::move(ref))); } } @@ -3525,7 +3525,7 @@ void JSC__JSPromise__rejectOnNextTickWithHandled(JSC::JSPromise* promise, JSC::J } JSC::QueuedTask task { nullptr, JSC::InternalMicrotask::BunPerformMicrotaskJob, globalObject, microtaskFunction, rejectPromiseFunction, globalObject->m_asyncContextData.get()->getInternalField(0), promise, value }; - globalObject->vm().queueMicrotask(WTFMove(task)); + globalObject->vm().queueMicrotask(WTF::move(task)); RETURN_IF_EXCEPTION(scope, ); } } @@ -5412,8 +5412,8 @@ extern "C" void JSC__JSGlobalObject__queueMicrotaskJob(JSC::JSGlobalObject* arg0 #endif - JSC::QueuedTask task { nullptr, JSC::InternalMicrotask::BunPerformMicrotaskJob, globalObject, microTaskFunction, WTFMove(microtaskArgs[0]), WTFMove(microtaskArgs[1]), WTFMove(microtaskArgs[2]), WTFMove(microtaskArgs[3]) }; - globalObject->vm().queueMicrotask(WTFMove(task)); + JSC::QueuedTask task { nullptr, JSC::InternalMicrotask::BunPerformMicrotaskJob, globalObject, microTaskFunction, WTF::move(microtaskArgs[0]), WTF::move(microtaskArgs[1]), WTF::move(microtaskArgs[2]), WTF::move(microtaskArgs[3]) }; + globalObject->vm().queueMicrotask(WTF::move(task)); } extern "C" WebCore::AbortSignal* WebCore__AbortSignal__new(JSC::JSGlobalObject* globalObject) @@ -5430,7 +5430,7 @@ extern "C" JSC::EncodedJSValue WebCore__AbortSignal__create(JSC::JSGlobalObject* auto* context = thisObject->scriptExecutionContext(); auto abortSignal = WebCore::AbortSignal::create(context); - return JSValue::encode(toJSNewlyCreated>(*globalObject, *jsCast(globalObject), WTFMove(abortSignal))); + return JSValue::encode(toJSNewlyCreated>(*globalObject, *jsCast(globalObject), WTF::move(abortSignal))); } extern "C" JSC::EncodedJSValue WebCore__AbortSignal__toJS(WebCore::AbortSignal* arg0, JSC::JSGlobalObject* globalObject) { @@ -5697,15 +5697,15 @@ CPP_DECL JSC::EncodedJSValue WebCore__DOMFormData__createFromURLQuery(JSC::JSGlo auto scope = DECLARE_THROW_SCOPE(globalObject->vm()); return Bun::ERR::STRING_TOO_LONG(scope, globalObject); } - auto formData = DOMFormData::create(globalObject->scriptExecutionContext(), WTFMove(str)); - return JSValue::encode(toJSNewlyCreated(arg0, globalObject, WTFMove(formData))); + auto formData = DOMFormData::create(globalObject->scriptExecutionContext(), WTF::move(str)); + return JSValue::encode(toJSNewlyCreated(arg0, globalObject, WTF::move(formData))); } CPP_DECL JSC::EncodedJSValue WebCore__DOMFormData__create(JSC::JSGlobalObject* arg0) { Zig::GlobalObject* globalObject = static_cast(arg0); auto formData = DOMFormData::create(globalObject->scriptExecutionContext()); - return JSValue::encode(toJSNewlyCreated(arg0, globalObject, WTFMove(formData))); + return JSValue::encode(toJSNewlyCreated(arg0, globalObject, WTF::move(formData))); } CPP_DECL WebCore::DOMFormData* WebCore__DOMFormData__fromJS(JSC::EncodedJSValue JSValue1) diff --git a/src/bun.js/bindings/helpers.h b/src/bun.js/bindings/helpers.h index 4e69126a00..16411881e0 100644 --- a/src/bun.js/bindings/helpers.h +++ b/src/bun.js/bindings/helpers.h @@ -208,14 +208,14 @@ static const WTF::String toStringCopy(ZigString str) return WTF::String(); } memcpy(out.data(), untag(str.ptr), str.len * sizeof(char16_t)); - return WTF::String(WTFMove(impl)); + return WTF::String(WTF::move(impl)); } else { std::span out; auto impl = WTF::StringImpl::tryCreateUninitialized(str.len, out); if (!impl) [[unlikely]] return WTF::String(); memcpy(out.data(), untag(str.ptr), str.len * sizeof(Latin1Character)); - return WTF::String(WTFMove(impl)); + return WTF::String(WTF::move(impl)); } } diff --git a/src/bun.js/bindings/napi.cpp b/src/bun.js/bindings/napi.cpp index c68618adf3..447287be0e 100644 --- a/src/bun.js/bindings/napi.cpp +++ b/src/bun.js/bindings/napi.cpp @@ -606,7 +606,7 @@ extern "C" napi_status napi_set_named_property(napi_env env, napi_value object, JSC::EnsureStillAliveScope ensureAlive2(target); auto nameStr = WTF::String::fromUTF8({ utf8name, strlen(utf8name) }); - auto name = JSC::PropertyName(JSC::Identifier::fromString(vm, WTFMove(nameStr))); + auto name = JSC::PropertyName(JSC::Identifier::fromString(vm, WTF::move(nameStr))); PutPropertySlot slot(target, false); target->putInline(globalObject, name, jsValue, slot); @@ -632,7 +632,7 @@ extern "C" napi_status napi_create_arraybuffer(napi_env env, return napi_set_last_error(env, napi_generic_failure); } - auto* jsArrayBuffer = JSC::JSArrayBuffer::create(vm, globalObject->arrayBufferStructure(), WTFMove(arrayBuffer)); + auto* jsArrayBuffer = JSC::JSArrayBuffer::create(vm, globalObject->arrayBufferStructure(), WTF::move(arrayBuffer)); NAPI_RETURN_IF_EXCEPTION(env); if (data && jsArrayBuffer->impl()) [[likely]] { @@ -1451,7 +1451,7 @@ node_api_create_external_string_latin1(napi_env env, }); Zig::GlobalObject* globalObject = toJS(env); - JSString* out = JSC::jsString(JSC::getVM(globalObject), WTF::String(WTFMove(impl))); + JSString* out = JSC::jsString(JSC::getVM(globalObject), WTF::String(WTF::move(impl))); ensureStillAliveHere(out); *result = toNapi(out, globalObject); ensureStillAliveHere(out); @@ -1487,7 +1487,7 @@ node_api_create_external_string_utf16(napi_env env, }); Zig::GlobalObject* globalObject = toJS(env); - JSString* out = JSC::jsString(JSC::getVM(globalObject), WTF::String(WTFMove(impl))); + JSString* out = JSC::jsString(JSC::getVM(globalObject), WTF::String(WTF::move(impl))); ensureStillAliveHere(out); *result = toNapi(out, globalObject); ensureStillAliveHere(out); @@ -1714,27 +1714,27 @@ static JSC::JSArrayBufferView* createArrayBufferView( Structure* structure = globalObject->typedArrayStructure(getTypedArrayTypeFromNAPI(type), arrayBuffer->isResizableOrGrowableShared()); switch (type) { case napi_int8_array: - return JSC::JSInt8Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length); + return JSC::JSInt8Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length); case napi_uint8_array: - return JSC::JSUint8Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length); + return JSC::JSUint8Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length); case napi_uint8_clamped_array: - return JSC::JSUint8ClampedArray::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length); + return JSC::JSUint8ClampedArray::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length); case napi_int16_array: - return JSC::JSInt16Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length); + return JSC::JSInt16Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length); case napi_uint16_array: - return JSC::JSUint16Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length); + return JSC::JSUint16Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length); case napi_int32_array: - return JSC::JSInt32Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length); + return JSC::JSInt32Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length); case napi_uint32_array: - return JSC::JSUint32Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length); + return JSC::JSUint32Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length); case napi_float32_array: - return JSC::JSFloat32Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length); + return JSC::JSFloat32Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length); case napi_float64_array: - return JSC::JSFloat64Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length); + return JSC::JSFloat64Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length); case napi_bigint64_array: - return JSC::JSBigInt64Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length); + return JSC::JSBigInt64Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length); case napi_biguint64_array: - return JSC::JSBigUint64Array::create(globalObject, structure, WTFMove(arrayBuffer), byteOffset, length); + return JSC::JSBigUint64Array::create(globalObject, structure, WTF::move(arrayBuffer), byteOffset, length); default: ASSERT_NOT_REACHED_WITH_MESSAGE("Unexpected napi_typedarray_type"); } @@ -2031,7 +2031,7 @@ extern "C" napi_status napi_create_external_buffer(napi_env env, size_t length, // TODO: is there a way to create a detached uint8 array? auto arrayBuffer = JSC::ArrayBuffer::createUninitialized(0, 1); - auto* buffer = JSC::JSUint8Array::create(globalObject, subclassStructure, WTFMove(arrayBuffer), 0, 0); + auto* buffer = JSC::JSUint8Array::create(globalObject, subclassStructure, WTF::move(arrayBuffer), 0, 0); NAPI_RETURN_IF_EXCEPTION(env); buffer->existingBuffer()->detach(vm); @@ -2048,7 +2048,7 @@ extern "C" napi_status napi_create_external_buffer(napi_env env, size_t length, // do nothing })); - auto* buffer = JSC::JSUint8Array::create(globalObject, subclassStructure, WTFMove(arrayBuffer), 0, length); + auto* buffer = JSC::JSUint8Array::create(globalObject, subclassStructure, WTF::move(arrayBuffer), 0, length); NAPI_RETURN_IF_EXCEPTION(env); // setup finalizer after creating the array. if it throws callers of napi_create_external_buffer are expected @@ -2076,7 +2076,7 @@ extern "C" napi_status napi_create_external_arraybuffer(napi_env env, void* exte env->doFinalizer(finalize_cb, p, finalize_hint); })); - auto* buffer = JSC::JSArrayBuffer::create(vm, globalObject->arrayBufferStructure(ArrayBufferSharingMode::Default), WTFMove(arrayBuffer)); + auto* buffer = JSC::JSArrayBuffer::create(vm, globalObject->arrayBufferStructure(ArrayBufferSharingMode::Default), WTF::move(arrayBuffer)); *result = toNapi(buffer, globalObject); NAPI_RETURN_SUCCESS(env); diff --git a/src/bun.js/bindings/napi.h b/src/bun.js/bindings/napi.h index 56346cd019..30efadbcdd 100644 --- a/src/bun.js/bindings/napi.h +++ b/src/bun.js/bindings/napi.h @@ -669,7 +669,7 @@ public: NapiRef(Ref&& env, uint32_t count, Bun::NapiFinalizer finalizer) : env(env) , globalObject(JSC::Weak(env->globalObject())) - , finalizer(WTFMove(finalizer)) + , finalizer(WTF::move(finalizer)) , refCount(count) { } diff --git a/src/bun.js/bindings/ncrypto.cpp b/src/bun.js/bindings/ncrypto.cpp index 446ee74a64..e1e747ed78 100644 --- a/src/bun.js/bindings/ncrypto.cpp +++ b/src/bun.js/bindings/ncrypto.cpp @@ -206,7 +206,7 @@ DataPointer& DataPointer::operator=(DataPointer&& other) noexcept { if (this == &other) return *this; this->~DataPointer(); - return *new (this) DataPointer(WTFMove(other)); + return *new (this) DataPointer(WTF::move(other)); } DataPointer::~DataPointer() @@ -337,7 +337,7 @@ BignumPointer& BignumPointer::operator=(BignumPointer&& other) noexcept { if (this == &other) return *this; this->~BignumPointer(); - return *new (this) BignumPointer(WTFMove(other)); + return *new (this) BignumPointer(WTF::move(other)); } BignumPointer::~BignumPointer() @@ -515,7 +515,7 @@ BignumPointer BignumPointer::NewPrime(const PrimeConfig& params, PrimeCheckCallback cb) { BignumPointer prime(BN_new()); - if (!prime || !prime.generate(params, WTFMove(cb))) { + if (!prime || !prime.generate(params, WTF::move(cb))) { return {}; } return prime; @@ -1039,7 +1039,7 @@ X509Pointer& X509Pointer::operator=(X509Pointer&& other) noexcept { if (this == &other) return *this; this->~X509Pointer(); - return *new (this) X509Pointer(WTFMove(other)); + return *new (this) X509Pointer(WTF::move(other)); } X509Pointer::~X509Pointer() @@ -1276,7 +1276,7 @@ X509View::CheckMatch X509View::checkHost(const std::span host, case 1: { if (peername != nullptr) { DataPointer name(peername, strlen(peername)); - if (peerName != nullptr) *peerName = WTFMove(name); + if (peerName != nullptr) *peerName = WTF::move(name); } return CheckMatch::MATCH; } @@ -1384,11 +1384,11 @@ Result X509Pointer::Parse( X509Pointer pem( PEM_read_bio_X509_AUX(bio.get(), nullptr, NoPasswordCallback, nullptr)); - if (pem) return Result(WTFMove(pem)); + if (pem) return Result(WTF::move(pem)); BIO_reset(bio.get()); X509Pointer der(d2i_X509_bio(bio.get(), nullptr)); - if (der) return Result(WTFMove(der)); + if (der) return Result(WTF::move(der)); return Result(ERR_get_error()); } @@ -1537,7 +1537,7 @@ BIOPointer& BIOPointer::operator=(BIOPointer&& other) noexcept { if (this == &other) return *this; this->~BIOPointer(); - return *new (this) BIOPointer(WTFMove(other)); + return *new (this) BIOPointer(WTF::move(other)); } BIOPointer::~BIOPointer() @@ -1638,7 +1638,7 @@ DHPointer& DHPointer::operator=(DHPointer&& other) noexcept { if (this == &other) return *this; this->~DHPointer(); - return *new (this) DHPointer(WTFMove(other)); + return *new (this) DHPointer(WTF::move(other)); } DHPointer::~DHPointer() @@ -1695,7 +1695,7 @@ DHPointer DHPointer::FromGroup(const WTF::StringView name, auto generator = GetStandardGenerator(); if (!generator) return {}; // Unable to create the generator. - return New(WTFMove(group), WTFMove(generator)); + return New(WTF::move(group), WTF::move(generator)); } DHPointer DHPointer::New(BignumPointer&& p, BignumPointer&& g) @@ -2131,7 +2131,7 @@ EVPKeyPointer::PrivateKeyEncodingConfig::PrivateKeyEncodingConfig( auto& otherPassphrase = other.passphrase.value(); auto newPassphrase = DataPointer::Alloc(otherPassphrase.size()); memcpy(newPassphrase.get(), otherPassphrase.get(), otherPassphrase.size()); - passphrase = WTFMove(newPassphrase); + passphrase = WTF::move(newPassphrase); } } @@ -2209,7 +2209,7 @@ EVPKeyPointer& EVPKeyPointer::operator=(EVPKeyPointer&& other) noexcept { if (this == &other) return *this; this->~EVPKeyPointer(); - return *new (this) EVPKeyPointer(WTFMove(other)); + return *new (this) EVPKeyPointer(WTF::move(other)); } EVPKeyPointer::~EVPKeyPointer() @@ -2361,7 +2361,7 @@ EVPKeyPointer::ParseKeyResult TryParsePublicKeyInner(const BIOPointer& bp, EVPKeyPointer pkey(parse(&p, der_len)); if (!pkey) return EVPKeyPointer::ParseKeyResult(EVPKeyPointer::PKParseError::FAILED); - return EVPKeyPointer::ParseKeyResult(WTFMove(pkey)); + return EVPKeyPointer::ParseKeyResult(WTF::move(pkey)); } constexpr bool IsASN1Sequence(const unsigned char* data, @@ -2523,7 +2523,7 @@ EVPKeyPointer::ParseKeyResult EVPKeyPointer::TryParsePrivateKey( return ParseKeyResult(PKParseError::FAILED, err); } if (!pkey) return ParseKeyResult(PKParseError::FAILED); - return ParseKeyResult(WTFMove(pkey)); + return ParseKeyResult(WTF::move(pkey)); }; auto bio = BIOPointer::New(buffer); @@ -2865,7 +2865,7 @@ SSLPointer& SSLPointer::operator=(SSLPointer&& other) noexcept { if (this == &other) return *this; this->~SSLPointer(); - return *new (this) SSLPointer(WTFMove(other)); + return *new (this) SSLPointer(WTF::move(other)); } SSLPointer::~SSLPointer() @@ -3092,7 +3092,7 @@ SSLCtxPointer& SSLCtxPointer::operator=(SSLCtxPointer&& other) noexcept { if (this == &other) return *this; this->~SSLCtxPointer(); - return *new (this) SSLCtxPointer(WTFMove(other)); + return *new (this) SSLCtxPointer(WTF::move(other)); } SSLCtxPointer::~SSLCtxPointer() @@ -3400,7 +3400,7 @@ CipherCtxPointer& CipherCtxPointer::operator=( { if (this == &other) return *this; this->~CipherCtxPointer(); - return *new (this) CipherCtxPointer(WTFMove(other)); + return *new (this) CipherCtxPointer(WTF::move(other)); } CipherCtxPointer::~CipherCtxPointer() @@ -4470,7 +4470,7 @@ void Cipher::ForEach(Cipher::CipherNameCallback&& callback) { ClearErrorOnReturn clearErrorOnReturn; CipherCallbackContext context; - context.cb = WTFMove(callback); + context.cb = WTF::move(callback); EVP_CIPHER_do_all_sorted( #if OPENSSL_VERSION_MAJOR >= 3 @@ -4885,7 +4885,7 @@ std::pair X509Name::Iterator::operator*() const int value_str_size = ASN1_STRING_to_UTF8(&value_str, value); return { - WTFMove(name_str), + WTF::move(name_str), WTF::String::fromUTF8(std::span(value_str, value_str_size)), }; } diff --git a/src/bun.js/bindings/ncrypto.h b/src/bun.js/bindings/ncrypto.h index 3a5e2307f5..358b89d58e 100644 --- a/src/bun.js/bindings/ncrypto.h +++ b/src/bun.js/bindings/ncrypto.h @@ -182,13 +182,13 @@ struct Result final { std::optional openssl_error = std::nullopt; Result(T&& value) : has_value(true) - , value(WTFMove(value)) + , value(WTF::move(value)) { } Result(E&& error, std::optional openssl_error = std::nullopt) : has_value(false) - , error(WTFMove(error)) - , openssl_error(WTFMove(openssl_error)) + , error(WTF::move(error)) + , openssl_error(WTF::move(openssl_error)) { } inline operator bool() const { return has_value; } diff --git a/src/bun.js/bindings/node/crypto/CryptoDhJob.cpp b/src/bun.js/bindings/node/crypto/CryptoDhJob.cpp index e0f0ea144a..b6f50aa61f 100644 --- a/src/bun.js/bindings/node/crypto/CryptoDhJob.cpp +++ b/src/bun.js/bindings/node/crypto/CryptoDhJob.cpp @@ -64,7 +64,7 @@ void DhJobCtx::runFromJS(JSGlobalObject* lexicalGlobalObject, JSValue callback) extern "C" DhJob* Bun__DhJob__create(JSGlobalObject* globalObject, DhJobCtx* ctx, EncodedJSValue callback); DhJob* DhJob::create(JSGlobalObject* globalObject, DhJobCtx&& ctx, JSValue callback) { - DhJobCtx* ctxCopy = new DhJobCtx(WTFMove(ctx)); + DhJobCtx* ctxCopy = new DhJobCtx(WTF::move(ctx)); return Bun__DhJob__create(globalObject, ctxCopy, JSValue::encode(callback)); } @@ -77,7 +77,7 @@ void DhJob::schedule() extern "C" void Bun__DhJob__createAndSchedule(JSGlobalObject* globalObject, DhJobCtx* ctx, EncodedJSValue callback); void DhJob::createAndSchedule(JSGlobalObject* globalObject, DhJobCtx&& ctx, JSValue callback) { - DhJobCtx* ctxCopy = new DhJobCtx(WTFMove(ctx)); + DhJobCtx* ctxCopy = new DhJobCtx(WTF::move(ctx)); Bun__DhJob__createAndSchedule(globalObject, ctxCopy, JSValue::encode(callback)); } @@ -152,7 +152,7 @@ JSC_DEFINE_HOST_FUNCTION(jsDiffieHellman, (JSGlobalObject * lexicalGlobalObject, RETURN_IF_EXCEPTION(scope, {}); if (!callbackValue.isUndefined()) { - DhJob::createAndSchedule(lexicalGlobalObject, WTFMove(*ctx), callbackValue); + DhJob::createAndSchedule(lexicalGlobalObject, WTF::move(*ctx), callbackValue); return JSValue::encode(jsUndefined()); } diff --git a/src/bun.js/bindings/node/crypto/CryptoDhJob.h b/src/bun.js/bindings/node/crypto/CryptoDhJob.h index cb2f04e83a..575597d5e5 100644 --- a/src/bun.js/bindings/node/crypto/CryptoDhJob.h +++ b/src/bun.js/bindings/node/crypto/CryptoDhJob.h @@ -13,15 +13,15 @@ struct DhJobCtx { public: DhJobCtx(RefPtr&& privateKey, RefPtr&& publicKey) - : m_privateKey(WTFMove(privateKey)) - , m_publicKey(WTFMove(publicKey)) + : m_privateKey(WTF::move(privateKey)) + , m_publicKey(WTF::move(publicKey)) { } DhJobCtx(DhJobCtx&& other) - : m_privateKey(WTFMove(other.m_privateKey)) - , m_publicKey(WTFMove(other.m_publicKey)) - , m_result(WTFMove(other.m_result)) + : m_privateKey(WTF::move(other.m_privateKey)) + , m_publicKey(WTF::move(other.m_publicKey)) + , m_result(WTF::move(other.m_result)) { } diff --git a/src/bun.js/bindings/node/crypto/CryptoGenDhKeyPair.cpp b/src/bun.js/bindings/node/crypto/CryptoGenDhKeyPair.cpp index b73602daf1..58cb7a6192 100644 --- a/src/bun.js/bindings/node/crypto/CryptoGenDhKeyPair.cpp +++ b/src/bun.js/bindings/node/crypto/CryptoGenDhKeyPair.cpp @@ -33,7 +33,7 @@ extern "C" void Bun__DhKeyPairJobCtx__runFromJS(DhKeyPairJobCtx* ctx, JSGlobalOb extern "C" DhKeyPairJob* Bun__DhKeyPairJob__create(JSGlobalObject* globalObject, DhKeyPairJobCtx* ctx, EncodedJSValue callback); DhKeyPairJob* DhKeyPairJob::create(JSGlobalObject* globalObject, DhKeyPairJobCtx&& ctx, JSValue callback) { - DhKeyPairJobCtx* ctxCopy = new DhKeyPairJobCtx(WTFMove(ctx)); + DhKeyPairJobCtx* ctxCopy = new DhKeyPairJobCtx(WTF::move(ctx)); return Bun__DhKeyPairJob__create(globalObject, ctxCopy, JSValue::encode(callback)); } @@ -46,7 +46,7 @@ void DhKeyPairJob::schedule() extern "C" void Bun__DhKeyPairJob__createAndSchedule(JSGlobalObject* globalObject, DhKeyPairJobCtx* ctx, EncodedJSValue callback); void DhKeyPairJob::createAndSchedule(JSGlobalObject* globalObject, DhKeyPairJobCtx&& ctx, JSValue callback) { - DhKeyPairJobCtx* ctxCopy = new DhKeyPairJobCtx(WTFMove(ctx)); + DhKeyPairJobCtx* ctxCopy = new DhKeyPairJobCtx(WTF::move(ctx)); Bun__DhKeyPairJob__createAndSchedule(globalObject, ctxCopy, JSValue::encode(callback)); } @@ -61,13 +61,13 @@ ncrypto::EVPKeyCtxPointer DhKeyPairJobCtx::setup() m_opensslError = ERR_get_error(); return {}; } - auto dh = ncrypto::DHPointer::New(WTFMove(prime), WTFMove(bnG)); + auto dh = ncrypto::DHPointer::New(WTF::move(prime), WTF::move(bnG)); if (!dh) { m_opensslError = ERR_get_error(); return {}; } - keyParams = ncrypto::EVPKeyPointer::NewDH(WTFMove(dh)); + keyParams = ncrypto::EVPKeyPointer::NewDH(WTF::move(dh)); } else if (std::get_if(&m_prime)) { auto paramCtx = ncrypto::EVPKeyCtxPointer::NewFromID(EVP_PKEY_DH); @@ -139,7 +139,7 @@ std::optional DhKeyPairJobCtx::fromJS(JSGlobalObject* globalObj } return DhKeyPairJobCtx( - WTFMove(group), + WTF::move(group), config); } diff --git a/src/bun.js/bindings/node/crypto/CryptoGenDhKeyPair.h b/src/bun.js/bindings/node/crypto/CryptoGenDhKeyPair.h index 845cb4b90c..9ea6fa7cea 100644 --- a/src/bun.js/bindings/node/crypto/CryptoGenDhKeyPair.h +++ b/src/bun.js/bindings/node/crypto/CryptoGenDhKeyPair.h @@ -12,7 +12,7 @@ struct DhKeyPairJobCtx : KeyPairJobCtx { public: DhKeyPairJobCtx(ncrypto::DHPointer&& group, const KeyEncodingConfig& config) : KeyPairJobCtx(config.publicKeyEncoding, config.privateKeyEncoding) - , m_prime(WTFMove(group)) + , m_prime(WTF::move(group)) { } @@ -25,7 +25,7 @@ public: DhKeyPairJobCtx(ncrypto::BignumPointer&& prime, const KeyEncodingConfig& config) : KeyPairJobCtx(config.publicKeyEncoding, config.privateKeyEncoding) - , m_prime(WTFMove(prime)) + , m_prime(WTF::move(prime)) { } diff --git a/src/bun.js/bindings/node/crypto/CryptoGenDsaKeyPair.cpp b/src/bun.js/bindings/node/crypto/CryptoGenDsaKeyPair.cpp index 2eb41bae02..23b38a6f4a 100644 --- a/src/bun.js/bindings/node/crypto/CryptoGenDsaKeyPair.cpp +++ b/src/bun.js/bindings/node/crypto/CryptoGenDsaKeyPair.cpp @@ -32,7 +32,7 @@ extern "C" void Bun__DsaKeyPairJobCtx__runFromJS(DsaKeyPairJobCtx* ctx, JSGlobal extern "C" DsaKeyPairJob* Bun__DsaKeyPairJob__create(JSGlobalObject* globalObject, DsaKeyPairJobCtx* ctx, EncodedJSValue callback); DsaKeyPairJob* DsaKeyPairJob::create(JSGlobalObject* globalObject, DsaKeyPairJobCtx&& ctx, JSValue callback) { - DsaKeyPairJobCtx* ctxCopy = new DsaKeyPairJobCtx(WTFMove(ctx)); + DsaKeyPairJobCtx* ctxCopy = new DsaKeyPairJobCtx(WTF::move(ctx)); return Bun__DsaKeyPairJob__create(globalObject, ctxCopy, JSValue::encode(callback)); } @@ -45,7 +45,7 @@ void DsaKeyPairJob::schedule() extern "C" void Bun__DsaKeyPairJob__createAndSchedule(JSGlobalObject* globalObject, DsaKeyPairJobCtx* ctx, EncodedJSValue callback); void DsaKeyPairJob::createAndSchedule(JSGlobalObject* globalObject, DsaKeyPairJobCtx&& ctx, JSValue callback) { - DsaKeyPairJobCtx* ctxCopy = new DsaKeyPairJobCtx(WTFMove(ctx)); + DsaKeyPairJobCtx* ctxCopy = new DsaKeyPairJobCtx(WTF::move(ctx)); Bun__DsaKeyPairJob__createAndSchedule(globalObject, ctxCopy, JSValue::encode(callback)); } diff --git a/src/bun.js/bindings/node/crypto/CryptoGenEcKeyPair.cpp b/src/bun.js/bindings/node/crypto/CryptoGenEcKeyPair.cpp index 854a55457c..17614c93ee 100644 --- a/src/bun.js/bindings/node/crypto/CryptoGenEcKeyPair.cpp +++ b/src/bun.js/bindings/node/crypto/CryptoGenEcKeyPair.cpp @@ -33,7 +33,7 @@ extern "C" void Bun__EcKeyPairJobCtx__runFromJS(EcKeyPairJobCtx* ctx, JSGlobalOb extern "C" EcKeyPairJob* Bun__EcKeyPairJob__create(JSGlobalObject* globalObject, EcKeyPairJobCtx* ctx, EncodedJSValue callback); EcKeyPairJob* EcKeyPairJob::create(JSGlobalObject* globalObject, EcKeyPairJobCtx&& ctx, JSValue callback) { - EcKeyPairJobCtx* ctxCopy = new EcKeyPairJobCtx(WTFMove(ctx)); + EcKeyPairJobCtx* ctxCopy = new EcKeyPairJobCtx(WTF::move(ctx)); return Bun__EcKeyPairJob__create(globalObject, ctxCopy, JSValue::encode(callback)); } @@ -46,7 +46,7 @@ void EcKeyPairJob::schedule() extern "C" void Bun__EcKeyPairJob__createAndSchedule(JSGlobalObject* globalObject, EcKeyPairJobCtx* ctx, EncodedJSValue callback); void EcKeyPairJob::createAndSchedule(JSGlobalObject* globalObject, EcKeyPairJobCtx&& ctx, JSValue callback) { - EcKeyPairJobCtx* ctxCopy = new EcKeyPairJobCtx(WTFMove(ctx)); + EcKeyPairJobCtx* ctxCopy = new EcKeyPairJobCtx(WTF::move(ctx)); Bun__EcKeyPairJob__createAndSchedule(globalObject, ctxCopy, JSValue::encode(callback)); } diff --git a/src/bun.js/bindings/node/crypto/CryptoGenKeyPair.cpp b/src/bun.js/bindings/node/crypto/CryptoGenKeyPair.cpp index 004168bad7..a551f1fbba 100644 --- a/src/bun.js/bindings/node/crypto/CryptoGenKeyPair.cpp +++ b/src/bun.js/bindings/node/crypto/CryptoGenKeyPair.cpp @@ -26,7 +26,7 @@ void KeyPairJobCtx::runTask(JSGlobalObject* globalObject, ncrypto::EVPKeyCtxPoin } ncrypto::EVPKeyPointer key = ncrypto::EVPKeyPointer(pkey); - m_keyObj = KeyObject::create(CryptoKeyType::Private, WTFMove(key)); + m_keyObj = KeyObject::create(CryptoKeyType::Private, WTF::move(key)); } void KeyPairJobCtx::runFromJS(JSGlobalObject* lexicalGlobalObject, JSValue callback) @@ -150,21 +150,21 @@ JSC_DEFINE_HOST_FUNCTION(jsGenerateKeyPair, (JSC::JSGlobalObject * globalObject, std::optional ctx = RsaKeyPairJobCtx::fromJS(globalObject, scope, typeView, optionsValue, config); EXCEPTION_ASSERT(ctx.has_value() == !scope.exception()); RETURN_IF_EXCEPTION(scope, {}); - RsaKeyPairJob::createAndSchedule(globalObject, WTFMove(*ctx), callbackValue); + RsaKeyPairJob::createAndSchedule(globalObject, WTF::move(*ctx), callbackValue); return JSValue::encode(jsUndefined()); } if (typeView == "dsa"_s) { std::optional ctx = DsaKeyPairJobCtx::fromJS(globalObject, scope, typeView, optionsValue, config); EXCEPTION_ASSERT(ctx.has_value() == !scope.exception()); RETURN_IF_EXCEPTION(scope, {}); - DsaKeyPairJob::createAndSchedule(globalObject, WTFMove(*ctx), callbackValue); + DsaKeyPairJob::createAndSchedule(globalObject, WTF::move(*ctx), callbackValue); return JSValue::encode(jsUndefined()); } if (typeView == "ec"_s) { std::optional ctx = EcKeyPairJobCtx::fromJS(globalObject, scope, typeView, optionsValue, config); EXCEPTION_ASSERT(ctx.has_value() == !scope.exception()); RETURN_IF_EXCEPTION(scope, {}); - EcKeyPairJob::createAndSchedule(globalObject, WTFMove(*ctx), callbackValue); + EcKeyPairJob::createAndSchedule(globalObject, WTF::move(*ctx), callbackValue); return JSValue::encode(jsUndefined()); } // TODO: should just get `id` here @@ -172,14 +172,14 @@ JSC_DEFINE_HOST_FUNCTION(jsGenerateKeyPair, (JSC::JSGlobalObject * globalObject, std::optional ctx = NidKeyPairJobCtx::fromJS(globalObject, scope, typeView, optionsValue, config); EXCEPTION_ASSERT(ctx.has_value() == !scope.exception()); RETURN_IF_EXCEPTION(scope, {}); - NidKeyPairJob::createAndSchedule(globalObject, WTFMove(*ctx), callbackValue); + NidKeyPairJob::createAndSchedule(globalObject, WTF::move(*ctx), callbackValue); return JSValue::encode(jsUndefined()); } if (typeView == "dh"_s) { std::optional ctx = DhKeyPairJobCtx::fromJS(globalObject, scope, typeView, optionsValue, config); EXCEPTION_ASSERT(ctx.has_value() == !scope.exception()); RETURN_IF_EXCEPTION(scope, {}); - DhKeyPairJob::createAndSchedule(globalObject, WTFMove(*ctx), callbackValue); + DhKeyPairJob::createAndSchedule(globalObject, WTF::move(*ctx), callbackValue); return JSValue::encode(jsUndefined()); } diff --git a/src/bun.js/bindings/node/crypto/CryptoGenNidKeyPair.cpp b/src/bun.js/bindings/node/crypto/CryptoGenNidKeyPair.cpp index 6d7a3c4bbd..eb10af213a 100644 --- a/src/bun.js/bindings/node/crypto/CryptoGenNidKeyPair.cpp +++ b/src/bun.js/bindings/node/crypto/CryptoGenNidKeyPair.cpp @@ -33,7 +33,7 @@ extern "C" void Bun__NidKeyPairJobCtx__runFromJS(NidKeyPairJobCtx* ctx, JSGlobal extern "C" NidKeyPairJob* Bun__NidKeyPairJob__create(JSGlobalObject* globalObject, NidKeyPairJobCtx* ctx, EncodedJSValue callback); NidKeyPairJob* NidKeyPairJob::create(JSGlobalObject* globalObject, NidKeyPairJobCtx&& ctx, JSValue callback) { - NidKeyPairJobCtx* ctxCopy = new NidKeyPairJobCtx(WTFMove(ctx)); + NidKeyPairJobCtx* ctxCopy = new NidKeyPairJobCtx(WTF::move(ctx)); return Bun__NidKeyPairJob__create(globalObject, ctxCopy, JSValue::encode(callback)); } @@ -46,7 +46,7 @@ void NidKeyPairJob::schedule() extern "C" void Bun__NidKeyPairJob__createAndSchedule(JSGlobalObject* globalObject, NidKeyPairJobCtx* ctx, EncodedJSValue callback); void NidKeyPairJob::createAndSchedule(JSGlobalObject* globalObject, NidKeyPairJobCtx&& ctx, JSValue callback) { - NidKeyPairJobCtx* ctxCopy = new NidKeyPairJobCtx(WTFMove(ctx)); + NidKeyPairJobCtx* ctxCopy = new NidKeyPairJobCtx(WTF::move(ctx)); Bun__NidKeyPairJob__createAndSchedule(globalObject, ctxCopy, JSValue::encode(callback)); } diff --git a/src/bun.js/bindings/node/crypto/CryptoGenRsaKeyPair.cpp b/src/bun.js/bindings/node/crypto/CryptoGenRsaKeyPair.cpp index 49a683ad9b..856f11f393 100644 --- a/src/bun.js/bindings/node/crypto/CryptoGenRsaKeyPair.cpp +++ b/src/bun.js/bindings/node/crypto/CryptoGenRsaKeyPair.cpp @@ -34,7 +34,7 @@ extern "C" void Bun__RsaKeyPairJobCtx__runFromJS(RsaKeyPairJobCtx* ctx, JSGlobal extern "C" RsaKeyPairJob* Bun__RsaKeyPairJob__create(JSGlobalObject* globalObject, RsaKeyPairJobCtx* ctx, EncodedJSValue callback); RsaKeyPairJob* RsaKeyPairJob::create(JSGlobalObject* globalObject, RsaKeyPairJobCtx&& ctx, JSValue callback) { - RsaKeyPairJobCtx* ctxCopy = new RsaKeyPairJobCtx(WTFMove(ctx)); + RsaKeyPairJobCtx* ctxCopy = new RsaKeyPairJobCtx(WTF::move(ctx)); return Bun__RsaKeyPairJob__create(globalObject, ctxCopy, JSValue::encode(callback)); } @@ -47,7 +47,7 @@ void RsaKeyPairJob::schedule() extern "C" void Bun__RsaKeyPairJob__createAndSchedule(JSGlobalObject* globalObject, RsaKeyPairJobCtx* ctx, EncodedJSValue callback); void RsaKeyPairJob::createAndSchedule(JSGlobalObject* globalObject, RsaKeyPairJobCtx&& ctx, JSValue callback) { - RsaKeyPairJobCtx* ctxCopy = new RsaKeyPairJobCtx(WTFMove(ctx)); + RsaKeyPairJobCtx* ctxCopy = new RsaKeyPairJobCtx(WTF::move(ctx)); Bun__RsaKeyPairJob__createAndSchedule(globalObject, ctxCopy, JSValue::encode(callback)); } @@ -61,7 +61,7 @@ ncrypto::EVPKeyCtxPointer RsaKeyPairJobCtx::setup() if (m_exponent != ncrypto::EVPKeyCtxPointer::kDefaultRsaExponent) { auto bn = ncrypto::BignumPointer::New(); - if (!bn.setWord(m_exponent) || !ctx.setRsaKeygenPubExp(WTFMove(bn))) { + if (!bn.setWord(m_exponent) || !ctx.setRsaKeygenPubExp(WTF::move(bn))) { m_opensslError = ERR_get_error(); return {}; } diff --git a/src/bun.js/bindings/node/crypto/CryptoHkdf.cpp b/src/bun.js/bindings/node/crypto/CryptoHkdf.cpp index 653e14ff0c..031df5209d 100644 --- a/src/bun.js/bindings/node/crypto/CryptoHkdf.cpp +++ b/src/bun.js/bindings/node/crypto/CryptoHkdf.cpp @@ -17,19 +17,19 @@ namespace Bun { HkdfJobCtx::HkdfJobCtx(Digest digest, size_t length, KeyObject&& key, WTF::Vector&& info, WTF::Vector&& salt) : m_digest(digest) , m_length(length) - , m_key(WTFMove(key)) - , m_info(WTFMove(info)) - , m_salt(WTFMove(salt)) + , m_key(WTF::move(key)) + , m_info(WTF::move(info)) + , m_salt(WTF::move(salt)) { } HkdfJobCtx::HkdfJobCtx(HkdfJobCtx&& other) : m_digest(other.m_digest) , m_length(other.m_length) - , m_key(WTFMove(other.m_key)) - , m_info(WTFMove(other.m_info)) - , m_salt(WTFMove(other.m_salt)) - , m_result(WTFMove(other.m_result)) + , m_key(WTF::move(other.m_key)) + , m_info(WTF::move(other.m_info)) + , m_salt(WTF::move(other.m_salt)) + , m_result(WTF::move(other.m_result)) { } @@ -113,7 +113,7 @@ void HkdfJobCtx::deinit() extern "C" HkdfJob* Bun__HkdfJob__create(JSGlobalObject* globalObject, HkdfJobCtx* ctx, EncodedJSValue callback); HkdfJob* HkdfJob::create(JSGlobalObject* globalObject, HkdfJobCtx&& ctx, JSValue callback) { - HkdfJobCtx* ctxCopy = new HkdfJobCtx(WTFMove(ctx)); + HkdfJobCtx* ctxCopy = new HkdfJobCtx(WTF::move(ctx)); return Bun__HkdfJob__create(globalObject, ctxCopy, JSValue::encode(callback)); } @@ -126,7 +126,7 @@ void HkdfJob::schedule() extern "C" void Bun__HkdfJob__createAndSchedule(JSGlobalObject* globalObject, HkdfJobCtx* ctx, EncodedJSValue callback); void HkdfJob::createAndSchedule(JSGlobalObject* globalObject, HkdfJobCtx&& ctx, JSValue callback) { - HkdfJobCtx* ctxCopy = new HkdfJobCtx(WTFMove(ctx)); + HkdfJobCtx* ctxCopy = new HkdfJobCtx(WTF::move(ctx)); return Bun__HkdfJob__createAndSchedule(globalObject, ctxCopy, JSValue::encode(callback)); } @@ -151,21 +151,21 @@ KeyObject prepareKey(JSGlobalObject* globalObject, ThrowScope& scope, JSValue ke Vector copy; copy.append(view->span()); - return KeyObject::create(WTFMove(copy)); + return KeyObject::create(WTF::move(copy)); } // Handle ArrayBuffer types if (auto* view = jsDynamicCast(key)) { Vector copy; copy.append(view->span()); - return KeyObject::create(WTFMove(copy)); + return KeyObject::create(WTF::move(copy)); } if (auto* buf = jsDynamicCast(key)) { auto* impl = buf->impl(); Vector copy; copy.append(impl->span()); - return KeyObject::create(WTFMove(copy)); + return KeyObject::create(WTF::move(copy)); } ERR::INVALID_ARG_TYPE(scope, globalObject, "ikm"_s, "string or an instance of SecretKeyObject, ArrayBuffer, TypedArray, DataView, or Buffer"_s, key); @@ -236,7 +236,7 @@ std::optional HkdfJobCtx::fromJS(JSGlobalObject* lexicalGlobalObject return std::nullopt; } - return HkdfJobCtx(hash, length, WTFMove(keyObject), WTFMove(info), WTFMove(salt)); + return HkdfJobCtx(hash, length, WTF::move(keyObject), WTF::move(info), WTF::move(salt)); } JSC_DEFINE_HOST_FUNCTION(jsHkdf, (JSGlobalObject * lexicalGlobalObject, JSC::CallFrame* callFrame)) @@ -251,7 +251,7 @@ JSC_DEFINE_HOST_FUNCTION(jsHkdf, (JSGlobalObject * lexicalGlobalObject, JSC::Cal V::validateFunction(scope, lexicalGlobalObject, callback, "callback"_s); RETURN_IF_EXCEPTION(scope, {}); - HkdfJob::createAndSchedule(lexicalGlobalObject, WTFMove(ctx.value()), callback); + HkdfJob::createAndSchedule(lexicalGlobalObject, WTF::move(ctx.value()), callback); return JSValue::encode(jsUndefined()); } diff --git a/src/bun.js/bindings/node/crypto/CryptoKeygen.cpp b/src/bun.js/bindings/node/crypto/CryptoKeygen.cpp index 6c49a5c6c9..d3f73952e1 100644 --- a/src/bun.js/bindings/node/crypto/CryptoKeygen.cpp +++ b/src/bun.js/bindings/node/crypto/CryptoKeygen.cpp @@ -32,7 +32,7 @@ void SecretKeyJobCtx::runTask(JSGlobalObject* lexicalGlobalObject) return; } - m_result = WTFMove(key); + m_result = WTF::move(key); } extern "C" void Bun__SecretKeyJobCtx__runFromJS(SecretKeyJobCtx* ctx, JSGlobalObject* lexicalGlobalObject, JSC::JSValue callback) @@ -51,10 +51,10 @@ void SecretKeyJobCtx::runFromJS(JSGlobalObject* lexicalGlobalObject, JSC::JSValu return; } - KeyObject keyObject = KeyObject::create(WTFMove(*m_result)); + KeyObject keyObject = KeyObject::create(WTF::move(*m_result)); Structure* structure = globalObject->m_JSSecretKeyObjectClassStructure.get(lexicalGlobalObject); - JSSecretKeyObject* secretKey = JSSecretKeyObject::create(vm, structure, lexicalGlobalObject, WTFMove(keyObject)); + JSSecretKeyObject* secretKey = JSSecretKeyObject::create(vm, structure, lexicalGlobalObject, WTF::move(keyObject)); Bun__EventLoop__runCallback2(lexicalGlobalObject, JSValue::encode(callback), @@ -88,7 +88,7 @@ void SecretKeyJob::schedule() extern "C" void Bun__SecretKeyJob__createAndSchedule(JSC::JSGlobalObject*, SecretKeyJobCtx*, EncodedJSValue callback); void SecretKeyJob::createAndSchedule(JSC::JSGlobalObject* lexicalGlobalObject, SecretKeyJobCtx&& ctx, JSC::JSValue callback) { - SecretKeyJobCtx* ctxCopy = new SecretKeyJobCtx(WTFMove(ctx)); + SecretKeyJobCtx* ctxCopy = new SecretKeyJobCtx(WTF::move(ctx)); return Bun__SecretKeyJob__createAndSchedule(lexicalGlobalObject, ctxCopy, JSValue::encode(callback)); } @@ -150,7 +150,7 @@ JSC_DEFINE_HOST_FUNCTION(jsGenerateKey, (JSC::JSGlobalObject * lexicalGlobalObje EXCEPTION_ASSERT(ctx.has_value() == !scope.exception()); RETURN_IF_EXCEPTION(scope, {}); - SecretKeyJob::createAndSchedule(lexicalGlobalObject, WTFMove(ctx.value()), callbackValue); + SecretKeyJob::createAndSchedule(lexicalGlobalObject, WTF::move(ctx.value()), callbackValue); return JSValue::encode(jsUndefined()); } @@ -176,9 +176,9 @@ JSC_DEFINE_HOST_FUNCTION(jsGenerateKeySync, (JSC::JSGlobalObject * lexicalGlobal auto& result = ctx->m_result.value(); auto* globalObject = defaultGlobalObject(lexicalGlobalObject); - KeyObject keyObject = KeyObject::create(WTFMove(result)); + KeyObject keyObject = KeyObject::create(WTF::move(result)); Structure* structure = globalObject->m_JSSecretKeyObjectClassStructure.get(lexicalGlobalObject); - JSSecretKeyObject* secretKey = JSSecretKeyObject::create(vm, structure, lexicalGlobalObject, WTFMove(keyObject)); + JSSecretKeyObject* secretKey = JSSecretKeyObject::create(vm, structure, lexicalGlobalObject, WTF::move(keyObject)); return JSValue::encode(secretKey); } diff --git a/src/bun.js/bindings/node/crypto/CryptoKeys.cpp b/src/bun.js/bindings/node/crypto/CryptoKeys.cpp index 799954e7c7..1ef0cfe0a4 100644 --- a/src/bun.js/bindings/node/crypto/CryptoKeys.cpp +++ b/src/bun.js/bindings/node/crypto/CryptoKeys.cpp @@ -23,7 +23,7 @@ JSC_DEFINE_HOST_FUNCTION(jsCreateSecretKey, (JSC::JSGlobalObject * lexicalGlobal RETURN_IF_EXCEPTION(scope, {}); Structure* structure = globalObject->m_JSSecretKeyObjectClassStructure.get(lexicalGlobalObject); - JSSecretKeyObject* secretKey = JSSecretKeyObject::create(vm, structure, lexicalGlobalObject, WTFMove(keyObject)); + JSSecretKeyObject* secretKey = JSSecretKeyObject::create(vm, structure, lexicalGlobalObject, WTF::move(keyObject)); return JSValue::encode(secretKey); } @@ -43,7 +43,7 @@ JSC_DEFINE_HOST_FUNCTION(jsCreatePublicKey, (JSC::JSGlobalObject * lexicalGlobal if (prepareResult.keyData) { RefPtr keyData = *prepareResult.keyData; - keyObject = KeyObject::create(CryptoKeyType::Public, WTFMove(keyData)); + keyObject = KeyObject::create(CryptoKeyType::Public, WTF::move(keyData)); } else { keyObject = KeyObject::getPublicOrPrivateKey( globalObject, @@ -53,12 +53,12 @@ JSC_DEFINE_HOST_FUNCTION(jsCreatePublicKey, (JSC::JSGlobalObject * lexicalGlobal prepareResult.formatType, prepareResult.encodingType, prepareResult.cipher, - WTFMove(prepareResult.passphrase)); + WTF::move(prepareResult.passphrase)); RETURN_IF_EXCEPTION(scope, {}); } Structure* structure = globalObject->m_JSPublicKeyObjectClassStructure.get(lexicalGlobalObject); - JSPublicKeyObject* publicKey = JSPublicKeyObject::create(vm, structure, lexicalGlobalObject, WTFMove(keyObject)); + JSPublicKeyObject* publicKey = JSPublicKeyObject::create(vm, structure, lexicalGlobalObject, WTF::move(keyObject)); return JSValue::encode(publicKey); } @@ -78,7 +78,7 @@ JSC_DEFINE_HOST_FUNCTION(jsCreatePrivateKey, (JSGlobalObject * lexicalGlobalObje if (prepareResult.keyData) { auto keyData = *prepareResult.keyData; - keyObject = KeyObject::create(CryptoKeyType::Private, WTFMove(keyData)); + keyObject = KeyObject::create(CryptoKeyType::Private, WTF::move(keyData)); } else { keyObject = KeyObject::getPublicOrPrivateKey( globalObject, @@ -88,12 +88,12 @@ JSC_DEFINE_HOST_FUNCTION(jsCreatePrivateKey, (JSGlobalObject * lexicalGlobalObje prepareResult.formatType, prepareResult.encodingType, prepareResult.cipher, - WTFMove(prepareResult.passphrase)); + WTF::move(prepareResult.passphrase)); RETURN_IF_EXCEPTION(scope, {}); } Structure* structure = globalObject->m_JSPrivateKeyObjectClassStructure.get(lexicalGlobalObject); - JSPrivateKeyObject* privateKey = JSPrivateKeyObject::create(vm, structure, lexicalGlobalObject, WTFMove(keyObject)); + JSPrivateKeyObject* privateKey = JSPrivateKeyObject::create(vm, structure, lexicalGlobalObject, WTF::move(keyObject)); return JSValue::encode(privateKey); } diff --git a/src/bun.js/bindings/node/crypto/CryptoPrimes.cpp b/src/bun.js/bindings/node/crypto/CryptoPrimes.cpp index 39f6ac8a67..a900b56f1e 100644 --- a/src/bun.js/bindings/node/crypto/CryptoPrimes.cpp +++ b/src/bun.js/bindings/node/crypto/CryptoPrimes.cpp @@ -10,7 +10,7 @@ using namespace ncrypto; using namespace JSC; CheckPrimeJobCtx::CheckPrimeJobCtx(ncrypto::BignumPointer candidate, int32_t checks) - : m_candidate(WTFMove(candidate)) + : m_candidate(WTF::move(candidate)) , m_checks(checks) { } @@ -54,7 +54,7 @@ void CheckPrimeJobCtx::deinit() extern "C" CheckPrimeJob* Bun__CheckPrimeJob__create(JSGlobalObject*, CheckPrimeJobCtx*, EncodedJSValue callback); CheckPrimeJob* CheckPrimeJob::create(JSGlobalObject* globalObject, ncrypto::BignumPointer candidate, int32_t checks, JSValue callback) { - CheckPrimeJobCtx* ctx = new CheckPrimeJobCtx(WTFMove(candidate), checks); + CheckPrimeJobCtx* ctx = new CheckPrimeJobCtx(WTF::move(candidate), checks); return Bun__CheckPrimeJob__create(globalObject, ctx, JSValue::encode(callback)); } @@ -67,7 +67,7 @@ void CheckPrimeJob::schedule() extern "C" void Bun__CheckPrimeJob__createAndSchedule(JSGlobalObject*, CheckPrimeJobCtx*, EncodedJSValue callback); void CheckPrimeJob::createAndSchedule(JSGlobalObject* globalObject, ncrypto::BignumPointer candidate, int32_t checks, JSValue callback) { - CheckPrimeJobCtx* ctx = new CheckPrimeJobCtx(WTFMove(candidate), checks); + CheckPrimeJobCtx* ctx = new CheckPrimeJobCtx(WTF::move(candidate), checks); return Bun__CheckPrimeJob__createAndSchedule(globalObject, ctx, JSValue::encode(callback)); } @@ -165,7 +165,7 @@ JSC_DEFINE_HOST_FUNCTION(jsCheckPrime, (JSC::JSGlobalObject * lexicalGlobalObjec return {}; } - CheckPrimeJob::createAndSchedule(lexicalGlobalObject, WTFMove(candidate), checks, callback); + CheckPrimeJob::createAndSchedule(lexicalGlobalObject, WTF::move(candidate), checks, callback); return JSValue::encode(jsUndefined()); } @@ -174,9 +174,9 @@ GeneratePrimeJobCtx::GeneratePrimeJobCtx(int32_t size, bool safe, ncrypto::Bignu : m_size(size) , m_safe(safe) , m_bigint(bigint) - , m_add(WTFMove(add)) - , m_rem(WTFMove(rem)) - , m_prime(WTFMove(prime)) + , m_add(WTF::move(add)) + , m_rem(WTF::move(rem)) + , m_prime(WTF::move(prime)) { } @@ -239,7 +239,7 @@ void GeneratePrimeJobCtx::deinit() extern "C" GeneratePrimeJob* Bun__GeneratePrimeJob__create(JSGlobalObject*, GeneratePrimeJobCtx*, EncodedJSValue callback); GeneratePrimeJob* GeneratePrimeJob::create(JSGlobalObject* globalObject, int32_t size, bool safe, ncrypto::BignumPointer prime, ncrypto::BignumPointer add, ncrypto::BignumPointer rem, bool bigint, JSValue callback) { - GeneratePrimeJobCtx* ctx = new GeneratePrimeJobCtx(size, safe, WTFMove(prime), WTFMove(add), WTFMove(rem), bigint); + GeneratePrimeJobCtx* ctx = new GeneratePrimeJobCtx(size, safe, WTF::move(prime), WTF::move(add), WTF::move(rem), bigint); return Bun__GeneratePrimeJob__create(globalObject, ctx, JSValue::encode(callback)); } @@ -252,7 +252,7 @@ void GeneratePrimeJob::schedule() extern "C" void Bun__GeneratePrimeJob__createAndSchedule(JSGlobalObject*, GeneratePrimeJobCtx*, EncodedJSValue callback); void GeneratePrimeJob::createAndSchedule(JSGlobalObject* globalObject, int32_t size, bool safe, ncrypto::BignumPointer prime, ncrypto::BignumPointer add, ncrypto::BignumPointer rem, bool bigint, JSValue callback) { - GeneratePrimeJobCtx* ctx = new GeneratePrimeJobCtx(size, safe, WTFMove(prime), WTFMove(add), WTFMove(rem), bigint); + GeneratePrimeJobCtx* ctx = new GeneratePrimeJobCtx(size, safe, WTF::move(prime), WTF::move(add), WTF::move(rem), bigint); Bun__GeneratePrimeJob__createAndSchedule(globalObject, ctx, JSValue::encode(callback)); } @@ -286,7 +286,7 @@ JSValue GeneratePrimeJob::result(JSGlobalObject* globalObject, JSC::ThrowScope& BignumPointer::EncodePaddedInto(prime.get(), reinterpret_cast(buf->data()), buf->byteLength()); - return JSArrayBuffer::create(vm, globalObject->arrayBufferStructure(), WTFMove(buf)); + return JSArrayBuffer::create(vm, globalObject->arrayBufferStructure(), WTF::move(buf)); } JSC_DEFINE_HOST_FUNCTION(jsGeneratePrime, (JSC::JSGlobalObject * lexicalGlobalObject, JSC::CallFrame* callFrame)) @@ -393,7 +393,7 @@ JSC_DEFINE_HOST_FUNCTION(jsGeneratePrime, (JSC::JSGlobalObject * lexicalGlobalOb return ERR::CRYPTO_OPERATION_FAILED(scope, lexicalGlobalObject, "could not generate prime"_s); } - GeneratePrimeJob::createAndSchedule(lexicalGlobalObject, size, safe, WTFMove(prime), WTFMove(add), WTFMove(rem), bigint, callback); + GeneratePrimeJob::createAndSchedule(lexicalGlobalObject, size, safe, WTF::move(prime), WTF::move(add), WTF::move(rem), bigint, callback); return JSValue::encode(jsUndefined()); } diff --git a/src/bun.js/bindings/node/crypto/CryptoSignJob.cpp b/src/bun.js/bindings/node/crypto/CryptoSignJob.cpp index 77899d2e92..1b9d80177a 100644 --- a/src/bun.js/bindings/node/crypto/CryptoSignJob.cpp +++ b/src/bun.js/bindings/node/crypto/CryptoSignJob.cpp @@ -25,7 +25,7 @@ JSC_DEFINE_HOST_FUNCTION(jsVerifyOneShot, (JSGlobalObject * lexicalGlobalObject, RETURN_IF_EXCEPTION(scope, {}); if (!callbackValue.isUndefined()) { - SignJob::createAndSchedule(lexicalGlobalObject, WTFMove(*ctx), callbackValue); + SignJob::createAndSchedule(lexicalGlobalObject, WTF::move(*ctx), callbackValue); return JSValue::encode(jsUndefined()); } @@ -53,7 +53,7 @@ JSC_DEFINE_HOST_FUNCTION(jsSignOneShot, (JSGlobalObject * lexicalGlobalObject, C RETURN_IF_EXCEPTION(scope, {}); if (!callbackValue.isUndefined()) { - SignJob::createAndSchedule(lexicalGlobalObject, WTFMove(*ctx), callbackValue); + SignJob::createAndSchedule(lexicalGlobalObject, WTF::move(*ctx), callbackValue); return JSValue::encode(jsUndefined()); } @@ -69,7 +69,7 @@ JSC_DEFINE_HOST_FUNCTION(jsSignOneShot, (JSGlobalObject * lexicalGlobalObject, C auto sigBuf = ArrayBuffer::createUninitialized(result.size(), 1); memcpy(sigBuf->data(), result.data(), result.size()); - auto* signature = JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTFMove(sigBuf), 0, result.size()); + auto* signature = JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTF::move(sigBuf), 0, result.size()); RETURN_IF_EXCEPTION(scope, {}); return JSValue::encode(signature); } @@ -182,7 +182,7 @@ void SignJobCtx::runTask(JSGlobalObject* globalObject) m_signResult = ByteSource::allocated(p1363Buffer.release()); } else { - m_signResult = WTFMove(bs); + m_signResult = WTF::move(bs); } } break; @@ -226,7 +226,7 @@ void SignJobCtx::runFromJS(JSGlobalObject* lexicalGlobalObject, JSValue callback auto sigBuf = ArrayBuffer::createUninitialized(m_signResult->size(), 1); memcpy(sigBuf->data(), m_signResult->data(), m_signResult->size()); - auto* signature = JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTFMove(sigBuf), 0, m_signResult->size()); + auto* signature = JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTF::move(sigBuf), 0, m_signResult->size()); RETURN_IF_EXCEPTION(scope, ); Bun__EventLoop__runCallback2( @@ -259,7 +259,7 @@ void SignJobCtx::runFromJS(JSGlobalObject* lexicalGlobalObject, JSValue callback extern "C" SignJob* Bun__SignJob__create(JSGlobalObject* globalObject, SignJobCtx* ctx, EncodedJSValue callback); SignJob* SignJob::create(JSGlobalObject* globalObject, SignJobCtx&& ctx, JSValue callback) { - SignJobCtx* ctxCopy = new SignJobCtx(WTFMove(ctx)); + SignJobCtx* ctxCopy = new SignJobCtx(WTF::move(ctx)); return Bun__SignJob__create(globalObject, ctxCopy, JSValue::encode(callback)); } @@ -272,7 +272,7 @@ void SignJob::schedule() extern "C" void Bun__SignJob__createAndSchedule(JSGlobalObject* globalObject, SignJobCtx* ctx, EncodedJSValue callback); void SignJob::createAndSchedule(JSGlobalObject* globalObject, SignJobCtx&& ctx, JSValue callback) { - SignJobCtx* ctxCopy = new SignJobCtx(WTFMove(ctx)); + SignJobCtx* ctxCopy = new SignJobCtx(WTF::move(ctx)); Bun__SignJob__createAndSchedule(globalObject, ctxCopy, JSValue::encode(callback)); } @@ -333,7 +333,7 @@ std::optional SignJobCtx::fromJS(JSGlobalObject* globalObject, Throw KeyObject keyObject; if (prepareResult.keyData) { - keyObject = KeyObject::create(keyType, WTFMove(*prepareResult.keyData)); + keyObject = KeyObject::create(keyType, WTF::move(*prepareResult.keyData)); } else { keyObject = KeyObject::getPublicOrPrivateKey( @@ -344,7 +344,7 @@ std::optional SignJobCtx::fromJS(JSGlobalObject* globalObject, Throw prepareResult.formatType, prepareResult.encodingType, prepareResult.cipher, - WTFMove(prepareResult.passphrase)); + WTF::move(prepareResult.passphrase)); RETURN_IF_EXCEPTION(scope, {}); } @@ -424,18 +424,18 @@ std::optional SignJobCtx::fromJS(JSGlobalObject* globalObject, Throw return SignJobCtx( mode, keyObject.data(), - WTFMove(data), + WTF::move(data), digest, padding, pssSaltLength, dsaSigEnc, - WTFMove(signature)); + WTF::move(signature)); } return SignJobCtx( mode, keyObject.data(), - WTFMove(data), + WTF::move(data), digest, padding, pssSaltLength, diff --git a/src/bun.js/bindings/node/crypto/CryptoSignJob.h b/src/bun.js/bindings/node/crypto/CryptoSignJob.h index ac029b09cb..f3bf6a5313 100644 --- a/src/bun.js/bindings/node/crypto/CryptoSignJob.h +++ b/src/bun.js/bindings/node/crypto/CryptoSignJob.h @@ -22,8 +22,8 @@ public: SignJobCtx(Mode mode, RefPtr keyData, Vector&& data, ncrypto::Digest digest, std::optional padding, std::optional saltLength, DSASigEnc dsaSigEnc, Vector&& signature = {}) : m_mode(mode) , m_keyData(keyData) - , m_data(WTFMove(data)) - , m_signature(WTFMove(signature)) + , m_data(WTF::move(data)) + , m_signature(WTF::move(signature)) , m_digest(digest) , m_padding(padding) , m_saltLength(saltLength) @@ -34,9 +34,9 @@ public: SignJobCtx(SignJobCtx&& other) : m_mode(other.m_mode) - , m_keyData(WTFMove(other.m_keyData)) - , m_data(WTFMove(other.m_data)) - , m_signature(WTFMove(other.m_signature)) + , m_keyData(WTF::move(other.m_keyData)) + , m_data(WTF::move(other.m_data)) + , m_signature(WTF::move(other.m_signature)) , m_digest(other.m_digest) , m_padding(other.m_padding) , m_saltLength(other.m_saltLength) diff --git a/src/bun.js/bindings/node/crypto/CryptoUtil.cpp b/src/bun.js/bindings/node/crypto/CryptoUtil.cpp index 2c8d73c0ee..29b2b9c538 100644 --- a/src/bun.js/bindings/node/crypto/CryptoUtil.cpp +++ b/src/bun.js/bindings/node/crypto/CryptoUtil.cpp @@ -82,7 +82,7 @@ EncodedJSValue encode(JSGlobalObject* lexicalGlobalObject, ThrowScope& scope, st memcpy(buffer->data(), bytes.data(), bytes.size()); - return JSValue::encode(JSC::JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTFMove(buffer), 0, bytes.size())); + return JSValue::encode(JSC::JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTF::move(buffer), 0, bytes.size())); } default: { return jsBufferToStringFromBytes(lexicalGlobalObject, scope, bytes, encoding); @@ -157,7 +157,7 @@ std::optional keyFromString(JSGlobalObject* lexicalGloba }; auto res = ncrypto::EVPKeyPointer::TryParsePrivateKey(config, ncryptoBuf); if (res) { - ncrypto::EVPKeyPointer keyPtr(WTFMove(res.value)); + ncrypto::EVPKeyPointer keyPtr(WTF::move(res.value)); return keyPtr; } @@ -255,7 +255,7 @@ std::optional passphraseFromBufferSource(JSC::JSGlobalObje auto span = utf8.span(); if (auto ptr = ncrypto::DataPointer::Alloc(span.size())) { memcpy(ptr.get(), span.data(), span.size()); - return WTFMove(ptr); + return WTF::move(ptr); } throwOutOfMemoryError(globalObject, scope); @@ -271,7 +271,7 @@ std::optional passphraseFromBufferSource(JSC::JSGlobalObje auto length = array->byteLength(); if (auto ptr = ncrypto::DataPointer::Alloc(length)) { memcpy(ptr.get(), array->vector(), length); - return WTFMove(ptr); + return WTF::move(ptr); } throwOutOfMemoryError(globalObject, scope); @@ -481,7 +481,7 @@ bool convertP1363ToDER(const ncrypto::Buffer& p1363Sig, return false; } - if (!asn1_sig.setParams(WTFMove(r), WTFMove(s))) { + if (!asn1_sig.setParams(WTF::move(r), WTF::move(s))) { return false; } diff --git a/src/bun.js/bindings/node/crypto/DiffieHellmanFunctions.h b/src/bun.js/bindings/node/crypto/DiffieHellmanFunctions.h index feb50dae6d..778b8592b7 100644 --- a/src/bun.js/bindings/node/crypto/DiffieHellmanFunctions.h +++ b/src/bun.js/bindings/node/crypto/DiffieHellmanFunctions.h @@ -251,7 +251,7 @@ JSC::EncodedJSValue jsDiffieHellmanProtoFuncSetPublicKeyTemplate(JSC::JSGlobalOb auto& dh = thisObject->getImpl(); - if (!dh.setPublicKey(WTFMove(key))) { + if (!dh.setPublicKey(WTF::move(key))) { throwError(globalObject, scope, ErrorCode::ERR_CRYPTO_OPERATION_FAILED, "Failed to set public key"_s); return {}; } @@ -286,7 +286,7 @@ JSC::EncodedJSValue jsDiffieHellmanProtoFuncSetPrivateKeyTemplate(JSC::JSGlobalO auto& dh = thisObject->getImpl(); - if (!dh.setPrivateKey(WTFMove(key))) { + if (!dh.setPrivateKey(WTF::move(key))) { throwError(globalObject, scope, ErrorCode::ERR_CRYPTO_OPERATION_FAILED, "Failed to set private key"_s); return {}; } diff --git a/src/bun.js/bindings/node/crypto/JSCipher.cpp b/src/bun.js/bindings/node/crypto/JSCipher.cpp index d593ace4b2..4b1b9a4c57 100644 --- a/src/bun.js/bindings/node/crypto/JSCipher.cpp +++ b/src/bun.js/bindings/node/crypto/JSCipher.cpp @@ -76,7 +76,7 @@ JSValue rsaFunction(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* ca RETURN_IF_EXCEPTION(scope, {}); if (prepareResult.keyData) { RefPtr data = *prepareResult.keyData; - keyObject = KeyObject::create(CryptoKeyType::Public, WTFMove(data)); + keyObject = KeyObject::create(CryptoKeyType::Public, WTF::move(data)); } else { keyObject = KeyObject::getPublicOrPrivateKey( globalObject, @@ -86,7 +86,7 @@ JSValue rsaFunction(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* ca prepareResult.formatType, prepareResult.encodingType, prepareResult.cipher, - WTFMove(prepareResult.passphrase)); + WTF::move(prepareResult.passphrase)); RETURN_IF_EXCEPTION(scope, {}); } break; @@ -97,7 +97,7 @@ JSValue rsaFunction(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* ca RETURN_IF_EXCEPTION(scope, {}); if (prepareResult.keyData) { RefPtr data = *prepareResult.keyData; - keyObject = KeyObject::create(CryptoKeyType::Private, WTFMove(data)); + keyObject = KeyObject::create(CryptoKeyType::Private, WTF::move(data)); } else { keyObject = KeyObject::getPublicOrPrivateKey( globalObject, @@ -107,7 +107,7 @@ JSValue rsaFunction(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* ca prepareResult.formatType, prepareResult.encodingType, prepareResult.cipher, - WTFMove(prepareResult.passphrase)); + WTF::move(prepareResult.passphrase)); RETURN_IF_EXCEPTION(scope, {}); } break; @@ -215,7 +215,7 @@ JSValue rsaFunction(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* ca return {}; } - RELEASE_AND_RETURN(scope, JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTFMove(outBuf), 0, result.size())); + RELEASE_AND_RETURN(scope, JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTF::move(outBuf), 0, result.size())); } JSC_DEFINE_HOST_FUNCTION(jsPublicEncrypt, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callFrame)) diff --git a/src/bun.js/bindings/node/crypto/JSCipher.h b/src/bun.js/bindings/node/crypto/JSCipher.h index 7c0a4dd625..75d105ae28 100644 --- a/src/bun.js/bindings/node/crypto/JSCipher.h +++ b/src/bun.js/bindings/node/crypto/JSCipher.h @@ -43,7 +43,7 @@ public: static JSCipher* create(JSC::VM& vm, JSC::Structure* structure, JSC::JSGlobalObject* globalObject, CipherKind kind, ncrypto::CipherCtxPointer&& ctx, std::optional authTagLen, int32_t maxMessageSize) { - JSCipher* instance = new (NotNull, JSC::allocateCell(vm)) JSCipher(vm, structure, kind, WTFMove(ctx), authTagLen, maxMessageSize); + JSCipher* instance = new (NotNull, JSC::allocateCell(vm)) JSCipher(vm, structure, kind, WTF::move(ctx), authTagLen, maxMessageSize); instance->finishCreation(vm, globalObject); return instance; } @@ -109,7 +109,7 @@ private: , m_authTagLen(authTagLen) , m_pendingAuthFailed(false) , m_maxMessageSize(maxMessageSize) - , m_ctx(WTFMove(ctx)) + , m_ctx(WTF::move(ctx)) { } diff --git a/src/bun.js/bindings/node/crypto/JSCipherConstructor.cpp b/src/bun.js/bindings/node/crypto/JSCipherConstructor.cpp index 063e95407d..6261433f5f 100644 --- a/src/bun.js/bindings/node/crypto/JSCipherConstructor.cpp +++ b/src/bun.js/bindings/node/crypto/JSCipherConstructor.cpp @@ -219,7 +219,7 @@ JSC_DEFINE_HOST_FUNCTION(constructCipher, (JSC::JSGlobalObject * globalObject, J auto* zigGlobalObject = defaultGlobalObject(globalObject); JSC::Structure* structure = zigGlobalObject->m_JSCipherClassStructure.get(zigGlobalObject); - return JSC::JSValue::encode(JSCipher::create(vm, structure, globalObject, cipherKind, WTFMove(ctx), authTagLength, maxMessageSize)); + return JSC::JSValue::encode(JSCipher::create(vm, structure, globalObject, cipherKind, WTF::move(ctx), authTagLength, maxMessageSize)); } } // namespace Bun diff --git a/src/bun.js/bindings/node/crypto/JSCipherPrototype.cpp b/src/bun.js/bindings/node/crypto/JSCipherPrototype.cpp index bc9f5276ca..76b6103931 100644 --- a/src/bun.js/bindings/node/crypto/JSCipherPrototype.cpp +++ b/src/bun.js/bindings/node/crypto/JSCipherPrototype.cpp @@ -116,7 +116,7 @@ JSC_DEFINE_HOST_FUNCTION(jsCipherUpdate, (JSC::JSGlobalObject * lexicalGlobalObj if (!res && cipher->m_kind == CipherKind::Decipher && cipher->m_ctx.isCcmMode()) { cipher->m_pendingAuthFailed = true; - RELEASE_AND_RETURN(scope, JSValue::encode(JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTFMove(outBuf), 0, bufLen))); + RELEASE_AND_RETURN(scope, JSValue::encode(JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTF::move(outBuf), 0, bufLen))); } if (res != 1) { @@ -124,7 +124,7 @@ JSC_DEFINE_HOST_FUNCTION(jsCipherUpdate, (JSC::JSGlobalObject * lexicalGlobalObj return {}; } - RELEASE_AND_RETURN(scope, JSValue::encode(JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTFMove(outBuf), 0, bufLen))); + RELEASE_AND_RETURN(scope, JSValue::encode(JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTF::move(outBuf), 0, bufLen))); } JSC_DEFINE_HOST_FUNCTION(jsCipherFinal, (JSC::JSGlobalObject * lexicalGlobalObject, JSC::CallFrame* callFrame)) @@ -192,7 +192,7 @@ JSC_DEFINE_HOST_FUNCTION(jsCipherFinal, (JSC::JSGlobalObject * lexicalGlobalObje return {}; } - RELEASE_AND_RETURN(scope, JSValue::encode(JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTFMove(outBuf), 0, outLen))); + RELEASE_AND_RETURN(scope, JSValue::encode(JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTF::move(outBuf), 0, outLen))); } JSC_DEFINE_HOST_FUNCTION(jsCipherSetAutoPadding, (JSC::JSGlobalObject * globalObject, JSC::CallFrame* callFrame)) diff --git a/src/bun.js/bindings/node/crypto/JSDiffieHellman.h b/src/bun.js/bindings/node/crypto/JSDiffieHellman.h index 3645d59084..5e21d84693 100644 --- a/src/bun.js/bindings/node/crypto/JSDiffieHellman.h +++ b/src/bun.js/bindings/node/crypto/JSDiffieHellman.h @@ -24,7 +24,7 @@ public: static JSDiffieHellman* create(JSC::VM& vm, JSC::Structure* structure, JSC::JSGlobalObject* globalObject, ncrypto::DHPointer&& dh) { - JSDiffieHellman* instance = new (NotNull, JSC::allocateCell(vm)) JSDiffieHellman(vm, structure, WTFMove(dh)); + JSDiffieHellman* instance = new (NotNull, JSC::allocateCell(vm)) JSDiffieHellman(vm, structure, WTF::move(dh)); instance->finishCreation(vm, globalObject); return instance; } @@ -48,7 +48,7 @@ public: private: JSDiffieHellman(JSC::VM& vm, JSC::Structure* structure, ncrypto::DHPointer&& dh) : Base(vm, structure) - , m_dh(WTFMove(dh)) + , m_dh(WTF::move(dh)) { } diff --git a/src/bun.js/bindings/node/crypto/JSDiffieHellmanConstructor.cpp b/src/bun.js/bindings/node/crypto/JSDiffieHellmanConstructor.cpp index 2dba02a437..8c281c45ce 100644 --- a/src/bun.js/bindings/node/crypto/JSDiffieHellmanConstructor.cpp +++ b/src/bun.js/bindings/node/crypto/JSDiffieHellmanConstructor.cpp @@ -160,7 +160,7 @@ JSC_DEFINE_HOST_FUNCTION(constructDiffieHellman, (JSC::JSGlobalObject * globalOb } } - dh = ncrypto::DHPointer::New(WTFMove(bn_p), WTFMove(bn_g)); + dh = ncrypto::DHPointer::New(WTF::move(bn_p), WTF::move(bn_g)); if (!dh) { return JSValue::encode(createError(globalObject, ErrorCode::ERR_INVALID_ARG_VALUE, "Invalid DH parameters"_s)); } @@ -170,7 +170,7 @@ JSC_DEFINE_HOST_FUNCTION(constructDiffieHellman, (JSC::JSGlobalObject * globalOb auto* zigGlobalObject = defaultGlobalObject(globalObject); JSC::Structure* structure = zigGlobalObject->m_JSDiffieHellmanClassStructure.get(zigGlobalObject); - return JSC::JSValue::encode(JSDiffieHellman::create(vm, structure, globalObject, WTFMove(dh))); + return JSC::JSValue::encode(JSDiffieHellman::create(vm, structure, globalObject, WTF::move(dh))); } } // namespace Bun diff --git a/src/bun.js/bindings/node/crypto/JSDiffieHellmanGroup.h b/src/bun.js/bindings/node/crypto/JSDiffieHellmanGroup.h index cb3d544fd6..5767929602 100644 --- a/src/bun.js/bindings/node/crypto/JSDiffieHellmanGroup.h +++ b/src/bun.js/bindings/node/crypto/JSDiffieHellmanGroup.h @@ -23,7 +23,7 @@ public: static JSDiffieHellmanGroup* create(JSC::VM& vm, JSC::Structure* structure, JSC::JSGlobalObject* globalObject, ncrypto::DHPointer&& dh) { - JSDiffieHellmanGroup* instance = new (NotNull, JSC::allocateCell(vm)) JSDiffieHellmanGroup(vm, structure, WTFMove(dh)); + JSDiffieHellmanGroup* instance = new (NotNull, JSC::allocateCell(vm)) JSDiffieHellmanGroup(vm, structure, WTF::move(dh)); instance->finishCreation(vm, globalObject); return instance; } @@ -49,7 +49,7 @@ public: private: JSDiffieHellmanGroup(JSC::VM& vm, JSC::Structure* structure, ncrypto::DHPointer&& dh) : Base(vm, structure) - , m_dh(WTFMove(dh)) + , m_dh(WTF::move(dh)) { } diff --git a/src/bun.js/bindings/node/crypto/JSDiffieHellmanGroupConstructor.cpp b/src/bun.js/bindings/node/crypto/JSDiffieHellmanGroupConstructor.cpp index 408dbc82a4..bbdc90ac92 100644 --- a/src/bun.js/bindings/node/crypto/JSDiffieHellmanGroupConstructor.cpp +++ b/src/bun.js/bindings/node/crypto/JSDiffieHellmanGroupConstructor.cpp @@ -61,7 +61,7 @@ JSC_DEFINE_HOST_FUNCTION(constructDiffieHellmanGroup, (JSC::JSGlobalObject * glo RETURN_IF_EXCEPTION(scope, {}); } - return JSC::JSValue::encode(JSDiffieHellmanGroup::create(vm, structure, globalObject, WTFMove(dh))); + return JSC::JSValue::encode(JSDiffieHellmanGroup::create(vm, structure, globalObject, WTF::move(dh))); } } // namespace Bun diff --git a/src/bun.js/bindings/node/crypto/JSECDH.h b/src/bun.js/bindings/node/crypto/JSECDH.h index ea0907e37e..9b1594117b 100644 --- a/src/bun.js/bindings/node/crypto/JSECDH.h +++ b/src/bun.js/bindings/node/crypto/JSECDH.h @@ -25,7 +25,7 @@ public: static JSECDH* create(JSC::VM& vm, JSC::Structure* structure, JSC::JSGlobalObject* globalObject, ncrypto::ECKeyPointer&& key, const EC_GROUP* group) { - JSECDH* instance = new (NotNull, JSC::allocateCell(vm)) JSECDH(vm, structure, WTFMove(key), group); + JSECDH* instance = new (NotNull, JSC::allocateCell(vm)) JSECDH(vm, structure, WTF::move(key), group); instance->finishCreation(vm, globalObject); return instance; } @@ -53,7 +53,7 @@ public: private: JSECDH(JSC::VM& vm, JSC::Structure* structure, ncrypto::ECKeyPointer&& key, const EC_GROUP* group) : Base(vm, structure) - , m_key(WTFMove(key)) + , m_key(WTF::move(key)) , m_group(group) { ASSERT(m_group); diff --git a/src/bun.js/bindings/node/crypto/JSECDHConstructor.cpp b/src/bun.js/bindings/node/crypto/JSECDHConstructor.cpp index 2e0d80edcc..f65e45710d 100644 --- a/src/bun.js/bindings/node/crypto/JSECDHConstructor.cpp +++ b/src/bun.js/bindings/node/crypto/JSECDHConstructor.cpp @@ -72,7 +72,7 @@ JSC_DEFINE_HOST_FUNCTION(constructECDH, (JSC::JSGlobalObject * globalObject, JSC JSC::Structure* structure = zigGlobalObject->m_JSECDHClassStructure.get(zigGlobalObject); const EC_GROUP* group = key.getGroup(); - return JSC::JSValue::encode(JSECDH::create(vm, structure, globalObject, WTFMove(key), group)); + return JSC::JSValue::encode(JSECDH::create(vm, structure, globalObject, WTF::move(key), group)); } JSC_DEFINE_HOST_FUNCTION(jsECDHConvertKey, (JSC::JSGlobalObject * lexicalGlobalObject, JSC::CallFrame* callFrame)) diff --git a/src/bun.js/bindings/node/crypto/JSECDHPrototype.cpp b/src/bun.js/bindings/node/crypto/JSECDHPrototype.cpp index 4441e85219..0205462001 100644 --- a/src/bun.js/bindings/node/crypto/JSECDHPrototype.cpp +++ b/src/bun.js/bindings/node/crypto/JSECDHPrototype.cpp @@ -346,7 +346,7 @@ JSC_DEFINE_HOST_FUNCTION(jsECDHProtoFuncSetPrivateKey, (JSC::JSGlobalObject * gl } // Replace the old key with the new one - ecdh->m_key = WTFMove(newKey); + ecdh->m_key = WTF::move(newKey); ecdh->m_group = ecdh->m_key.getGroup(); // Return this for chaining diff --git a/src/bun.js/bindings/node/crypto/JSKeyObject.h b/src/bun.js/bindings/node/crypto/JSKeyObject.h index 49af4225ee..5d7af7ae3b 100644 --- a/src/bun.js/bindings/node/crypto/JSKeyObject.h +++ b/src/bun.js/bindings/node/crypto/JSKeyObject.h @@ -26,7 +26,7 @@ public: static JSKeyObject* create(JSC::VM& vm, JSC::Structure* structure, JSC::JSGlobalObject* globalObject, KeyObject&& keyObject) { - JSKeyObject* instance = new (NotNull, JSC::allocateCell(vm)) JSKeyObject(vm, structure, WTFMove(keyObject)); + JSKeyObject* instance = new (NotNull, JSC::allocateCell(vm)) JSKeyObject(vm, structure, WTF::move(keyObject)); instance->finishCreation(vm, globalObject); return instance; } @@ -46,7 +46,7 @@ public: JSKeyObject(JSC::VM& vm, JSC::Structure* structure, KeyObject&& keyObject) : Base(vm, structure) - , m_handle(WTFMove(keyObject)) + , m_handle(WTF::move(keyObject)) { } diff --git a/src/bun.js/bindings/node/crypto/JSPrivateKeyObject.h b/src/bun.js/bindings/node/crypto/JSPrivateKeyObject.h index 1b97bf3ddf..3573f76f1c 100644 --- a/src/bun.js/bindings/node/crypto/JSPrivateKeyObject.h +++ b/src/bun.js/bindings/node/crypto/JSPrivateKeyObject.h @@ -24,7 +24,7 @@ public: static JSPrivateKeyObject* create(JSC::VM& vm, JSC::Structure* structure, JSC::JSGlobalObject* globalObject, KeyObject&& keyObject) { - JSPrivateKeyObject* instance = new (NotNull, JSC::allocateCell(vm)) JSPrivateKeyObject(vm, structure, WTFMove(keyObject)); + JSPrivateKeyObject* instance = new (NotNull, JSC::allocateCell(vm)) JSPrivateKeyObject(vm, structure, WTF::move(keyObject)); instance->finishCreation(vm, globalObject); return instance; } @@ -50,7 +50,7 @@ public: void finishCreation(JSC::VM&, JSC::JSGlobalObject*); JSPrivateKeyObject(JSC::VM& vm, JSC::Structure* structure, KeyObject&& keyObject) - : Base(vm, structure, WTFMove(keyObject)) + : Base(vm, structure, WTF::move(keyObject)) { } }; diff --git a/src/bun.js/bindings/node/crypto/JSPublicKeyObject.h b/src/bun.js/bindings/node/crypto/JSPublicKeyObject.h index 4354f6a57c..0dd04f20c9 100644 --- a/src/bun.js/bindings/node/crypto/JSPublicKeyObject.h +++ b/src/bun.js/bindings/node/crypto/JSPublicKeyObject.h @@ -25,7 +25,7 @@ public: static JSPublicKeyObject* create(JSC::VM& vm, JSC::Structure* structure, JSC::JSGlobalObject* globalObject, KeyObject&& keyObject) { - JSPublicKeyObject* instance = new (NotNull, JSC::allocateCell(vm)) JSPublicKeyObject(vm, structure, WTFMove(keyObject)); + JSPublicKeyObject* instance = new (NotNull, JSC::allocateCell(vm)) JSPublicKeyObject(vm, structure, WTF::move(keyObject)); instance->finishCreation(vm, globalObject); return instance; } @@ -51,7 +51,7 @@ public: void finishCreation(JSC::VM&, JSC::JSGlobalObject*); JSPublicKeyObject(JSC::VM& vm, JSC::Structure* structure, KeyObject&& keyObject) - : Base(vm, structure, WTFMove(keyObject)) + : Base(vm, structure, WTF::move(keyObject)) { } }; diff --git a/src/bun.js/bindings/node/crypto/JSSecretKeyObject.h b/src/bun.js/bindings/node/crypto/JSSecretKeyObject.h index e0a2d95664..72a18a8acb 100644 --- a/src/bun.js/bindings/node/crypto/JSSecretKeyObject.h +++ b/src/bun.js/bindings/node/crypto/JSSecretKeyObject.h @@ -24,7 +24,7 @@ public: static JSSecretKeyObject* create(JSC::VM& vm, JSC::Structure* structure, JSC::JSGlobalObject* globalObject, KeyObject&& keyObject) { - JSSecretKeyObject* instance = new (NotNull, JSC::allocateCell(vm)) JSSecretKeyObject(vm, structure, WTFMove(keyObject)); + JSSecretKeyObject* instance = new (NotNull, JSC::allocateCell(vm)) JSSecretKeyObject(vm, structure, WTF::move(keyObject)); instance->finishCreation(vm, globalObject); return instance; } @@ -48,7 +48,7 @@ public: void finishCreation(JSC::VM&, JSC::JSGlobalObject*); JSSecretKeyObject(JSC::VM& vm, JSC::Structure* structure, KeyObject&& keyObject) - : Base(vm, structure, WTFMove(keyObject)) + : Base(vm, structure, WTF::move(keyObject)) { } }; diff --git a/src/bun.js/bindings/node/crypto/JSSign.cpp b/src/bun.js/bindings/node/crypto/JSSign.cpp index 7bb627dc5d..e5878a0baa 100644 --- a/src/bun.js/bindings/node/crypto/JSSign.cpp +++ b/src/bun.js/bindings/node/crypto/JSSign.cpp @@ -194,7 +194,7 @@ JSC_DEFINE_HOST_FUNCTION(jsSignProtoFuncInit, (JSC::JSGlobalObject * globalObjec } // Store the initialized context in the JSSign object - thisObject->m_mdCtx = WTFMove(mdCtx); + thisObject->m_mdCtx = WTF::move(mdCtx); return JSC::JSValue::encode(JSC::jsUndefined()); } @@ -303,7 +303,7 @@ JSUint8Array* signWithKey(JSC::JSGlobalObject* lexicalGlobalObject, JSSign* this } // Move mdCtx out of JSSign object - ncrypto::EVPMDCtxPointer mdCtx = WTFMove(thisObject->m_mdCtx); + ncrypto::EVPMDCtxPointer mdCtx = WTF::move(thisObject->m_mdCtx); // Validate DSA parameters if (!pkey.validateDsaParameters()) { @@ -394,7 +394,7 @@ JSUint8Array* signWithKey(JSC::JSGlobalObject* lexicalGlobalObject, JSSign* this // Create and return JSUint8Array auto* globalObject = defaultGlobalObject(lexicalGlobalObject); - RELEASE_AND_RETURN(scope, JSC::JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTFMove(sigBuffer), 0, finalSignatureLength)); + RELEASE_AND_RETURN(scope, JSC::JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTF::move(sigBuffer), 0, finalSignatureLength)); } JSC_DEFINE_HOST_FUNCTION(jsSignProtoFuncSign, (JSC::JSGlobalObject * lexicalGlobalObject, JSC::CallFrame* callFrame)) @@ -446,7 +446,7 @@ JSC_DEFINE_HOST_FUNCTION(jsSignProtoFuncSign, (JSC::JSGlobalObject * lexicalGlob KeyObject keyObject; if (prepareResult.keyData) { - keyObject = KeyObject::create(CryptoKeyType::Private, WTFMove(*prepareResult.keyData)); + keyObject = KeyObject::create(CryptoKeyType::Private, WTF::move(*prepareResult.keyData)); } else { keyObject = KeyObject::getPublicOrPrivateKey( lexicalGlobalObject, @@ -456,7 +456,7 @@ JSC_DEFINE_HOST_FUNCTION(jsSignProtoFuncSign, (JSC::JSGlobalObject * lexicalGlob prepareResult.formatType, prepareResult.encodingType, prepareResult.cipher, - WTFMove(prepareResult.passphrase)); + WTF::move(prepareResult.passphrase)); RETURN_IF_EXCEPTION(scope, {}); } diff --git a/src/bun.js/bindings/node/crypto/JSVerify.cpp b/src/bun.js/bindings/node/crypto/JSVerify.cpp index c019c06f36..7d566662d7 100644 --- a/src/bun.js/bindings/node/crypto/JSVerify.cpp +++ b/src/bun.js/bindings/node/crypto/JSVerify.cpp @@ -200,7 +200,7 @@ JSC_DEFINE_HOST_FUNCTION(jsVerifyProtoFuncInit, (JSGlobalObject * globalObject, } // Store the initialized context in the JSVerify object - thisObject->m_mdCtx = WTFMove(mdCtx); + thisObject->m_mdCtx = WTF::move(mdCtx); return JSC::JSValue::encode(JSC::jsUndefined()); } @@ -339,7 +339,7 @@ JSC_DEFINE_HOST_FUNCTION(jsVerifyProtoFuncVerify, (JSGlobalObject * globalObject KeyObject keyObject; if (prepareResult.keyData) { - keyObject = KeyObject::create(CryptoKeyType::Public, WTFMove(*prepareResult.keyData)); + keyObject = KeyObject::create(CryptoKeyType::Public, WTF::move(*prepareResult.keyData)); } else { keyObject = KeyObject::getPublicOrPrivateKey( globalObject, @@ -349,7 +349,7 @@ JSC_DEFINE_HOST_FUNCTION(jsVerifyProtoFuncVerify, (JSGlobalObject * globalObject prepareResult.formatType, prepareResult.encodingType, prepareResult.cipher, - WTFMove(prepareResult.passphrase)); + WTF::move(prepareResult.passphrase)); RETURN_IF_EXCEPTION(scope, {}); } @@ -367,7 +367,7 @@ JSC_DEFINE_HOST_FUNCTION(jsVerifyProtoFuncVerify, (JSGlobalObject * globalObject RETURN_IF_EXCEPTION(scope, {}); // Move mdCtx out of JSVerify object to finalize it - ncrypto::EVPMDCtxPointer mdCtx = WTFMove(thisObject->m_mdCtx); + ncrypto::EVPMDCtxPointer mdCtx = WTF::move(thisObject->m_mdCtx); // Validate DSA parameters if (!keyPtr.validateDsaParameters()) { @@ -485,7 +485,7 @@ std::optional keyFromPublicString(JSGlobalObject* lexica auto publicRes = ncrypto::EVPKeyPointer::TryParsePublicKey(publicConfig, ncryptoBuf); if (publicRes) { - ncrypto::EVPKeyPointer keyPtr(WTFMove(publicRes.value)); + ncrypto::EVPKeyPointer keyPtr(WTF::move(publicRes.value)); return keyPtr; } @@ -494,7 +494,7 @@ std::optional keyFromPublicString(JSGlobalObject* lexica privateConfig.format = ncrypto::EVPKeyPointer::PKFormatType::PEM; auto privateRes = ncrypto::EVPKeyPointer::TryParsePrivateKey(privateConfig, ncryptoBuf); if (privateRes) { - ncrypto::EVPKeyPointer keyPtr(WTFMove(privateRes.value)); + ncrypto::EVPKeyPointer keyPtr(WTF::move(privateRes.value)); return keyPtr; } } diff --git a/src/bun.js/bindings/node/crypto/KeyObject.cpp b/src/bun.js/bindings/node/crypto/KeyObject.cpp index 0a1d9658b6..601f607ba2 100644 --- a/src/bun.js/bindings/node/crypto/KeyObject.cpp +++ b/src/bun.js/bindings/node/crypto/KeyObject.cpp @@ -298,7 +298,7 @@ JSValue toJS(JSGlobalObject* lexicalGlobalObject, ThrowScope& scope, const ncryp } memcpy(buf->data(), bptr->data, bptr->length); - return JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTFMove(buf), 0, bptr->length); + return JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTF::move(buf), 0, bptr->length); } JSC::JSValue KeyObject::exportPublic(JSC::JSGlobalObject* lexicalGlobalObject, JSC::ThrowScope& scope, const ncrypto::EVPKeyPointer::PublicKeyEncodingConfig& config) @@ -312,7 +312,7 @@ JSC::JSValue KeyObject::exportPublic(JSC::JSGlobalObject* lexicalGlobalObject, J KeyObject keyObject = *this; keyObject.type() = CryptoKeyType::Public; Structure* structure = globalObject->m_JSPublicKeyObjectClassStructure.get(lexicalGlobalObject); - JSPublicKeyObject* publicKey = JSPublicKeyObject::create(vm, structure, lexicalGlobalObject, WTFMove(keyObject)); + JSPublicKeyObject* publicKey = JSPublicKeyObject::create(vm, structure, lexicalGlobalObject, WTF::move(keyObject)); return publicKey; } @@ -340,7 +340,7 @@ JSValue KeyObject::exportPrivate(JSGlobalObject* lexicalGlobalObject, ThrowScope if (config.output_key_object) { KeyObject keyObject = *this; Structure* structure = globalObject->m_JSPrivateKeyObjectClassStructure.get(lexicalGlobalObject); - JSPrivateKeyObject* privateKey = JSPrivateKeyObject::create(vm, structure, lexicalGlobalObject, WTFMove(keyObject)); + JSPrivateKeyObject* privateKey = JSPrivateKeyObject::create(vm, structure, lexicalGlobalObject, WTF::move(keyObject)); return privateKey; } @@ -420,7 +420,7 @@ JSValue KeyObject::exportSecret(JSGlobalObject* lexicalGlobalObject, ThrowScope& return {}; } memcpy(buf->data(), key.begin(), key.size()); - return JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTFMove(buf), 0, key.size()); + return JSUint8Array::create(lexicalGlobalObject, globalObject->JSBufferSubclassStructure(), WTF::move(buf), 0, key.size()); }; if (!optionsValue.isUndefined()) { @@ -648,7 +648,7 @@ static std::optional*> getSymmetricKey(const WebCore::Cryp KeyObject KeyObject::create(CryptoKeyType type, RefPtr&& data) { - return KeyObject(type, WTFMove(data)); + return KeyObject(type, WTF::move(data)); } WebCore::ExceptionOr KeyObject::create(WebCore::CryptoKey& key) @@ -664,7 +664,7 @@ WebCore::ExceptionOr KeyObject::create(WebCore::CryptoKey& key) WTF::Vector copy; copy.appendVector(*keyData.value()); - return create(WTFMove(copy)); + return create(WTF::move(copy)); } case WebCore::CryptoKeyType::Public: { @@ -678,7 +678,7 @@ WebCore::ExceptionOr KeyObject::create(WebCore::CryptoKey& key) EVP_PKEY_up_ref(keyValue.key); ncrypto::EVPKeyPointer keyPtr(keyValue.key); - return create(CryptoKeyType::Public, WTFMove(keyPtr)); + return create(CryptoKeyType::Public, WTF::move(keyPtr)); } case WebCore::CryptoKeyType::Private: { @@ -692,7 +692,7 @@ WebCore::ExceptionOr KeyObject::create(WebCore::CryptoKey& key) EVP_PKEY_up_ref(keyValue.key); ncrypto::EVPKeyPointer keyPtr(keyValue.key); - return create(CryptoKeyType::Private, WTFMove(keyPtr)); + return create(CryptoKeyType::Private, WTF::move(keyPtr)); } } @@ -701,14 +701,14 @@ WebCore::ExceptionOr KeyObject::create(WebCore::CryptoKey& key) KeyObject KeyObject::create(WTF::Vector&& symmetricKey) { - RefPtr data = KeyObjectData::create(WTFMove(symmetricKey)); - return KeyObject(CryptoKeyType::Secret, WTFMove(data)); + RefPtr data = KeyObjectData::create(WTF::move(symmetricKey)); + return KeyObject(CryptoKeyType::Secret, WTF::move(data)); } KeyObject KeyObject::create(CryptoKeyType type, ncrypto::EVPKeyPointer&& asymmetricKey) { - RefPtr data = KeyObjectData::create(WTFMove(asymmetricKey)); - return KeyObject(type, WTFMove(data)); + RefPtr data = KeyObjectData::create(WTF::move(asymmetricKey)); + return KeyObject(type, WTF::move(data)); } void KeyObject::getKeyObjectFromHandle(JSGlobalObject* globalObject, ThrowScope& scope, JSValue keyValue, const KeyObject& handle, PrepareAsymmetricKeyMode mode) @@ -880,7 +880,7 @@ KeyObject KeyObject::getKeyObjectHandleFromJwk(JSGlobalObject* globalObject, Thr return {}; } - return create(keyType, WTFMove(key)); + return create(keyType, WTF::move(key)); } case Kty::Ec: { auto crvView = getJwkStringView(globalObject, scope, jwk, "crv"_s, "key.crv"_s); @@ -942,7 +942,7 @@ KeyObject KeyObject::getKeyObjectHandleFromJwk(JSGlobalObject* globalObject, Thr auto key = EVPKeyPointer::New(); key.set(ec); - return create(keyType, WTFMove(key)); + return create(keyType, WTF::move(key)); } case Kty::Rsa: { auto nView = getJwkStringView(globalObject, scope, jwk, "n"_s, "key.n"_s); @@ -989,8 +989,8 @@ KeyObject KeyObject::getKeyObjectHandleFromJwk(JSGlobalObject* globalObject, Thr } } - auto key = EVPKeyPointer::NewRSA(WTFMove(rsa)); - return create(keyType, WTFMove(key)); + auto key = EVPKeyPointer::NewRSA(WTF::move(rsa)); + return create(keyType, WTF::move(key)); } } @@ -1041,7 +1041,7 @@ EVPKeyPointer::PrivateKeyEncodingConfig KeyObject::getPrivateKeyEncoding( } if (passphrase) { - config.passphrase = WTFMove(*passphrase); + config.passphrase = WTF::move(*passphrase); } } @@ -1071,13 +1071,13 @@ KeyObject KeyObject::getPublicOrPrivateKey( formatType, encodingType, cipher, - WTFMove(passphrase), + WTF::move(passphrase), KeyEncodingContext::Input); RETURN_IF_EXCEPTION(scope, {}); auto res = EVPKeyPointer::TryParsePrivateKey(config, buf); if (res) { - return create(CryptoKeyType::Private, WTFMove(res.value)); + return create(CryptoKeyType::Private, WTF::move(res.value)); } if (res.error.value() == EVPKeyPointer::PKParseError::NEED_PASSPHRASE) { @@ -1099,20 +1099,20 @@ KeyObject KeyObject::getPublicOrPrivateKey( formatType, encodingType, cipher, - WTFMove(passphrase), + WTF::move(passphrase), KeyEncodingContext::Input); RETURN_IF_EXCEPTION(scope, {}); if (config.format == EVPKeyPointer::PKFormatType::PEM) { auto publicRes = EVPKeyPointer::TryParsePublicKeyPEM(buf); if (publicRes) { - return create(CryptoKeyType::Public, WTFMove(publicRes.value)); + return create(CryptoKeyType::Public, WTF::move(publicRes.value)); } if (publicRes.error.value() == EVPKeyPointer::PKParseError::NOT_RECOGNIZED) { auto privateRes = EVPKeyPointer::TryParsePrivateKey(config, buf); if (privateRes) { - return create(CryptoKeyType::Public, WTFMove(privateRes.value)); + return create(CryptoKeyType::Public, WTF::move(privateRes.value)); } if (privateRes.error.value() == EVPKeyPointer::PKParseError::NEED_PASSPHRASE) { @@ -1145,7 +1145,7 @@ KeyObject KeyObject::getPublicOrPrivateKey( if (isPublic(config, buf)) { auto res = EVPKeyPointer::TryParsePublicKey(config, buf); if (res) { - return create(CryptoKeyType::Public, WTFMove(res.value)); + return create(CryptoKeyType::Public, WTF::move(res.value)); } throwCryptoError(globalObject, scope, res.openssl_error.value_or(0), "Failed to read asymmetric key"_s); @@ -1154,7 +1154,7 @@ KeyObject KeyObject::getPublicOrPrivateKey( auto res = EVPKeyPointer::TryParsePrivateKey(config, buf); if (res) { - return create(CryptoKeyType::Private, WTFMove(res.value)); + return create(CryptoKeyType::Private, WTF::move(res.value)); } if (res.error.value() == EVPKeyPointer::PKParseError::NEED_PASSPHRASE) { @@ -1343,7 +1343,7 @@ KeyObject::PrepareAsymmetricKeyResult KeyObject::prepareAsymmetricKey(JSC::JSGlo .formatType = config.format, .encodingType = config.type, .cipher = config.cipher, - .passphrase = WTFMove(config.passphrase), + .passphrase = WTF::move(config.passphrase), }; } } @@ -1360,7 +1360,7 @@ KeyObject::PrepareAsymmetricKeyResult KeyObject::prepareAsymmetricKey(JSC::JSGlo .formatType = config.format, .encodingType = config.type, .cipher = config.cipher, - .passphrase = WTFMove(config.passphrase), + .passphrase = WTF::move(config.passphrase), }; } @@ -1377,7 +1377,7 @@ KeyObject::PrepareAsymmetricKeyResult KeyObject::prepareAsymmetricKey(JSC::JSGlo .formatType = config.format, .encodingType = config.type, .cipher = config.cipher, - .passphrase = WTFMove(config.passphrase), + .passphrase = WTF::move(config.passphrase), }; } @@ -1460,14 +1460,14 @@ KeyObject KeyObject::prepareSecretKey(JSGlobalObject* globalObject, ThrowScope& Vector copy; copy.append(view->span()); - return create(WTFMove(copy)); + return create(WTF::move(copy)); } // TODO(dylan-conway): avoid copying by keeping the buffer alive if (auto* view = jsDynamicCast(keyValue)) { Vector copy; copy.append(view->span()); - return create(WTFMove(copy)); + return create(WTF::move(copy)); } // TODO(dylan-conway): avoid copying by keeping the buffer alive @@ -1475,7 +1475,7 @@ KeyObject KeyObject::prepareSecretKey(JSGlobalObject* globalObject, ThrowScope& auto* impl = arrayBuffer->impl(); Vector copy; copy.append(impl->span()); - return create(WTFMove(copy)); + return create(WTF::move(copy)); } if (bufferOnly) { diff --git a/src/bun.js/bindings/node/crypto/KeyObject.h b/src/bun.js/bindings/node/crypto/KeyObject.h index f33fb40382..d783cf9102 100644 --- a/src/bun.js/bindings/node/crypto/KeyObject.h +++ b/src/bun.js/bindings/node/crypto/KeyObject.h @@ -16,7 +16,7 @@ class KeyObject { WTF_MAKE_TZONE_ALLOCATED(KeyObject); KeyObject(WebCore::CryptoKeyType type, RefPtr&& data) - : m_data(WTFMove(data)) + : m_data(WTF::move(data)) , m_type(type) { } diff --git a/src/bun.js/bindings/node/crypto/KeyObjectData.h b/src/bun.js/bindings/node/crypto/KeyObjectData.h index 46ccfda7e2..ce7450afb1 100644 --- a/src/bun.js/bindings/node/crypto/KeyObjectData.h +++ b/src/bun.js/bindings/node/crypto/KeyObjectData.h @@ -8,12 +8,12 @@ struct KeyObjectData : ThreadSafeRefCounted { WTF_MAKE_TZONE_ALLOCATED(KeyObjectData); KeyObjectData(WTF::Vector&& symmetricKey) - : symmetricKey(WTFMove(symmetricKey)) + : symmetricKey(WTF::move(symmetricKey)) { } KeyObjectData(ncrypto::EVPKeyPointer&& asymmetricKey) - : asymmetricKey(WTFMove(asymmetricKey)) + : asymmetricKey(WTF::move(asymmetricKey)) { } @@ -22,12 +22,12 @@ public: static RefPtr create(WTF::Vector&& symmetricKey) { - return adoptRef(*new KeyObjectData(WTFMove(symmetricKey))); + return adoptRef(*new KeyObjectData(WTF::move(symmetricKey))); } static RefPtr create(ncrypto::EVPKeyPointer&& asymmetricKey) { - return adoptRef(*new KeyObjectData(WTFMove(asymmetricKey))); + return adoptRef(*new KeyObjectData(WTF::move(asymmetricKey))); } WTF::Vector symmetricKey; diff --git a/src/bun.js/bindings/node/crypto/node_crypto_binding.cpp b/src/bun.js/bindings/node/crypto/node_crypto_binding.cpp index e490ebfabd..e8c2d019da 100644 --- a/src/bun.js/bindings/node/crypto/node_crypto_binding.cpp +++ b/src/bun.js/bindings/node/crypto/node_crypto_binding.cpp @@ -197,7 +197,7 @@ JSC_DEFINE_HOST_FUNCTION(jsCertExportChallenge, (JSC::JSGlobalObject * lexicalGl return JSValue::encode(jsEmptyString(vm)); } - auto* bufferResult = JSC::JSUint8Array::create(lexicalGlobalObject, static_cast(lexicalGlobalObject)->JSBufferSubclassStructure(), WTFMove(result), 0, cert.len); + auto* bufferResult = JSC::JSUint8Array::create(lexicalGlobalObject, static_cast(lexicalGlobalObject)->JSBufferSubclassStructure(), WTF::move(result), 0, cert.len); RETURN_IF_EXCEPTION(scope, {}); return JSValue::encode(bufferResult); diff --git a/src/bun.js/bindings/webcore/AbortSignal.cpp b/src/bun.js/bindings/webcore/AbortSignal.cpp index 3b4f2217c6..1e36c497db 100644 --- a/src/bun.js/bindings/webcore/AbortSignal.cpp +++ b/src/bun.js/bindings/webcore/AbortSignal.cpp @@ -191,7 +191,7 @@ void AbortSignal::signalAbort(JSC::JSValue reason) for (Ref dependentSignal : std::exchange(m_dependentSignals, {})) { if (!dependentSignal->aborted()) { dependentSignal->markAborted(reason); - dependentSignalsToAbort.append(WTFMove(dependentSignal)); + dependentSignalsToAbort.append(WTF::move(dependentSignal)); } } @@ -222,7 +222,7 @@ void AbortSignal::cleanNativeBindings(void* ref) return ctx == ref; }); - std::exchange(m_native_callbacks, WTFMove(callbacks)); + std::exchange(m_native_callbacks, WTF::move(callbacks)); this->eventListenersDidChange(); } @@ -257,7 +257,7 @@ uint32_t AbortSignal::addAbortAlgorithmToSignal(AbortSignal& signal, RefhandleEvent(signal.jsReason(*signal.scriptExecutionContext()->jsGlobalObject())); return 0; } - return signal.addAlgorithm([algorithm = WTFMove(algorithm)](JSC::JSValue value) mutable { + return signal.addAlgorithm([algorithm = WTF::move(algorithm)](JSC::JSValue value) mutable { algorithm->handleEvent(value); }); } @@ -269,7 +269,7 @@ void AbortSignal::removeAbortAlgorithmFromSignal(AbortSignal& signal, uint32_t a uint32_t AbortSignal::addAlgorithm(Algorithm&& algorithm) { - m_algorithms.append(std::make_pair(++m_algorithmIdentifier, WTFMove(algorithm))); + m_algorithms.append(std::make_pair(++m_algorithmIdentifier, WTF::move(algorithm))); return m_algorithmIdentifier; } diff --git a/src/bun.js/bindings/webcore/ActiveDOMObject.cpp b/src/bun.js/bindings/webcore/ActiveDOMObject.cpp index d2662f8e9f..39eb5d4d02 100644 --- a/src/bun.js/bindings/webcore/ActiveDOMObject.cpp +++ b/src/bun.js/bindings/webcore/ActiveDOMObject.cpp @@ -134,7 +134,7 @@ // auto* context = scriptExecutionContext(); // if (!context) // return; -// context->eventLoop().queueTask(source, WTFMove(function)); +// context->eventLoop().queueTask(source, WTF::move(function)); // } // class ActiveDOMObjectEventDispatchTask : public EventLoopTask { @@ -142,7 +142,7 @@ // ActiveDOMObjectEventDispatchTask(TaskSource source, EventLoopTaskGroup& group, ActiveDOMObject& object, Function&& dispatchEvent) // : EventLoopTask(source, group) // , m_object(object) -// , m_dispatchEvent(WTFMove(dispatchEvent)) +// , m_dispatchEvent(WTF::move(dispatchEvent)) // { // ++m_object.m_pendingActivityInstanceCount; // } @@ -173,10 +173,10 @@ // if (!context) // return; // auto& eventLoopTaskGroup = context->eventLoop(); -// auto task = makeUnique(source, eventLoopTaskGroup, *this, [target = Ref { target }, event = WTFMove(event)] { +// auto task = makeUnique(source, eventLoopTaskGroup, *this, [target = Ref { target }, event = WTF::move(event)] { // target->dispatchEvent(event); // }); -// eventLoopTaskGroup.queueTask(WTFMove(task)); +// eventLoopTaskGroup.queueTask(WTF::move(task)); // } // void ActiveDOMObject::queueCancellableTaskToDispatchEventInternal(EventTarget& target, TaskSource source, TaskCancellationGroup& cancellationGroup, Ref&& event) @@ -186,10 +186,10 @@ // if (!context) // return; // auto& eventLoopTaskGroup = context->eventLoop(); -// auto task = makeUnique(source, eventLoopTaskGroup, *this, CancellableTask(cancellationGroup, [target = Ref { target }, event = WTFMove(event)] { +// auto task = makeUnique(source, eventLoopTaskGroup, *this, CancellableTask(cancellationGroup, [target = Ref { target }, event = WTF::move(event)] { // target->dispatchEvent(event); // })); -// eventLoopTaskGroup.queueTask(WTFMove(task)); +// eventLoopTaskGroup.queueTask(WTF::move(task)); // } // } // namespace WebCore diff --git a/src/bun.js/bindings/webcore/ActiveDOMObject.h b/src/bun.js/bindings/webcore/ActiveDOMObject.h index 52daebc6fa..99a444e352 100644 --- a/src/bun.js/bindings/webcore/ActiveDOMObject.h +++ b/src/bun.js/bindings/webcore/ActiveDOMObject.h @@ -106,7 +106,7 @@ // template // static void queueTaskKeepingObjectAlive(T& object, TaskSource source, Function&& task) // { -// object.queueTaskInEventLoop(source, [protectedObject = Ref { object }, activity = object.ActiveDOMObject::makePendingActivity(object), task = WTFMove(task)] () { +// object.queueTaskInEventLoop(source, [protectedObject = Ref { object }, activity = object.ActiveDOMObject::makePendingActivity(object), task = WTF::move(task)] () { // task(); // }); // } @@ -114,8 +114,8 @@ // template // static void queueCancellableTaskKeepingObjectAlive(T& object, TaskSource source, TaskCancellationGroup& cancellationGroup, Function&& task) // { -// CancellableTask cancellableTask(cancellationGroup, WTFMove(task)); -// object.queueTaskInEventLoop(source, [protectedObject = Ref { object }, activity = object.ActiveDOMObject::makePendingActivity(object), cancellableTask = WTFMove(cancellableTask)]() mutable { +// CancellableTask cancellableTask(cancellationGroup, WTF::move(task)); +// object.queueTaskInEventLoop(source, [protectedObject = Ref { object }, activity = object.ActiveDOMObject::makePendingActivity(object), cancellableTask = WTF::move(cancellableTask)]() mutable { // cancellableTask(); // }); // } @@ -123,13 +123,13 @@ // template // static void queueTaskToDispatchEvent(EventTargetType& target, TaskSource source, Ref&& event) // { -// target.queueTaskToDispatchEventInternal(target, source, WTFMove(event)); +// target.queueTaskToDispatchEventInternal(target, source, WTF::move(event)); // } // template // static void queueCancellableTaskToDispatchEvent(EventTargetType& target, TaskSource source, TaskCancellationGroup& cancellationGroup, Ref&& event) // { -// target.queueCancellableTaskToDispatchEventInternal(target, source, cancellationGroup, WTFMove(event)); +// target.queueCancellableTaskToDispatchEventInternal(target, source, cancellationGroup, WTF::move(event)); // } // protected: diff --git a/src/bun.js/bindings/webcore/AddEventListenerOptions.h b/src/bun.js/bindings/webcore/AddEventListenerOptions.h index 79128ee152..ddf74b529b 100644 --- a/src/bun.js/bindings/webcore/AddEventListenerOptions.h +++ b/src/bun.js/bindings/webcore/AddEventListenerOptions.h @@ -36,7 +36,7 @@ struct AddEventListenerOptions : EventListenerOptions { : EventListenerOptions(capture) , passive(passive) , once(once) - , signal(WTFMove(signal)) + , signal(WTF::move(signal)) { } diff --git a/src/bun.js/bindings/webcore/BroadcastChannel.cpp b/src/bun.js/bindings/webcore/BroadcastChannel.cpp index bf4dab991e..f0b3ebbbb5 100644 --- a/src/bun.js/bindings/webcore/BroadcastChannel.cpp +++ b/src/bun.js/bindings/webcore/BroadcastChannel.cpp @@ -71,7 +71,7 @@ static UncheckedKeyHashMap, public Identified { @@ -123,7 +123,7 @@ void BroadcastChannel::MainThreadBridge::ensureOnMainThread(Functionm_name, protectedThis->identifier()); channelToContextIdentifier().add(protectedThis->identifier(), contextId); }); @@ -142,7 +142,7 @@ void BroadcastChannel::MainThreadBridge::unregisterChannel() { Ref protectedThis { *this }; - ScriptExecutionContext::ensureOnMainThread([protectedThis = WTFMove(protectedThis)](auto& context) { + ScriptExecutionContext::ensureOnMainThread([protectedThis = WTF::move(protectedThis)](auto& context) { context.broadcastChannelRegistry().unregisterChannel(protectedThis->m_name, protectedThis->identifier()); channelToContextIdentifier().remove(protectedThis->identifier()); }); @@ -152,8 +152,8 @@ void BroadcastChannel::MainThreadBridge::postMessage(Ref& { Ref protectedThis { *this }; - ScriptExecutionContext::ensureOnMainThread([protectedThis = WTFMove(protectedThis), message = WTFMove(message)](auto& context) mutable { - context.broadcastChannelRegistry().postMessage(protectedThis->m_name, protectedThis->identifier(), WTFMove(message)); + ScriptExecutionContext::ensureOnMainThread([protectedThis = WTF::move(protectedThis), message = WTF::move(message)](auto& context) mutable { + context.broadcastChannelRegistry().postMessage(protectedThis->m_name, protectedThis->identifier(), WTF::move(message)); }); } @@ -237,14 +237,14 @@ void BroadcastChannel::dispatchMessageTo(BroadcastChannelIdentifier channelIdent if (!contextIdentifier) return; - ScriptExecutionContext::ensureOnContextThread(contextIdentifier, [channelIdentifier, message = WTFMove(message)](auto&) mutable { + ScriptExecutionContext::ensureOnContextThread(contextIdentifier, [channelIdentifier, message = WTF::move(message)](auto&) mutable { RefPtr channel; { Locker locker { allBroadcastChannelsLock }; channel = allBroadcastChannels().get(channelIdentifier); } if (channel) - channel->dispatchMessage(WTFMove(message)); + channel->dispatchMessage(WTF::move(message)); }); } @@ -256,7 +256,7 @@ void BroadcastChannel::dispatchMessage(Ref&& message) if (m_isClosed) return; - ScriptExecutionContext::postTaskTo(contextIdForBroadcastChannelId(m_mainThreadBridge->identifier()), [this, message = WTFMove(message)](ScriptExecutionContext& context) mutable { + ScriptExecutionContext::postTaskTo(contextIdForBroadcastChannelId(m_mainThreadBridge->identifier()), [this, message = WTF::move(message)](ScriptExecutionContext& context) mutable { if (m_isClosed) return; @@ -267,7 +267,7 @@ void BroadcastChannel::dispatchMessage(Ref&& message) auto& vm = JSC::getVM(globalObject); auto scope = DECLARE_CATCH_SCOPE(vm); Vector> dummyPorts; - auto event = MessageEvent::create(*globalObject, WTFMove(message), {}, {}, nullptr, WTFMove(dummyPorts)); + auto event = MessageEvent::create(*globalObject, WTF::move(message), {}, {}, nullptr, WTF::move(dummyPorts)); if (scope.exception()) [[unlikely]] { // Currently, we assume that the only way we can get here is if we have a termination. RELEASE_ASSERT(vm.hasPendingTerminationException()); diff --git a/src/bun.js/bindings/webcore/BufferSource.h b/src/bun.js/bindings/webcore/BufferSource.h index 5e8f688a3d..2915b6f6d1 100644 --- a/src/bun.js/bindings/webcore/BufferSource.h +++ b/src/bun.js/bindings/webcore/BufferSource.h @@ -39,7 +39,7 @@ public: BufferSource() {} BufferSource(VariantType&& variant) - : m_variant(WTFMove(variant)) + : m_variant(WTF::move(variant)) { } diff --git a/src/bun.js/bindings/webcore/BunBroadcastChannelRegistry.cpp b/src/bun.js/bindings/webcore/BunBroadcastChannelRegistry.cpp index 258d297170..e8155aa993 100644 --- a/src/bun.js/bindings/webcore/BunBroadcastChannelRegistry.cpp +++ b/src/bun.js/bindings/webcore/BunBroadcastChannelRegistry.cpp @@ -45,7 +45,7 @@ void BunBroadcastChannelRegistry::postMessageLocally(const String& name, Broadca void BunBroadcastChannelRegistry::postMessageToRemote(const String& name, MessageWithMessagePorts&& message) { - // auto callbackAggregator = CallbackAggregator::create(WTFMove(completionHandler)); + // auto callbackAggregator = CallbackAggregator::create(WTF::move(completionHandler)); // PartitionedSecurityOrigin origin { clientOrigin.topOrigin.securityOrigin(), clientOrigin.clientOrigin.securityOrigin() }; // postMessageLocally(origin, name, std::nullopt, *message.message, callbackAggregator.copyRef()); } diff --git a/src/bun.js/bindings/webcore/CallbackResult.h b/src/bun.js/bindings/webcore/CallbackResult.h index abedf5a2ff..f0ce0cc7d6 100644 --- a/src/bun.js/bindings/webcore/CallbackResult.h +++ b/src/bun.js/bindings/webcore/CallbackResult.h @@ -64,7 +64,7 @@ template inline CallbackResult::CallbackResult( } template inline CallbackResult::CallbackResult(ReturnType&& returnValue) - : m_value(WTFMove(returnValue)) + : m_value(WTF::move(returnValue)) { } @@ -76,7 +76,7 @@ template inline CallbackResultType CallbackResult inline auto CallbackResult::releaseReturnValue() -> ReturnType&& { ASSERT(m_value.has_value()); - return WTFMove(m_value.value()); + return WTF::move(m_value.value()); } // Void specialization diff --git a/src/bun.js/bindings/webcore/DOMPromiseProxy.h b/src/bun.js/bindings/webcore/DOMPromiseProxy.h index 765528460b..573ee5d517 100644 --- a/src/bun.js/bindings/webcore/DOMPromiseProxy.h +++ b/src/bun.js/bindings/webcore/DOMPromiseProxy.h @@ -206,7 +206,7 @@ inline void DOMPromiseProxy::reject(Exception exception, RejectAsHandle { ASSERT(!m_valueOrException); - m_valueOrException = ExceptionOr { WTFMove(exception) }; + m_valueOrException = ExceptionOr { WTF::move(exception) }; for (auto& deferredPromise : m_deferredPromises) deferredPromise->reject(m_valueOrException->exception(), rejectAsHandled); } @@ -260,7 +260,7 @@ inline void DOMPromiseProxy::resolve() inline void DOMPromiseProxy::reject(Exception exception, RejectAsHandled rejectAsHandled) { ASSERT(!m_valueOrException); - m_valueOrException = ExceptionOr { WTFMove(exception) }; + m_valueOrException = ExceptionOr { WTF::move(exception) }; for (auto& deferredPromise : m_deferredPromises) deferredPromise->reject(m_valueOrException->exception(), rejectAsHandled); } @@ -276,7 +276,7 @@ inline DOMPromiseProxyWithResolveCallback::DOMPromiseProxyWithResolveCa template inline DOMPromiseProxyWithResolveCallback::DOMPromiseProxyWithResolveCallback(ResolveCallback&& function) - : m_resolveCallback(WTFMove(function)) + : m_resolveCallback(WTF::move(function)) { } @@ -344,7 +344,7 @@ inline void DOMPromiseProxyWithResolveCallback::reject(Exception except { ASSERT(!m_valueOrException); - m_valueOrException = ExceptionOr { WTFMove(exception) }; + m_valueOrException = ExceptionOr { WTF::move(exception) }; for (auto& deferredPromise : m_deferredPromises) deferredPromise->reject(m_valueOrException->exception(), rejectAsHandled); } diff --git a/src/bun.js/bindings/webcore/ErrorCallback.cpp b/src/bun.js/bindings/webcore/ErrorCallback.cpp index 5c9aab344c..f54160caa2 100644 --- a/src/bun.js/bindings/webcore/ErrorCallback.cpp +++ b/src/bun.js/bindings/webcore/ErrorCallback.cpp @@ -33,7 +33,7 @@ namespace WebCore { void ErrorCallback::scheduleCallback(ScriptExecutionContext& context, Ref&& exception) { - context.postTask([protectedThis = Ref { *this }, exception = WTFMove(exception)](ScriptExecutionContext&) { + context.postTask([protectedThis = Ref { *this }, exception = WTF::move(exception)](ScriptExecutionContext&) { protectedThis->handleEvent(exception); }); } diff --git a/src/bun.js/bindings/webcore/Event.cpp b/src/bun.js/bindings/webcore/Event.cpp index 0e4bd33690..f2619e598b 100644 --- a/src/bun.js/bindings/webcore/Event.cpp +++ b/src/bun.js/bindings/webcore/Event.cpp @@ -126,7 +126,7 @@ void Event::setTarget(RefPtr&& target) if (m_target == target) return; - m_target = WTFMove(target); + m_target = WTF::move(target); if (m_target) receivedTarget(); } diff --git a/src/bun.js/bindings/webcore/EventContext.h b/src/bun.js/bindings/webcore/EventContext.h index 41214c9d3c..98c1479bb1 100644 --- a/src/bun.js/bindings/webcore/EventContext.h +++ b/src/bun.js/bindings/webcore/EventContext.h @@ -106,7 +106,7 @@ private: inline EventContext::EventContext(Type type, Node* node, RefPtr&& currentTarget, EventTarget* origin, int closedShadowDepth, bool currentTargetIsInShadowTree) : m_node { node } - , m_currentTarget { WTFMove(currentTarget) } + , m_currentTarget { WTF::move(currentTarget) } , m_target { origin } , m_closedShadowDepth { closedShadowDepth } , m_currentTargetIsInShadowTree { currentTargetIsInShadowTree } diff --git a/src/bun.js/bindings/webcore/EventEmitter.cpp b/src/bun.js/bindings/webcore/EventEmitter.cpp index afdbedab4c..c9ab566b41 100644 --- a/src/bun.js/bindings/webcore/EventEmitter.cpp +++ b/src/bun.js/bindings/webcore/EventEmitter.cpp @@ -265,7 +265,7 @@ bool EventEmitter::innerInvokeEventListeners(const Identifier& eventType, Simple errorValue = JSC::jsUndefined(); } expcep.append(errorValue); - fireEventListeners(errorIdentifier, WTFMove(expcep)); + fireEventListeners(errorIdentifier, WTF::move(expcep)); } } } diff --git a/src/bun.js/bindings/webcore/EventFactory.cpp b/src/bun.js/bindings/webcore/EventFactory.cpp index e920afe217..062a6aac8e 100644 --- a/src/bun.js/bindings/webcore/EventFactory.cpp +++ b/src/bun.js/bindings/webcore/EventFactory.cpp @@ -37,277 +37,277 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj { switch (impl->eventInterface()) { // case AnimationEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // case AnimationPlaybackEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #if ENABLE(APPLE_PAY) // case ApplePayCancelEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(APPLE_PAY_COUPON_CODE) // case ApplePayCouponCodeChangedEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(APPLE_PAY) // case ApplePayPaymentAuthorizedEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(APPLE_PAY) // case ApplePayPaymentMethodSelectedEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(APPLE_PAY) // case ApplePayShippingContactSelectedEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(APPLE_PAY) // case ApplePayShippingMethodSelectedEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(APPLE_PAY) // case ApplePayValidateMerchantEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(WEB_AUDIO) // case AudioProcessingEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif case EventInterfaceType: { - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } // case BeforeUnloadEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #if ENABLE(MEDIA_RECORDER) // case BlobEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // case ClipboardEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); case CloseEventInterfaceType: { - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } // case CompositionEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // case CustomEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #if ENABLE(DEVICE_ORIENTATION) // case DeviceMotionEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(DEVICE_ORIENTATION) // case DeviceOrientationEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // case DragEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); case ErrorEventInterfaceType: { - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } // #if ENABLE(SERVICE_WORKER) // case ExtendableEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(SERVICE_WORKER) // case ExtendableMessageEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(SERVICE_WORKER) // case FetchEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // case FocusEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // case FormDataEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #if ENABLE(GAMEPAD) // case GamepadEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(IOS_GESTURE_EVENTS) || ENABLE(MAC_GESTURE_EVENTS) // case GestureEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // case HashChangeEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // case IDBVersionChangeEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // case InputEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // case KeyboardEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #if ENABLE(ENCRYPTED_MEDIA) // case MediaEncryptedEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(ENCRYPTED_MEDIA) // case MediaKeyMessageEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // case MediaQueryListEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #if ENABLE(MEDIA_RECORDER) // case MediaRecorderErrorEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(MEDIA_STREAM) // case MediaStreamTrackEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(PAYMENT_REQUEST) // case MerchantValidationEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif case MessageEventInterfaceType: - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); // case MouseEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // case MutationEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #if ENABLE(NOTIFICATION_EVENT) // case NotificationEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(WEB_AUDIO) // case OfflineAudioCompletionEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(MEDIA_STREAM) // case OverconstrainedErrorEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // case OverflowEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // case PageTransitionEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #if ENABLE(PAYMENT_REQUEST) // case PaymentMethodChangeEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(PAYMENT_REQUEST) // case PaymentRequestUpdateEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(PICTURE_IN_PICTURE_API) // case PictureInPictureEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // case PointerEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // case PopStateEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // case ProgressEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // case PromiseRejectionEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #if ENABLE(SERVICE_WORKER) // case PushEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(SERVICE_WORKER) // case PushSubscriptionChangeEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(WEB_RTC) // case RTCDTMFToneChangeEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(WEB_RTC) // case RTCDataChannelEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(WEB_RTC) // case RTCErrorEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(WEB_RTC) // case RTCPeerConnectionIceErrorEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(WEB_RTC) // case RTCPeerConnectionIceEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(WEB_RTC) // case RTCRtpSFrameTransformErrorEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(WEB_RTC) // case RTCTrackEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(WEB_RTC) // case RTCTransformEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // case SVGZoomEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // case SecurityPolicyViolationEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // case SpeechRecognitionErrorEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // case SpeechRecognitionEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #if ENABLE(SPEECH_SYNTHESIS) // case SpeechSynthesisErrorEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(SPEECH_SYNTHESIS) // case SpeechSynthesisEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // case StorageEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // case SubmitEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // case TextEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #if ENABLE(TOUCH_EVENTS) // case TouchEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(VIDEO) // case TrackEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // case TransitionEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // case UIEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #if ENABLE(WEBGL) // case WebGLContextEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(LEGACY_ENCRYPTED_MEDIA) // case WebKitMediaKeyMessageEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(LEGACY_ENCRYPTED_MEDIA) // case WebKitMediaKeyNeededEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(WIRELESS_PLAYBACK_TARGET) // case WebKitPlaybackTargetAvailabilityEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // case WheelEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // case XMLHttpRequestProgressEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #if ENABLE(WEBXR) // case XRInputSourceEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(WEBXR) // case XRInputSourcesChangeEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(WEBXR) // case XRReferenceSpaceEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // #if ENABLE(WEBXR) // case XRSessionEventInterfaceType: - // return createWrapper(globalObject, WTFMove(impl)); + // return createWrapper(globalObject, WTF::move(impl)); // #endif // } default: { @@ -315,7 +315,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj } } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } } // namespace WebCore diff --git a/src/bun.js/bindings/webcore/EventInit.h b/src/bun.js/bindings/webcore/EventInit.h index 0e588593c5..1b7fd80941 100644 --- a/src/bun.js/bindings/webcore/EventInit.h +++ b/src/bun.js/bindings/webcore/EventInit.h @@ -33,7 +33,7 @@ struct EventInit { bool composed { false }; template void encode(Encoder&) const; - template static WARN_UNUSED_RETURN bool decode(Decoder&, EventInit&); + template WARN_UNUSED_RETURN static bool decode(Decoder&, EventInit&); }; template diff --git a/src/bun.js/bindings/webcore/EventListenerMap.cpp b/src/bun.js/bindings/webcore/EventListenerMap.cpp index be3493744f..468b4e00ba 100644 --- a/src/bun.js/bindings/webcore/EventListenerMap.cpp +++ b/src/bun.js/bindings/webcore/EventListenerMap.cpp @@ -110,7 +110,7 @@ void EventListenerMap::replace(const AtomString& eventType, EventListener& oldLi ASSERT(index != notFound); auto& registeredListener = listeners->at(index); registeredListener->markAsRemoved(); - registeredListener = RegisteredEventListener::create(WTFMove(newListener), options); + registeredListener = RegisteredEventListener::create(WTF::move(newListener), options); } bool EventListenerMap::add(const AtomString& eventType, Ref&& listener, const RegisteredEventListener::Options& options) @@ -120,11 +120,11 @@ bool EventListenerMap::add(const AtomString& eventType, Ref&& lis if (auto* listeners = find(eventType)) { if (findListener(*listeners, listener, options.capture) != notFound) return false; // Duplicate listener. - listeners->append(RegisteredEventListener::create(WTFMove(listener), options)); + listeners->append(RegisteredEventListener::create(WTF::move(listener), options)); return true; } - m_entries.append({ eventType, EventListenerVector { RegisteredEventListener::create(WTFMove(listener), options) } }); + m_entries.append({ eventType, EventListenerVector { RegisteredEventListener::create(WTF::move(listener), options) } }); return true; } diff --git a/src/bun.js/bindings/webcore/FetchHeaders.cpp b/src/bun.js/bindings/webcore/FetchHeaders.cpp index 970c0a18ea..f241e7e0e8 100644 --- a/src/bun.js/bindings/webcore/FetchHeaders.cpp +++ b/src/bun.js/bindings/webcore/FetchHeaders.cpp @@ -169,7 +169,7 @@ ExceptionOr> FetchHeaders::create(std::optional&& header return result.releaseException(); } - return adoptRef(*new FetchHeaders { Guard::None, WTFMove(headers) }); + return adoptRef(*new FetchHeaders { Guard::None, WTF::move(headers) }); } ExceptionOr FetchHeaders::fill(const Init& headerInit) @@ -184,7 +184,7 @@ ExceptionOr FetchHeaders::fill(const FetchHeaders& otherHeaders) headers.commonHeaders().appendVector(otherHeaders.m_headers.commonHeaders()); headers.uncommonHeaders().appendVector(otherHeaders.m_headers.uncommonHeaders()); headers.getSetCookieHeaders().appendVector(otherHeaders.m_headers.getSetCookieHeaders()); - setInternalHeaders(WTFMove(headers)); + setInternalHeaders(WTF::move(headers)); m_updateCounter++; return {}; } @@ -343,7 +343,7 @@ std::optional> FetchHeaders::Iterator::next() if (key.isNull()) { if (m_cookieIndex < setCookieHeaders.size()) { String value = setCookieHeaders[m_cookieIndex++]; - return KeyValuePair { WTF::httpHeaderNameStringImpl(HTTPHeaderName::SetCookie), WTFMove(value) }; + return KeyValuePair { WTF::httpHeaderNameStringImpl(HTTPHeaderName::SetCookie), WTF::move(value) }; } m_currentIndex++; continue; @@ -352,7 +352,7 @@ std::optional> FetchHeaders::Iterator::next() m_currentIndex++; auto value = m_headers->m_headers.get(key); if (!value.isNull()) - return KeyValuePair { WTFMove(key), WTFMove(value) }; + return KeyValuePair { WTF::move(key), WTF::move(value) }; } return std::nullopt; diff --git a/src/bun.js/bindings/webcore/FetchHeaders.h b/src/bun.js/bindings/webcore/FetchHeaders.h index c7b7d73eb9..1785f66984 100644 --- a/src/bun.js/bindings/webcore/FetchHeaders.h +++ b/src/bun.js/bindings/webcore/FetchHeaders.h @@ -55,7 +55,7 @@ public: using Init = std::variant>, Vector>>; static ExceptionOr> create(std::optional&&); - static Ref create(Guard guard = Guard::None, HTTPHeaderMap&& headers = {}) { return adoptRef(*new FetchHeaders { guard, WTFMove(headers) }); } + static Ref create(Guard guard = Guard::None, HTTPHeaderMap&& headers = {}) { return adoptRef(*new FetchHeaders { guard, WTF::move(headers) }); } static Ref create(const FetchHeaders& headers) { return adoptRef(*new FetchHeaders { headers }); } ExceptionOr append(const String& name, const String& value); @@ -112,7 +112,7 @@ public: return Iterator(*this, true); } - void setInternalHeaders(HTTPHeaderMap&& headers) { m_headers = WTFMove(headers); } + void setInternalHeaders(HTTPHeaderMap&& headers) { m_headers = WTF::move(headers); } const HTTPHeaderMap& internalHeaders() const { return m_headers; } void setGuard(Guard); @@ -130,7 +130,7 @@ private: inline FetchHeaders::FetchHeaders(Guard guard, HTTPHeaderMap&& headers) : m_guard(guard) - , m_headers(WTFMove(headers)) + , m_headers(WTF::move(headers)) { } diff --git a/src/bun.js/bindings/webcore/HTTPHeaderField.cpp b/src/bun.js/bindings/webcore/HTTPHeaderField.cpp index 649e756fc0..122c58a960 100644 --- a/src/bun.js/bindings/webcore/HTTPHeaderField.cpp +++ b/src/bun.js/bindings/webcore/HTTPHeaderField.cpp @@ -218,9 +218,9 @@ std::optional HTTPHeaderField::create(String&& unparsedName, St if (!RFC7230::isValidName(trimmedName) || !RFC7230::isValidValue(trimmedValue)) return std::nullopt; - auto name = trimmedName.length() == unparsedName.length() ? WTFMove(unparsedName) : trimmedName.toString(); - auto value = trimmedValue.length() == unparsedValue.length() ? WTFMove(unparsedValue) : trimmedValue.toString(); - return { { WTFMove(name), WTFMove(value) } }; + auto name = trimmedName.length() == unparsedName.length() ? WTF::move(unparsedName) : trimmedName.toString(); + auto value = trimmedValue.length() == unparsedValue.length() ? WTF::move(unparsedValue) : trimmedValue.toString(); + return { { WTF::move(name), WTF::move(value) } }; } } diff --git a/src/bun.js/bindings/webcore/HTTPHeaderField.h b/src/bun.js/bindings/webcore/HTTPHeaderField.h index 5acb00c8a2..1d8ef651de 100644 --- a/src/bun.js/bindings/webcore/HTTPHeaderField.h +++ b/src/bun.js/bindings/webcore/HTTPHeaderField.h @@ -41,8 +41,8 @@ public: private: HTTPHeaderField(String&& name, String&& value) - : m_name(WTFMove(name)) - , m_value(WTFMove(value)) + : m_name(WTF::move(name)) + , m_value(WTF::move(value)) { } String m_name; @@ -69,7 +69,7 @@ std::optional HTTPHeaderField::decode(Decoder& decoder) if (!value) return std::nullopt; - return { { WTFMove(*name), WTFMove(*value) } }; + return { { WTF::move(*name), WTF::move(*value) } }; } namespace RFC7230 { diff --git a/src/bun.js/bindings/webcore/HTTPHeaderMap.cpp b/src/bun.js/bindings/webcore/HTTPHeaderMap.cpp index 3f1ad6fd32..6ef789490b 100644 --- a/src/bun.js/bindings/webcore/HTTPHeaderMap.cpp +++ b/src/bun.js/bindings/webcore/HTTPHeaderMap.cpp @@ -54,9 +54,9 @@ HTTPHeaderMap HTTPHeaderMap::isolatedCopy() const& HTTPHeaderMap HTTPHeaderMap::isolatedCopy() && { HTTPHeaderMap map; - map.m_commonHeaders = crossThreadCopy(WTFMove(m_commonHeaders)); - map.m_uncommonHeaders = crossThreadCopy(WTFMove(m_uncommonHeaders)); - map.m_setCookieHeaders = crossThreadCopy(WTFMove(m_setCookieHeaders)); + map.m_commonHeaders = crossThreadCopy(WTF::move(m_commonHeaders)); + map.m_uncommonHeaders = crossThreadCopy(WTF::move(m_uncommonHeaders)); + map.m_setCookieHeaders = crossThreadCopy(WTF::move(m_setCookieHeaders)); return map; } diff --git a/src/bun.js/bindings/webcore/HTTPHeaderMap.h b/src/bun.js/bindings/webcore/HTTPHeaderMap.h index 126170bf2e..86c67ff4e8 100644 --- a/src/bun.js/bindings/webcore/HTTPHeaderMap.h +++ b/src/bun.js/bindings/webcore/HTTPHeaderMap.h @@ -41,7 +41,7 @@ public: String value; CommonHeader isolatedCopy() const & { return { key, value.isolatedCopy() }; } - CommonHeader isolatedCopy() && { return { key, WTFMove(value).isolatedCopy() }; } + CommonHeader isolatedCopy() && { return { key, WTF::move(value).isolatedCopy() }; } template void encode(Encoder &) const; template static std::optional decode(Decoder &); @@ -60,7 +60,7 @@ public: String value; UncommonHeader isolatedCopy() const & { return { key.isolatedCopy(), value.isolatedCopy() }; } - UncommonHeader isolatedCopy() && { return { WTFMove(key).isolatedCopy(), WTFMove(value).isolatedCopy() }; } + UncommonHeader isolatedCopy() && { return { WTF::move(key).isolatedCopy(), WTF::move(value).isolatedCopy() }; } template void encode(Encoder &) const; template static std::optional decode(Decoder &); @@ -261,7 +261,7 @@ public: } template void encode(Encoder &) const; - template static WARN_UNUSED_RETURN bool decode(Decoder &, HTTPHeaderMap &); + template WARN_UNUSED_RETURN static bool decode(Decoder &, HTTPHeaderMap &); void setUncommonHeader(const String &name, const String &value); void setUncommonHeaderCloneName(const StringView name, const String &value); @@ -290,7 +290,7 @@ auto HTTPHeaderMap::CommonHeader::decode(Decoder &decoder) -> std::optional @@ -310,7 +310,7 @@ auto HTTPHeaderMap::UncommonHeader::decode(Decoder &decoder) -> std::optional diff --git a/src/bun.js/bindings/webcore/HTTPParsers.h b/src/bun.js/bindings/webcore/HTTPParsers.h index b12b1b284b..c966cb7896 100644 --- a/src/bun.js/bindings/webcore/HTTPParsers.h +++ b/src/bun.js/bindings/webcore/HTTPParsers.h @@ -146,7 +146,7 @@ inline bool isHTTPSpace(char16_t character) // if (!isValidHTTPToken(token)) // return false; -// set.add(WTFMove(token)); +// set.add(WTF::move(token)); // return true; // } diff --git a/src/bun.js/bindings/webcore/IdentifierEventListenerMap.cpp b/src/bun.js/bindings/webcore/IdentifierEventListenerMap.cpp index 89ce0bba39..0149bf9019 100644 --- a/src/bun.js/bindings/webcore/IdentifierEventListenerMap.cpp +++ b/src/bun.js/bindings/webcore/IdentifierEventListenerMap.cpp @@ -56,7 +56,7 @@ void IdentifierEventListenerMap::replace(const JSC::Identifier& eventType, Event ASSERT(index != notFound); auto& registeredListener = listeners->at(index); registeredListener->markAsRemoved(); - registeredListener = SimpleRegisteredEventListener::create(WTFMove(newListener), once); + registeredListener = SimpleRegisteredEventListener::create(WTF::move(newListener), once); } bool IdentifierEventListenerMap::add(const JSC::Identifier& eventType, Ref&& listener, bool once) @@ -66,11 +66,11 @@ bool IdentifierEventListenerMap::add(const JSC::Identifier& eventType, Refappend(SimpleRegisteredEventListener::create(WTFMove(listener), once)); + listeners->append(SimpleRegisteredEventListener::create(WTF::move(listener), once)); return true; } - m_entries.append({ eventType, SimpleEventListenerVector { SimpleRegisteredEventListener::create(WTFMove(listener), once) } }); + m_entries.append({ eventType, SimpleEventListenerVector { SimpleRegisteredEventListener::create(WTF::move(listener), once) } }); return true; } @@ -81,11 +81,11 @@ bool IdentifierEventListenerMap::prepend(const JSC::Identifier& eventType, Refinsert(0, SimpleRegisteredEventListener::create(WTFMove(listener), once)); + listeners->insert(0, SimpleRegisteredEventListener::create(WTF::move(listener), once)); return true; } - m_entries.append({ eventType, SimpleEventListenerVector { SimpleRegisteredEventListener::create(WTFMove(listener), once) } }); + m_entries.append({ eventType, SimpleEventListenerVector { SimpleRegisteredEventListener::create(WTF::move(listener), once) } }); return true; } diff --git a/src/bun.js/bindings/webcore/IdentifierEventListenerMap.h b/src/bun.js/bindings/webcore/IdentifierEventListenerMap.h index d78f7ec11c..cb28c1e869 100644 --- a/src/bun.js/bindings/webcore/IdentifierEventListenerMap.h +++ b/src/bun.js/bindings/webcore/IdentifierEventListenerMap.h @@ -14,7 +14,7 @@ class SimpleRegisteredEventListener : public RefCounted create(Ref&& listener, bool once) { - return adoptRef(*new SimpleRegisteredEventListener(WTFMove(listener), once)); + return adoptRef(*new SimpleRegisteredEventListener(WTF::move(listener), once)); } EventListener& callback() const { return m_callback; } @@ -27,7 +27,7 @@ private: SimpleRegisteredEventListener(Ref&& listener, bool once) : m_isOnce(once) , m_wasRemoved(false) - , m_callback(WTFMove(listener)) + , m_callback(WTF::move(listener)) { } diff --git a/src/bun.js/bindings/webcore/JSAbortController.cpp b/src/bun.js/bindings/webcore/JSAbortController.cpp index 14f2e4f378..b488219e97 100644 --- a/src/bun.js/bindings/webcore/JSAbortController.cpp +++ b/src/bun.js/bindings/webcore/JSAbortController.cpp @@ -109,7 +109,7 @@ template<> EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSAbortControllerDOMConstruct if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -155,7 +155,7 @@ void JSAbortControllerPrototype::finishCreation(VM& vm) const ClassInfo JSAbortController::s_info = { "AbortController"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSAbortController) }; JSAbortController::JSAbortController(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -217,7 +217,7 @@ static inline JSC::EncodedJSValue jsAbortControllerPrototypeFunction_abortBody(J EnsureStillAliveScope argument0 = callFrame->argument(0); auto reason = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.abort(*jsCast(lexicalGlobalObject), WTFMove(reason)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.abort(*jsCast(lexicalGlobalObject), WTF::move(reason)); }))); } JSC_DEFINE_HOST_FUNCTION(jsAbortControllerPrototypeFunction_abort, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -308,7 +308,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, AbortController& impl) diff --git a/src/bun.js/bindings/webcore/JSAbortController.h b/src/bun.js/bindings/webcore/JSAbortController.h index 483328aa88..8384075778 100644 --- a/src/bun.js/bindings/webcore/JSAbortController.h +++ b/src/bun.js/bindings/webcore/JSAbortController.h @@ -32,7 +32,7 @@ public: static JSAbortController* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { auto& vm = JSC::getVM(globalObject); - JSAbortController* ptr = new (NotNull, JSC::allocateCell(vm)) JSAbortController(structure, *globalObject, WTFMove(impl)); + JSAbortController* ptr = new (NotNull, JSC::allocateCell(vm)) JSAbortController(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(vm); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSAbortSignal.cpp b/src/bun.js/bindings/webcore/JSAbortSignal.cpp index 453f337675..0e7ef079df 100644 --- a/src/bun.js/bindings/webcore/JSAbortSignal.cpp +++ b/src/bun.js/bindings/webcore/JSAbortSignal.cpp @@ -166,7 +166,7 @@ void JSAbortSignalPrototype::finishCreation(VM& vm) const ClassInfo JSAbortSignal::s_info = { "AbortSignal"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSAbortSignal) }; JSAbortSignal::JSAbortSignal(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSEventTarget(structure, globalObject, WTFMove(impl)) + : JSEventTarget(structure, globalObject, WTF::move(impl)) { } @@ -273,7 +273,7 @@ static inline JSC::EncodedJSValue jsAbortSignalConstructorFunction_abortBody(JSC EnsureStillAliveScope argument0 = callFrame->argument(0); auto reason = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJSNewlyCreated>(*lexicalGlobalObject, *jsCast(lexicalGlobalObject), throwScope, AbortSignal::abort(*jsCast(lexicalGlobalObject), *context, WTFMove(reason))))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJSNewlyCreated>(*lexicalGlobalObject, *jsCast(lexicalGlobalObject), throwScope, AbortSignal::abort(*jsCast(lexicalGlobalObject), *context, WTF::move(reason))))); } JSC_DEFINE_HOST_FUNCTION(jsAbortSignalConstructorFunction_abort, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -295,7 +295,7 @@ static inline JSC::EncodedJSValue jsAbortSignalConstructorFunction_timeoutBody(J EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto milliseconds = convert>(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJSNewlyCreated>(*lexicalGlobalObject, *jsCast(lexicalGlobalObject), throwScope, AbortSignal::timeout(*context, WTFMove(milliseconds))))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJSNewlyCreated>(*lexicalGlobalObject, *jsCast(lexicalGlobalObject), throwScope, AbortSignal::timeout(*context, WTF::move(milliseconds))))); } JSC_DEFINE_HOST_FUNCTION(jsAbortSignalConstructorFunction_timeout, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -331,7 +331,7 @@ static inline JSC::EncodedJSValue jsAbortSignalConstructorFunction_anyBody(JSC:: i++; }); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJSNewlyCreated>(*lexicalGlobalObject, *jsCast(lexicalGlobalObject), throwScope, AbortSignal::any(*context, WTFMove(signals))))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJSNewlyCreated>(*lexicalGlobalObject, *jsCast(lexicalGlobalObject), throwScope, AbortSignal::any(*context, WTF::move(signals))))); } JSC_DEFINE_HOST_FUNCTION(jsAbortSignalConstructorFunction_any, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -441,7 +441,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, AbortSignal& impl) diff --git a/src/bun.js/bindings/webcore/JSAbortSignal.h b/src/bun.js/bindings/webcore/JSAbortSignal.h index 4de1f1b746..90911cfc28 100644 --- a/src/bun.js/bindings/webcore/JSAbortSignal.h +++ b/src/bun.js/bindings/webcore/JSAbortSignal.h @@ -34,7 +34,7 @@ public: static JSAbortSignal* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { auto& vm = JSC::getVM(globalObject); - JSAbortSignal* ptr = new (NotNull, JSC::allocateCell(vm)) JSAbortSignal(structure, *globalObject, WTFMove(impl)); + JSAbortSignal* ptr = new (NotNull, JSC::allocateCell(vm)) JSAbortSignal(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(vm); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSBroadcastChannel.cpp b/src/bun.js/bindings/webcore/JSBroadcastChannel.cpp index ae86b895dc..a53e47a293 100644 --- a/src/bun.js/bindings/webcore/JSBroadcastChannel.cpp +++ b/src/bun.js/bindings/webcore/JSBroadcastChannel.cpp @@ -118,11 +118,11 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSBroadcastChannelDOMCon EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto name = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - auto object = BroadcastChannel::create(*context, WTFMove(name)); + auto object = BroadcastChannel::create(*context, WTF::move(name)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -244,7 +244,7 @@ void JSBroadcastChannelPrototype::finishCreation(VM& vm, JSGlobalObject* globalO const ClassInfo JSBroadcastChannel::s_info = { "BroadcastChannel"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSBroadcastChannel) }; JSBroadcastChannel::JSBroadcastChannel(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSEventTarget(structure, globalObject, WTFMove(impl)) + : JSEventTarget(structure, globalObject, WTF::move(impl)) { } @@ -356,7 +356,7 @@ static inline JSC::EncodedJSValue jsBroadcastChannelPrototypeFunction_postMessag EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto message = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.postMessage(*jsCast(lexicalGlobalObject), WTFMove(message)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.postMessage(*jsCast(lexicalGlobalObject), WTF::move(message)); }))); } JSC_DEFINE_HOST_FUNCTION(jsBroadcastChannelPrototypeFunction_postMessage, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -483,7 +483,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, BroadcastChannel& impl) diff --git a/src/bun.js/bindings/webcore/JSBroadcastChannel.h b/src/bun.js/bindings/webcore/JSBroadcastChannel.h index ddf672284d..e59c70d9f4 100644 --- a/src/bun.js/bindings/webcore/JSBroadcastChannel.h +++ b/src/bun.js/bindings/webcore/JSBroadcastChannel.h @@ -33,7 +33,7 @@ public: using DOMWrapped = BroadcastChannel; static JSBroadcastChannel* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSBroadcastChannel* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSBroadcastChannel(structure, *globalObject, WTFMove(impl)); + JSBroadcastChannel* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSBroadcastChannel(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSCloseEvent.cpp b/src/bun.js/bindings/webcore/JSCloseEvent.cpp index 0abd88897b..9c986ad14e 100644 --- a/src/bun.js/bindings/webcore/JSCloseEvent.cpp +++ b/src/bun.js/bindings/webcore/JSCloseEvent.cpp @@ -189,11 +189,11 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSCloseEventDOMConstruct EnsureStillAliveScope argument1 = callFrame->argument(1); auto eventInitDict = convert>(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - auto object = CloseEvent::create(WTFMove(type), WTFMove(eventInitDict)); + auto object = CloseEvent::create(WTF::move(type), WTF::move(eventInitDict)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -239,7 +239,7 @@ void JSCloseEventPrototype::finishCreation(VM& vm) const ClassInfo JSCloseEvent::s_info = { "CloseEvent"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCloseEvent) }; JSCloseEvent::JSCloseEvent(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSEvent(structure, globalObject, WTFMove(impl)) + : JSEvent(structure, globalObject, WTF::move(impl)) { } @@ -366,7 +366,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, CloseEvent& impl) diff --git a/src/bun.js/bindings/webcore/JSCloseEvent.h b/src/bun.js/bindings/webcore/JSCloseEvent.h index 13dc230087..7e53476926 100644 --- a/src/bun.js/bindings/webcore/JSCloseEvent.h +++ b/src/bun.js/bindings/webcore/JSCloseEvent.h @@ -33,7 +33,7 @@ public: using DOMWrapped = CloseEvent; static JSCloseEvent* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSCloseEvent* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSCloseEvent(structure, *globalObject, WTFMove(impl)); + JSCloseEvent* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSCloseEvent(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSCookie.cpp b/src/bun.js/bindings/webcore/JSCookie.cpp index a53ff6336f..b16f33a902 100644 --- a/src/bun.js/bindings/webcore/JSCookie.cpp +++ b/src/bun.js/bindings/webcore/JSCookie.cpp @@ -326,7 +326,7 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSCookieDOMConstructor:: auto cookie = cookie_exception.releaseReturnValue(); auto* globalObject = castedThis->globalObject(); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(lexicalGlobalObject, globalObject, WTFMove(cookie)))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(lexicalGlobalObject, globalObject, WTF::move(cookie)))); } else if (callFrame->argumentCount() == 1 && callFrame->argument(0).isObject()) { // new Bun.Cooke({ // name: "name", @@ -347,7 +347,7 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSCookieDOMConstructor:: } auto cookie = cookie_exception.releaseReturnValue(); auto* globalObject = castedThis->globalObject(); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(lexicalGlobalObject, globalObject, WTFMove(cookie)))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(lexicalGlobalObject, globalObject, WTF::move(cookie)))); } else if (callFrame->argumentCount() >= 2) { // new Bun.Cookie("name", "value", { // domain: "domain", @@ -383,7 +383,7 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSCookieDOMConstructor:: auto cookie = cookie_exception.releaseReturnValue(); auto* globalObject = castedThis->globalObject(); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(lexicalGlobalObject, globalObject, WTFMove(cookie)))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(lexicalGlobalObject, globalObject, WTF::move(cookie)))); } return throwVMError(lexicalGlobalObject, throwScope, createNotEnoughArgumentsError(lexicalGlobalObject)); @@ -445,7 +445,7 @@ void JSCookiePrototype::finishCreation(VM& vm) const ClassInfo JSCookie::s_info = { "Cookie"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCookie) }; JSCookie::JSCookie(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -547,7 +547,7 @@ JSC_DEFINE_HOST_FUNCTION(jsCookieStaticFunctionParse, (JSGlobalObject * lexicalG RELEASE_AND_RETURN(throwScope, {}); } auto cookie = cookie_exception.releaseReturnValue(); - return JSValue::encode(toJSNewlyCreated(lexicalGlobalObject, defaultGlobalObject(lexicalGlobalObject), WTFMove(cookie))); + return JSValue::encode(toJSNewlyCreated(lexicalGlobalObject, defaultGlobalObject(lexicalGlobalObject), WTF::move(cookie))); } if (!WebCore::isValidHTTPHeaderValue(cookieString)) [[unlikely]] { @@ -563,7 +563,7 @@ JSC_DEFINE_HOST_FUNCTION(jsCookieStaticFunctionParse, (JSGlobalObject * lexicalG auto cookie = cookie_exception.releaseReturnValue(); auto* globalObject = defaultGlobalObject(lexicalGlobalObject); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJSNewlyCreated(lexicalGlobalObject, globalObject, WTFMove(cookie)))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJSNewlyCreated(lexicalGlobalObject, globalObject, WTF::move(cookie)))); } JSC_DEFINE_HOST_FUNCTION(jsCookieStaticFunctionFrom, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -602,7 +602,7 @@ JSC_DEFINE_HOST_FUNCTION(jsCookieStaticFunctionFrom, (JSGlobalObject * lexicalGl } auto cookie = cookie_exception.releaseReturnValue(); auto* globalObject = jsCast(lexicalGlobalObject); - return JSValue::encode(toJSNewlyCreated(lexicalGlobalObject, globalObject, WTFMove(cookie))); + return JSValue::encode(toJSNewlyCreated(lexicalGlobalObject, globalObject, WTF::move(cookie))); } JSC_DEFINE_HOST_FUNCTION(jsCookieStaticFunctionSerialize, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -968,7 +968,7 @@ void JSCookieOwner::finalize(JSC::Handle handle, void* context) JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref&& impl) { - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, Cookie& impl) diff --git a/src/bun.js/bindings/webcore/JSCookie.h b/src/bun.js/bindings/webcore/JSCookie.h index f2f893bf25..1a9268fb12 100644 --- a/src/bun.js/bindings/webcore/JSCookie.h +++ b/src/bun.js/bindings/webcore/JSCookie.h @@ -11,7 +11,7 @@ public: using Base = JSDOMWrapper; static JSCookie* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSCookie* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSCookie(structure, *globalObject, WTFMove(impl)); + JSCookie* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSCookie(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSCookieMap.cpp b/src/bun.js/bindings/webcore/JSCookieMap.cpp index b97bc8aba4..0fe8dd3ce1 100644 --- a/src/bun.js/bindings/webcore/JSCookieMap.cpp +++ b/src/bun.js/bindings/webcore/JSCookieMap.cpp @@ -146,9 +146,9 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSCookieMapDOMConstructo Vector pair; pair.append(firstStr); pair.append(secondStr); - seqSeq.append(WTFMove(pair)); + seqSeq.append(WTF::move(pair)); } - init = WTFMove(seqSeq); + init = WTF::move(seqSeq); } else { // Handle as record HashMap record; @@ -166,21 +166,21 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSCookieMapDOMConstructo record.set(propertyName.string(), valueStr); } - init = WTFMove(record); + init = WTF::move(record); } } else { throwTypeError(lexicalGlobalObject, throwScope, "Invalid initializer type"_s); return {}; } - auto result_exception = CookieMap::create(WTFMove(init)); + auto result_exception = CookieMap::create(WTF::move(init)); if (result_exception.hasException()) { WebCore::propagateException(lexicalGlobalObject, throwScope, result_exception.releaseException()); RELEASE_AND_RETURN(throwScope, {}); } auto result = result_exception.releaseReturnValue(); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJSNewlyCreated(lexicalGlobalObject, castedThis->globalObject(), WTFMove(result)))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJSNewlyCreated(lexicalGlobalObject, castedThis->globalObject(), WTF::move(result)))); } JSC_ANNOTATE_HOST_FUNCTION(JSCookieMapDOMConstructorConstruct, JSCookieMapDOMConstructor::construct); @@ -229,7 +229,7 @@ void JSCookieMapPrototype::finishCreation(VM& vm) const ClassInfo JSCookieMap::s_info = { "CookieMap"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCookieMap) }; JSCookieMap::JSCookieMap(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -411,7 +411,7 @@ static inline JSC::EncodedJSValue jsCookieMapPrototypeFunction_setBody(JSC::JSGl } auto cookie = cookie_exception.releaseReturnValue(); - impl.set(WTFMove(cookie)); + impl.set(WTF::move(cookie)); return JSValue::encode(jsUndefined()); } @@ -655,7 +655,7 @@ void JSCookieMapOwner::finalize(JSC::Handle handle, void* context) JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref&& impl) { - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, CookieMap& impl) diff --git a/src/bun.js/bindings/webcore/JSCookieMap.h b/src/bun.js/bindings/webcore/JSCookieMap.h index 9b16ffcc19..24158374df 100644 --- a/src/bun.js/bindings/webcore/JSCookieMap.h +++ b/src/bun.js/bindings/webcore/JSCookieMap.h @@ -11,7 +11,7 @@ public: using Base = JSDOMWrapper; static JSCookieMap* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSCookieMap* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSCookieMap(structure, *globalObject, WTFMove(impl)); + JSCookieMap* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSCookieMap(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSCustomEvent.cpp b/src/bun.js/bindings/webcore/JSCustomEvent.cpp index c764817533..bff23a2b3a 100644 --- a/src/bun.js/bindings/webcore/JSCustomEvent.cpp +++ b/src/bun.js/bindings/webcore/JSCustomEvent.cpp @@ -172,11 +172,11 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSCustomEventDOMConstruc EnsureStillAliveScope argument1 = callFrame->argument(1); auto eventInitDict = convert>(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - auto object = CustomEvent::create(type, WTFMove(eventInitDict)); + auto object = CustomEvent::create(type, WTF::move(eventInitDict)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -221,7 +221,7 @@ void JSCustomEventPrototype::finishCreation(VM& vm) const ClassInfo JSCustomEvent::s_info = { "CustomEvent"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCustomEvent) }; JSCustomEvent::JSCustomEvent(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSEvent(structure, globalObject, WTFMove(impl)) + : JSEvent(structure, globalObject, WTF::move(impl)) { } @@ -290,7 +290,7 @@ static inline JSC::EncodedJSValue jsCustomEventPrototypeFunction_initCustomEvent EnsureStillAliveScope argument3 = callFrame->argument(3); auto detail = argument3.value().isUndefined() ? jsNull() : convert(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.initCustomEvent(type, WTFMove(bubbles), WTFMove(cancelable), WTFMove(detail)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.initCustomEvent(type, WTF::move(bubbles), WTF::move(cancelable), WTF::move(detail)); }))); } JSC_DEFINE_HOST_FUNCTION(jsCustomEventPrototypeFunction_initCustomEvent, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -371,7 +371,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); // #endif // } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, CustomEvent& impl) diff --git a/src/bun.js/bindings/webcore/JSCustomEvent.h b/src/bun.js/bindings/webcore/JSCustomEvent.h index d32bf98e45..f9dd2ddb86 100644 --- a/src/bun.js/bindings/webcore/JSCustomEvent.h +++ b/src/bun.js/bindings/webcore/JSCustomEvent.h @@ -33,7 +33,7 @@ public: using DOMWrapped = CustomEvent; static JSCustomEvent* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSCustomEvent* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSCustomEvent(structure, *globalObject, WTFMove(impl)); + JSCustomEvent* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSCustomEvent(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSDOMConvertRecord.h b/src/bun.js/bindings/webcore/JSDOMConvertRecord.h index 9e2d08b70e..1b5fde3902 100644 --- a/src/bun.js/bindings/webcore/JSDOMConvertRecord.h +++ b/src/bun.js/bindings/webcore/JSDOMConvertRecord.h @@ -146,7 +146,7 @@ private: auto addResult = resultMap.add(typedKey, result.size()); if (!addResult.isNewEntry) { ASSERT(result[addResult.iterator->value].key == typedKey); - result[addResult.iterator->value].value = WTFMove(typedValue); + result[addResult.iterator->value].value = WTF::move(typedValue); return true; } } @@ -154,7 +154,7 @@ private: UNUSED_VARIABLE(resultMap); // 5. Otherwise, append to result a mapping (typedKey, typedValue). - result.append({ WTFMove(typedKey), WTFMove(typedValue) }); + result.append({ WTF::move(typedKey), WTF::move(typedValue) }); return true; }); @@ -203,7 +203,7 @@ private: auto addResult = resultMap.add(typedKey, result.size()); if (!addResult.isNewEntry) { ASSERT(result[addResult.iterator->value].key == typedKey); - result[addResult.iterator->value].value = WTFMove(typedValue); + result[addResult.iterator->value].value = WTF::move(typedValue); continue; } } @@ -211,7 +211,7 @@ private: UNUSED_VARIABLE(resultMap); // 5. Otherwise, append to result a mapping (typedKey, typedValue). - result.append({ WTFMove(typedKey), WTFMove(typedValue) }); + result.append({ WTF::move(typedKey), WTF::move(typedValue) }); } } diff --git a/src/bun.js/bindings/webcore/JSDOMConvertScheduledAction.h b/src/bun.js/bindings/webcore/JSDOMConvertScheduledAction.h index 61ac02caff..1e38aec6f0 100644 --- a/src/bun.js/bindings/webcore/JSDOMConvertScheduledAction.h +++ b/src/bun.js/bindings/webcore/JSDOMConvertScheduledAction.h @@ -41,7 +41,7 @@ template<> struct Converter : DefaultConverter::convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(scope, nullptr); - return ScheduledAction::create(globalObject.world(), WTFMove(code)); + return ScheduledAction::create(globalObject.world(), WTF::move(code)); } // The value must be an object at this point because no non-object values are callable. diff --git a/src/bun.js/bindings/webcore/JSDOMConvertSequences.h b/src/bun.js/bindings/webcore/JSDOMConvertSequences.h index 8b93310323..035e593ecd 100644 --- a/src/bun.js/bindings/webcore/JSDOMConvertSequences.h +++ b/src/bun.js/bindings/webcore/JSDOMConvertSequences.h @@ -173,7 +173,7 @@ struct GenericSequenceConverter { // auto convertedValue = Converter::convert(*lexicalGlobalObject, nextValue); auto convertedValue = Bun::convertIDL(*lexicalGlobalObject, nextValue, elementCtx); RETURN_IF_EXCEPTION(scope, ); - Traits::append(*lexicalGlobalObject, result, index++, WTFMove(convertedValue)); + Traits::append(*lexicalGlobalObject, result, index++, WTF::move(convertedValue)); RETURN_IF_EXCEPTION(scope, ); }); @@ -182,13 +182,13 @@ struct GenericSequenceConverter { if (index != result.size()) { throwTypeError(&lexicalGlobalObject, scope); } - return WTFMove(result); + return WTF::move(result); } static ReturnType convert(JSC::JSGlobalObject& lexicalGlobalObject, JSC::JSObject* object, ReturnType&& result) { auto ctx = Bun::DefaultConversionContext {}; - return convert(lexicalGlobalObject, object, WTFMove(result), ctx); + return convert(lexicalGlobalObject, object, WTF::move(result), ctx); } template @@ -205,7 +205,7 @@ struct GenericSequenceConverter { auto convertedValue = Converter::convert(*lexicalGlobalObject, nextValue, std::forward(exceptionThrower)); RETURN_IF_EXCEPTION(scope, ); - Traits::append(*lexicalGlobalObject, result, index++, WTFMove(convertedValue)); + Traits::append(*lexicalGlobalObject, result, index++, WTF::move(convertedValue)); RETURN_IF_EXCEPTION(scope, ); }); @@ -214,7 +214,7 @@ struct GenericSequenceConverter { if (index != result.size()) { throwTypeError(&lexicalGlobalObject, scope); } - return WTFMove(result); + return WTF::move(result); } static ReturnType convert(JSC::JSGlobalObject& lexicalGlobalObject, JSC::JSObject* object, JSC::JSValue method) @@ -233,7 +233,7 @@ struct GenericSequenceConverter { auto convertedValue = Converter::convert(lexicalGlobalObject, nextValue); RETURN_IF_EXCEPTION(scope, ); - Traits::append(lexicalGlobalObject, result, index++, WTFMove(convertedValue)); + Traits::append(lexicalGlobalObject, result, index++, WTF::move(convertedValue)); RETURN_IF_EXCEPTION(scope, ); }); @@ -242,7 +242,7 @@ struct GenericSequenceConverter { if (index != result.size()) { throwTypeError(&lexicalGlobalObject, scope); } - return WTFMove(result); + return WTF::move(result); } }; @@ -268,7 +268,7 @@ struct NumericSequenceConverter { Traits::append(lexicalGlobalObject, result, i, indexValue.asInt32()); RETURN_IF_EXCEPTION(scope, {}); } - return WTFMove(result); + return WTF::move(result); } ASSERT(indexingType == JSC::DoubleShape); @@ -285,7 +285,7 @@ struct NumericSequenceConverter { RETURN_IF_EXCEPTION(scope, {}); } } - return WTFMove(result); + return WTF::move(result); } static ReturnType convert(JSC::JSGlobalObject& lexicalGlobalObject, JSC::JSValue value) @@ -325,9 +325,9 @@ struct NumericSequenceConverter { RETURN_IF_EXCEPTION(scope, {}); if (!isLengthExact) - RELEASE_AND_RETURN(scope, GenericConverter::convert(lexicalGlobalObject, object, WTFMove(result))); + RELEASE_AND_RETURN(scope, GenericConverter::convert(lexicalGlobalObject, object, WTF::move(result))); - return convertArray(lexicalGlobalObject, scope, array, length, indexingType, WTFMove(result)); + return convertArray(lexicalGlobalObject, scope, array, length, indexingType, WTF::move(result)); } static ReturnType convert(JSC::JSGlobalObject& lexicalGlobalObject, JSC::JSObject* object, JSC::JSValue method) @@ -360,9 +360,9 @@ struct NumericSequenceConverter { RETURN_IF_EXCEPTION(scope, {}); if (!isLengthExact) - RELEASE_AND_RETURN(scope, GenericConverter::convert(lexicalGlobalObject, object, method, WTFMove(result))); + RELEASE_AND_RETURN(scope, GenericConverter::convert(lexicalGlobalObject, object, method, WTF::move(result))); - return convertArray(lexicalGlobalObject, scope, array, length, indexingType, WTFMove(result)); + return convertArray(lexicalGlobalObject, scope, array, length, indexingType, WTF::move(result)); } }; @@ -395,7 +395,7 @@ struct SequenceConverter { // auto convertedValue = Converter::convert(lexicalGlobalObject, indexValue); auto convertedValue = Bun::convertIDL(lexicalGlobalObject, indexValue, elementCtx); RETURN_IF_EXCEPTION(scope, {}); - Traits::append(lexicalGlobalObject, result, i, WTFMove(convertedValue)); + Traits::append(lexicalGlobalObject, result, i, WTF::move(convertedValue)); } return result; } @@ -410,7 +410,7 @@ struct SequenceConverter { // auto convertedValue = Converter::convert(lexicalGlobalObject, indexValue); auto convertedValue = Bun::convertIDL(lexicalGlobalObject, indexValue, elementCtx); RETURN_IF_EXCEPTION(scope, {}); - Traits::append(lexicalGlobalObject, result, i, WTFMove(convertedValue)); + Traits::append(lexicalGlobalObject, result, i, WTF::move(convertedValue)); } return result; } @@ -443,7 +443,7 @@ struct SequenceConverter { auto convertedValue = Converter::convert(lexicalGlobalObject, indexValue, std::forward(exceptionThrower)); RETURN_IF_EXCEPTION(scope, {}); - Traits::append(lexicalGlobalObject, result, i, WTFMove(convertedValue)); + Traits::append(lexicalGlobalObject, result, i, WTF::move(convertedValue)); RETURN_IF_EXCEPTION(scope, {}); } return result; @@ -458,7 +458,7 @@ struct SequenceConverter { auto convertedValue = Converter::convert(lexicalGlobalObject, indexValue, std::forward(exceptionThrower)); RETURN_IF_EXCEPTION(scope, {}); - Traits::append(lexicalGlobalObject, result, i, WTFMove(convertedValue)); + Traits::append(lexicalGlobalObject, result, i, WTF::move(convertedValue)); RETURN_IF_EXCEPTION(scope, {}); } return result; diff --git a/src/bun.js/bindings/webcore/JSDOMConvertStrings.cpp b/src/bun.js/bindings/webcore/JSDOMConvertStrings.cpp index c2d77e7e0c..16c52e6bdd 100644 --- a/src/bun.js/bindings/webcore/JSDOMConvertStrings.cpp +++ b/src/bun.js/bindings/webcore/JSDOMConvertStrings.cpp @@ -103,7 +103,7 @@ String valueToUSVString(JSGlobalObject& lexicalGlobalObject, JSValue value) auto string = value.toWTFString(&lexicalGlobalObject); RETURN_IF_EXCEPTION(scope, {}); - return replaceUnpairedSurrogatesWithReplacementCharacter(WTFMove(string)); + return replaceUnpairedSurrogatesWithReplacementCharacter(WTF::move(string)); } AtomString valueToUSVAtomString(JSGlobalObject& lexicalGlobalObject, JSValue value) diff --git a/src/bun.js/bindings/webcore/JSDOMConvertUnion.h b/src/bun.js/bindings/webcore/JSDOMConvertUnion.h index 837a9be292..0b51201525 100644 --- a/src/bun.js/bindings/webcore/JSDOMConvertUnion.h +++ b/src/bun.js/bindings/webcore/JSDOMConvertUnion.h @@ -208,7 +208,7 @@ template struct Converter> : DefaultConverter struct Converter> : DefaultConverter>::value) ? JSC::JSArrayBuffer::toWrappedAllowShared(vm, value) : JSC::JSArrayBuffer::toWrapped(vm, value); if (arrayBuffer) { if (hasArrayBufferType) - return ConditionalReturner::get(WTFMove(arrayBuffer)).value(); + return ConditionalReturner::get(WTF::move(arrayBuffer)).value(); RELEASE_AND_RETURN(scope, (ConditionalConverter::convert(lexicalGlobalObject, value).value())); } } @@ -239,7 +239,7 @@ template struct Converter> : DefaultConverter>::value) ? JSC::JSArrayBufferView::toWrappedAllowShared(vm, value) : JSC::JSArrayBufferView::toWrapped(vm, value); if (arrayBufferView) { if (hasArrayBufferViewType) - return ConditionalReturner::get(WTFMove(arrayBufferView)).value(); + return ConditionalReturner::get(WTF::move(arrayBufferView)).value(); RELEASE_AND_RETURN(scope, (ConditionalConverter::convert(lexicalGlobalObject, value).value())); } } @@ -252,7 +252,7 @@ template struct Converter> : DefaultConverter::get(WTFMove(dataView)).value(); + return ConditionalReturner::get(WTF::move(dataView)).value(); RELEASE_AND_RETURN(scope, (ConditionalConverter::convert(lexicalGlobalObject, value).value())); } } @@ -280,7 +280,7 @@ template struct Converter> : DefaultConverter FixedVector::Item ASSERT_UNUSED(scope, !!scope.exception() == !value); if (!value) return {}; - result[resultIndex] = WTFMove(*value); + result[resultIndex] = WTF::move(*value); resultIndex++; } diff --git a/src/bun.js/bindings/webcore/JSDOMException.cpp b/src/bun.js/bindings/webcore/JSDOMException.cpp index e33f56fbfb..4812c93340 100644 --- a/src/bun.js/bindings/webcore/JSDOMException.cpp +++ b/src/bun.js/bindings/webcore/JSDOMException.cpp @@ -153,11 +153,11 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSDOMExceptionDOMConstru RETURN_IF_EXCEPTION(throwScope, {}); } - auto object = DOMException::create(WTFMove(message), WTFMove(name)); + auto object = DOMException::create(WTF::move(message), WTF::move(name)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -233,7 +233,7 @@ void JSDOMExceptionPrototype::finishCreation(VM& vm) const ClassInfo JSDOMException::s_info = { "DOMException"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSDOMException) }; JSDOMException::JSDOMException(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -381,7 +381,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); // #endif // } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, DOMException& impl) diff --git a/src/bun.js/bindings/webcore/JSDOMException.h b/src/bun.js/bindings/webcore/JSDOMException.h index 71e72003e1..41829d9504 100644 --- a/src/bun.js/bindings/webcore/JSDOMException.h +++ b/src/bun.js/bindings/webcore/JSDOMException.h @@ -34,7 +34,7 @@ public: using Base = JSDOMWrapper; static JSDOMException* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSDOMException* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSDOMException(structure, *globalObject, WTFMove(impl)); + JSDOMException* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSDOMException(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSDOMFormData.cpp b/src/bun.js/bindings/webcore/JSDOMFormData.cpp index c6b9683540..77a0d1cedf 100644 --- a/src/bun.js/bindings/webcore/JSDOMFormData.cpp +++ b/src/bun.js/bindings/webcore/JSDOMFormData.cpp @@ -167,7 +167,7 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSDOMFormDataDOMConstruc if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -227,7 +227,7 @@ void JSDOMFormDataPrototype::finishCreation(VM& vm) const ClassInfo JSDOMFormData::s_info = { "FormData"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSDOMFormData) }; JSDOMFormData::JSDOMFormData(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -285,7 +285,7 @@ static inline JSC::EncodedJSValue jsDOMFormDataPrototypeFunction_append1Body(JSC EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto value = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.append(WTFMove(name), WTFMove(value)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.append(WTF::move(name), WTF::move(value)); }))); } extern "C" BunString Blob__getFileNameString(void* impl); @@ -316,7 +316,7 @@ static inline JSC::EncodedJSValue jsDOMFormDataPrototypeFunction_append2Body(JSC auto filename = argument2.value().isUndefined() ? Blob__getFileNameString(blobValue->impl()).toWTFString(BunString::ZeroCopy) : convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.append(WTFMove(name), WTFMove(blobValue), WTFMove(filename)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.append(WTF::move(name), WTF::move(blobValue), WTF::move(filename)); }))); } static inline JSC::EncodedJSValue jsDOMFormDataPrototypeFunction_appendOverloadDispatcher(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) @@ -355,7 +355,7 @@ static inline JSC::EncodedJSValue jsDOMFormDataPrototypeFunction_deleteBody(JSC: EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto name = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.remove(WTFMove(name)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.remove(WTF::move(name)); }))); } JSC_DEFINE_HOST_FUNCTION(jsDOMFormDataPrototypeFunction_delete, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -433,7 +433,7 @@ static inline JSC::EncodedJSValue jsDOMFormDataPrototypeFunction_hasBody(JSC::JS EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto name = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, impl.has(WTFMove(name))))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, impl.has(WTF::move(name))))); } JSC_DEFINE_HOST_FUNCTION(jsDOMFormDataPrototypeFunction_has, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -454,7 +454,7 @@ static inline JSC::EncodedJSValue jsDOMFormDataPrototypeFunction_set1Body(JSC::J EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto value = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.set(WTFMove(name), WTFMove(value)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.set(WTF::move(name), WTF::move(value)); }))); } static inline JSC::EncodedJSValue jsDOMFormDataPrototypeFunction_set2Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) @@ -483,7 +483,7 @@ static inline JSC::EncodedJSValue jsDOMFormDataPrototypeFunction_set2Body(JSC::J auto filename = argument2.value().isUndefined() ? Blob__getFileNameString(blobValue->impl()).toWTFString(BunString::ZeroCopy) : convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.set(WTFMove(name), WTFMove(blobValue), WTFMove(filename)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.set(WTF::move(name), WTF::move(blobValue), WTF::move(filename)); }))); } static inline JSC::EncodedJSValue jsDOMFormDataPrototypeFunction_setOverloadDispatcher(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) @@ -759,7 +759,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, DOMFormData& impl) diff --git a/src/bun.js/bindings/webcore/JSDOMFormData.h b/src/bun.js/bindings/webcore/JSDOMFormData.h index 286e820b1e..d40e88f4c1 100644 --- a/src/bun.js/bindings/webcore/JSDOMFormData.h +++ b/src/bun.js/bindings/webcore/JSDOMFormData.h @@ -31,7 +31,7 @@ public: using Base = JSDOMWrapper; static JSDOMFormData* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSDOMFormData* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSDOMFormData(structure, *globalObject, WTFMove(impl)); + JSDOMFormData* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSDOMFormData(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSDOMOperationReturningPromise.h b/src/bun.js/bindings/webcore/JSDOMOperationReturningPromise.h index 99aa7437e8..08abdc9958 100644 --- a/src/bun.js/bindings/webcore/JSDOMOperationReturningPromise.h +++ b/src/bun.js/bindings/webcore/JSDOMOperationReturningPromise.h @@ -49,7 +49,7 @@ public: ASSERT_GC_OBJECT_INHERITS(thisObject, JSClass::info()); // FIXME: We should refactor the binding generated code to use references for lexicalGlobalObject and thisObject. - return operation(&lexicalGlobalObject, &callFrame, thisObject, WTFMove(promise)); + return operation(&lexicalGlobalObject, &callFrame, thisObject, WTF::move(promise)); })); } @@ -77,7 +77,7 @@ public: { return JSC::JSValue::encode(callPromiseFunction(lexicalGlobalObject, callFrame, [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::CallFrame& callFrame, Ref&& promise) { // FIXME: We should refactor the binding generated code to use references for lexicalGlobalObject. - return operation(&lexicalGlobalObject, &callFrame, WTFMove(promise)); + return operation(&lexicalGlobalObject, &callFrame, WTF::move(promise)); })); } diff --git a/src/bun.js/bindings/webcore/JSDOMPromise.cpp b/src/bun.js/bindings/webcore/JSDOMPromise.cpp index a8ec36dea6..56dd702a27 100644 --- a/src/bun.js/bindings/webcore/JSDOMPromise.cpp +++ b/src/bun.js/bindings/webcore/JSDOMPromise.cpp @@ -40,7 +40,7 @@ namespace WebCore { auto DOMPromise::whenSettled(std::function&& callback) -> IsCallbackRegistered { - return whenPromiseIsSettled(globalObject(), promise(), WTFMove(callback)); + return whenPromiseIsSettled(globalObject(), promise(), WTF::move(callback)); } auto DOMPromise::whenPromiseIsSettled(JSDOMGlobalObject* globalObject, JSC::JSObject* promise, Function&& callback) -> IsCallbackRegistered @@ -48,7 +48,7 @@ auto DOMPromise::whenPromiseIsSettled(JSDOMGlobalObject* globalObject, JSC::JSOb auto& lexicalGlobalObject = *globalObject; auto& vm = lexicalGlobalObject.vm(); JSLockHolder lock(vm); - auto* handler = JSC::JSNativeStdFunction::create(vm, globalObject, 1, String {}, [callback = WTFMove(callback)](JSGlobalObject*, CallFrame*) mutable { + auto* handler = JSC::JSNativeStdFunction::create(vm, globalObject, 1, String {}, [callback = WTF::move(callback)](JSGlobalObject*, CallFrame*) mutable { callback(); return JSC::JSValue::encode(JSC::jsUndefined()); }); diff --git a/src/bun.js/bindings/webcore/JSDOMPromiseDeferred.cpp b/src/bun.js/bindings/webcore/JSDOMPromiseDeferred.cpp index e4799696e3..e26b6bb831 100644 --- a/src/bun.js/bindings/webcore/JSDOMPromiseDeferred.cpp +++ b/src/bun.js/bindings/webcore/JSDOMPromiseDeferred.cpp @@ -61,7 +61,7 @@ void DeferredPromise::callFunction(JSGlobalObject& lexicalGlobalObject, ResolveM // if (activeDOMObjectsAreSuspended()) { // JSC::Strong strongResolution(lexicalGlobalObject.vm(), resolution); // ASSERT(scriptExecutionContext()->eventLoop().isSuspended()); - // scriptExecutionContext()->eventLoop().queueTask(TaskSource::Networking, [this, protectedThis = Ref { *this }, mode, strongResolution = WTFMove(strongResolution)]() mutable { + // scriptExecutionContext()->eventLoop().queueTask(TaskSource::Networking, [this, protectedThis = Ref { *this }, mode, strongResolution = WTF::move(strongResolution)]() mutable { // if (shouldIgnoreRequestToFulfill()) // return; @@ -97,13 +97,13 @@ void DeferredPromise::whenSettled(Function&& callback) return; // if (activeDOMObjectsAreSuspended()) { - // scriptExecutionContext()->eventLoop().queueTask(TaskSource::Networking, [this, protectedThis = Ref { *this }, callback = WTFMove(callback)]() mutable { - // whenSettled(WTFMove(callback)); + // scriptExecutionContext()->eventLoop().queueTask(TaskSource::Networking, [this, protectedThis = Ref { *this }, callback = WTF::move(callback)]() mutable { + // whenSettled(WTF::move(callback)); // }); // return; // } - DOMPromise::whenPromiseIsSettled(globalObject(), deferred(), WTFMove(callback)); + DOMPromise::whenPromiseIsSettled(globalObject(), deferred(), WTF::move(callback)); } void DeferredPromise::reject(RejectAsHandled rejectAsHandled) @@ -165,7 +165,7 @@ void DeferredPromise::reject(Exception exception, RejectAsHandled rejectAsHandle return; } - auto error = createDOMException(lexicalGlobalObject, WTFMove(exception)); + auto error = createDOMException(lexicalGlobalObject, WTF::move(exception)); if (scope.exception()) [[unlikely]] { handleUncaughtException(scope, lexicalGlobalObject); return; @@ -273,7 +273,7 @@ void fulfillPromiseWithArrayBuffer(Ref&& promise, ArrayBuffer* void fulfillPromiseWithArrayBuffer(Ref&& promise, const void* data, size_t length) { - fulfillPromiseWithArrayBuffer(WTFMove(promise), ArrayBuffer::tryCreate({ reinterpret_cast(data), length }).get()); + fulfillPromiseWithArrayBuffer(WTF::move(promise), ArrayBuffer::tryCreate({ reinterpret_cast(data), length }).get()); } bool DeferredPromise::handleTerminationExceptionIfNeeded(CatchScope& scope, JSDOMGlobalObject& lexicalGlobalObject) diff --git a/src/bun.js/bindings/webcore/JSDOMPromiseDeferred.h b/src/bun.js/bindings/webcore/JSDOMPromiseDeferred.h index aa2070ee6f..67f58839be 100644 --- a/src/bun.js/bindings/webcore/JSDOMPromiseDeferred.h +++ b/src/bun.js/bindings/webcore/JSDOMPromiseDeferred.h @@ -237,12 +237,12 @@ class DOMPromiseDeferredBase { public: DOMPromiseDeferredBase(Ref&& genericPromise) - : m_promise(WTFMove(genericPromise)) + : m_promise(WTF::move(genericPromise)) { } DOMPromiseDeferredBase(DOMPromiseDeferredBase&& promise) - : m_promise(WTFMove(promise.m_promise)) + : m_promise(WTF::move(promise.m_promise)) { } @@ -259,7 +259,7 @@ public: DOMPromiseDeferredBase& operator=(DOMPromiseDeferredBase&& other) { - m_promise = WTFMove(other.m_promise); + m_promise = WTF::move(other.m_promise); return *this; } @@ -284,7 +284,7 @@ public: void whenSettled(Function&& function) { - m_promise->whenSettled(WTFMove(function)); + m_promise->whenSettled(WTF::move(function)); } protected: @@ -390,7 +390,7 @@ using BindingPromiseFunction = JSC::EncodedJSValue(JSC::JSGlobalObject*, JSC::Ca template inline void bindingPromiseFunctionAdapter(JSC::JSGlobalObject& lexicalGlobalObject, JSC::CallFrame& callFrame, Ref&& promise) { - bindingFunction(&lexicalGlobalObject, &callFrame, WTFMove(promise)); + bindingFunction(&lexicalGlobalObject, &callFrame, WTF::move(promise)); } template diff --git a/src/bun.js/bindings/webcore/JSDOMURL.cpp b/src/bun.js/bindings/webcore/JSDOMURL.cpp index ef5b82ab2d..98e786a942 100644 --- a/src/bun.js/bindings/webcore/JSDOMURL.cpp +++ b/src/bun.js/bindings/webcore/JSDOMURL.cpp @@ -162,11 +162,11 @@ template<> EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSDOMURLDOMConstructor::const EnsureStillAliveScope argument1 = callFrame->argument(1); auto base = argument1.value().isUndefined() ? String() : convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - auto object = base.isEmpty() ? DOMURL::create(WTFMove(url)) : DOMURL::create(WTFMove(url), WTFMove(base)); + auto object = base.isEmpty() ? DOMURL::create(WTF::move(url)) : DOMURL::create(WTF::move(url), WTF::move(base)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -239,7 +239,7 @@ void JSDOMURLPrototype::finishCreation(VM& vm) const ClassInfo JSDOMURL::s_info = { "URL"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSDOMURL) }; JSDOMURL::JSDOMURL(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -300,7 +300,7 @@ static inline bool setJSDOMURL_hrefSetter(JSGlobalObject& lexicalGlobalObject, J auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { - return impl.setHref(WTFMove(nativeValue)); + return impl.setHref(WTF::move(nativeValue)); }); return true; } @@ -345,7 +345,7 @@ static inline bool setJSDOMURL_protocolSetter(JSGlobalObject& lexicalGlobalObjec auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { - return impl.setProtocol(WTFMove(nativeValue)); + return impl.setProtocol(WTF::move(nativeValue)); }); return true; } @@ -377,7 +377,7 @@ static inline bool setJSDOMURL_usernameSetter(JSGlobalObject& lexicalGlobalObjec auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { - return impl.setUsername(WTFMove(nativeValue)); + return impl.setUsername(WTF::move(nativeValue)); }); return true; } @@ -409,7 +409,7 @@ static inline bool setJSDOMURL_passwordSetter(JSGlobalObject& lexicalGlobalObjec auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { - return impl.setPassword(WTFMove(nativeValue)); + return impl.setPassword(WTF::move(nativeValue)); }); return true; } @@ -441,7 +441,7 @@ static inline bool setJSDOMURL_hostSetter(JSGlobalObject& lexicalGlobalObject, J auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { - return impl.setHost(WTFMove(nativeValue)); + return impl.setHost(WTF::move(nativeValue)); }); return true; } @@ -473,7 +473,7 @@ static inline bool setJSDOMURL_hostnameSetter(JSGlobalObject& lexicalGlobalObjec auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { - return impl.setHostname(WTFMove(nativeValue)); + return impl.setHostname(WTF::move(nativeValue)); }); return true; } @@ -505,7 +505,7 @@ static inline bool setJSDOMURL_portSetter(JSGlobalObject& lexicalGlobalObject, J auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { - return impl.setPort(WTFMove(nativeValue)); + return impl.setPort(WTF::move(nativeValue)); }); return true; } @@ -537,7 +537,7 @@ static inline bool setJSDOMURL_pathnameSetter(JSGlobalObject& lexicalGlobalObjec auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { - return impl.setPathname(WTFMove(nativeValue)); + return impl.setPathname(WTF::move(nativeValue)); }); return true; } @@ -569,7 +569,7 @@ static inline bool setJSDOMURL_hashSetter(JSGlobalObject& lexicalGlobalObject, J auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { - return impl.setHash(WTFMove(nativeValue)); + return impl.setHash(WTF::move(nativeValue)); }); return true; } @@ -601,7 +601,7 @@ static inline bool setJSDOMURL_searchSetter(JSGlobalObject& lexicalGlobalObject, auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { - return impl.setSearch(WTFMove(nativeValue)); + return impl.setSearch(WTF::move(nativeValue)); }); return true; } @@ -643,7 +643,7 @@ static inline JSC::EncodedJSValue jsDOMURLConstructorFunction_parseBody(JSC::JSG EnsureStillAliveScope argument1 = callFrame->argument(1); auto base = argument1.value().isUndefined() ? String() : convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>>(*lexicalGlobalObject, *jsCast(lexicalGlobalObject), throwScope, DOMURL::parse(WTFMove(url), WTFMove(base))))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>>(*lexicalGlobalObject, *jsCast(lexicalGlobalObject), throwScope, DOMURL::parse(WTF::move(url), WTF::move(base))))); } JSC_DEFINE_HOST_FUNCTION(jsDOMURLConstructorFunction_parse, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -665,7 +665,7 @@ static inline JSC::EncodedJSValue jsDOMURLConstructorFunction_canParseBody(JSC:: EnsureStillAliveScope argument1 = callFrame->argument(1); auto base = argument1.value().isUndefined() ? String() : convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, DOMURL::canParse(WTFMove(url), WTFMove(base))))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, DOMURL::canParse(WTF::move(url), WTF::move(base))))); } JSC_DEFINE_HOST_FUNCTION(jsDOMURLConstructorFunction_canParse, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -717,7 +717,7 @@ static inline JSC::EncodedJSValue jsDOMURLConstructorFunction_revokeObjectURLBod // EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); // auto url = convert(*lexicalGlobalObject, argument0.value()); // RETURN_IF_EXCEPTION(throwScope, {}); - // RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return DOMURL::revokeObjectURL(*context, WTFMove(url)); }))); + // RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return DOMURL::revokeObjectURL(*context, WTF::move(url)); }))); } JSC_DEFINE_HOST_FUNCTION(jsDOMURLConstructorFunction_revokeObjectURL, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -854,7 +854,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, DOMURL& impl) diff --git a/src/bun.js/bindings/webcore/JSDOMURL.h b/src/bun.js/bindings/webcore/JSDOMURL.h index 54e38cdc4b..22e9743174 100644 --- a/src/bun.js/bindings/webcore/JSDOMURL.h +++ b/src/bun.js/bindings/webcore/JSDOMURL.h @@ -31,7 +31,7 @@ public: using Base = JSDOMWrapper; static JSDOMURL* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSDOMURL* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSDOMURL(structure, *globalObject, WTFMove(impl)); + JSDOMURL* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSDOMURL(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSErrorEvent.cpp b/src/bun.js/bindings/webcore/JSErrorEvent.cpp index ae464e73fa..61299b8460 100644 --- a/src/bun.js/bindings/webcore/JSErrorEvent.cpp +++ b/src/bun.js/bindings/webcore/JSErrorEvent.cpp @@ -218,11 +218,11 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSErrorEventDOMConstruct EnsureStillAliveScope argument1 = callFrame->argument(1); auto eventInitDict = convert>(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - auto object = ErrorEvent::create(type, WTFMove(eventInitDict)); + auto object = ErrorEvent::create(type, WTF::move(eventInitDict)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -270,7 +270,7 @@ void JSErrorEventPrototype::finishCreation(VM& vm) const ClassInfo JSErrorEvent::s_info = { "ErrorEvent"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSErrorEvent) }; JSErrorEvent::JSErrorEvent(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSEvent(structure, globalObject, WTFMove(impl)) + : JSEvent(structure, globalObject, WTF::move(impl)) { } @@ -444,7 +444,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // // by adding the SkipVTableValidation attribute to the interface IDL definition // // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); // #endif - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, ErrorEvent& impl) diff --git a/src/bun.js/bindings/webcore/JSErrorEvent.h b/src/bun.js/bindings/webcore/JSErrorEvent.h index 5f8bbd8026..8e285d9878 100644 --- a/src/bun.js/bindings/webcore/JSErrorEvent.h +++ b/src/bun.js/bindings/webcore/JSErrorEvent.h @@ -34,7 +34,7 @@ public: using DOMWrapped = ErrorEvent; static JSErrorEvent* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSErrorEvent* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSErrorEvent(structure, *globalObject, WTFMove(impl)); + JSErrorEvent* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSErrorEvent(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSEvent.cpp b/src/bun.js/bindings/webcore/JSEvent.cpp index 1a59d7200f..63ac7b031e 100644 --- a/src/bun.js/bindings/webcore/JSEvent.cpp +++ b/src/bun.js/bindings/webcore/JSEvent.cpp @@ -166,11 +166,11 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSEventDOMConstructor::c RETURN_IF_EXCEPTION(throwScope, {}); auto eventInitDict = convert>(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - auto object = Event::create(WTFMove(type), WTFMove(eventInitDict)); + auto object = Event::create(WTF::move(type), WTF::move(eventInitDict)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -247,7 +247,7 @@ const ClassInfo JSEvent::s_info = { "Event"_s, &Base::s_info, &JSEventTable CREATE_METHOD_TABLE(JSEvent) }; JSEvent::JSEvent(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -365,7 +365,7 @@ static inline bool setJSEvent_cancelBubbleSetter(JSGlobalObject& lexicalGlobalOb auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { - return impl.setCancelBubble(WTFMove(nativeValue)); + return impl.setCancelBubble(WTF::move(nativeValue)); }); return true; } @@ -490,7 +490,7 @@ static inline bool setJSEvent_returnValueSetter(JSGlobalObject& lexicalGlobalObj auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { - return impl.setLegacyReturnValue(WTFMove(nativeValue)); + return impl.setLegacyReturnValue(WTF::move(nativeValue)); }); return true; } @@ -578,7 +578,7 @@ static inline JSC::EncodedJSValue jsEventPrototypeFunction_initEventBody(JSC::JS EnsureStillAliveScope argument2 = callFrame->argument(2); auto cancelable = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.initEvent(WTFMove(type), WTFMove(bubbles), WTFMove(cancelable)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.initEvent(WTF::move(type), WTF::move(bubbles), WTF::move(cancelable)); }))); } JSC_DEFINE_HOST_FUNCTION(jsEventPrototypeFunction_initEvent, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) diff --git a/src/bun.js/bindings/webcore/JSEvent.h b/src/bun.js/bindings/webcore/JSEvent.h index 77f324eb94..9f963dc134 100644 --- a/src/bun.js/bindings/webcore/JSEvent.h +++ b/src/bun.js/bindings/webcore/JSEvent.h @@ -32,7 +32,7 @@ public: using Base = JSDOMWrapper; static JSEvent* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSEvent* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSEvent(structure, *globalObject, WTFMove(impl)); + JSEvent* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSEvent(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSEventEmitter.cpp b/src/bun.js/bindings/webcore/JSEventEmitter.cpp index 1ff73c6a2e..4c405a03c3 100644 --- a/src/bun.js/bindings/webcore/JSEventEmitter.cpp +++ b/src/bun.js/bindings/webcore/JSEventEmitter.cpp @@ -116,7 +116,7 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSEventEmitterDOMConstru object->setMaxListeners(maxListeners.toUInt32(lexicalGlobalObject)); } static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -210,7 +210,7 @@ void JSEventEmitterPrototype::finishCreation(VM& vm) const ClassInfo JSEventEmitter::s_info = { "EventEmitter"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSEventEmitter) }; JSEventEmitter::JSEventEmitter(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -275,13 +275,13 @@ inline JSC::EncodedJSValue JSEventEmitter::addListener(JSC::JSGlobalObject* lexi args.append(argument0.value()); args.append(argument1.value()); - JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.emitForBindings(WTFMove(newListenerEventType), WTFMove(args)); })); + JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.emitForBindings(WTF::move(newListenerEventType), WTF::move(args)); })); RETURN_IF_EXCEPTION(throwScope, {}); // then, add the listener auto listener = convert>>(*lexicalGlobalObject, argument1.value(), *castedThis, [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 1, "listener"_s, "EventEmitter"_s, "addListener"_s); }); RETURN_IF_EXCEPTION(throwScope, {}); - JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.addListenerForBindings(WTFMove(eventType), WTFMove(listener), once, prepend); })); + JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.addListenerForBindings(WTF::move(eventType), WTF::move(listener), once, prepend); })); RETURN_IF_EXCEPTION(throwScope, {}); vm.writeBarrier(&static_cast(*castedThis), argument1.value()); @@ -387,7 +387,7 @@ inline JSC::EncodedJSValue JSEventEmitter::removeListener(JSC::JSGlobalObject* l EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto listener = convert>>(*lexicalGlobalObject, argument1.value(), *castedThis, [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 1, "listener"_s, "EventEmitter"_s, "removeListener"_s); }); RETURN_IF_EXCEPTION(throwScope, {}); - JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.removeListenerForBindings(WTFMove(eventType), WTFMove(listener)); })); + JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.removeListenerForBindings(WTF::move(eventType), WTF::move(listener)); })); RETURN_IF_EXCEPTION(throwScope, {}); vm.writeBarrier(&static_cast(*castedThis), argument1.value()); impl.setThisObject(actualThis); @@ -413,7 +413,7 @@ static inline JSC::EncodedJSValue jsEventEmitterPrototypeFunction_removeAllListe EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto eventType = argument0.value().toPropertyKey(lexicalGlobalObject); RETURN_IF_EXCEPTION(throwScope, {}); - JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.removeAllListenersForBindings(WTFMove(eventType)); })); + JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.removeAllListenersForBindings(WTF::move(eventType)); })); RETURN_IF_EXCEPTION(throwScope, {}); impl.setThisObject(actualThis); RELEASE_AND_RETURN(throwScope, JSValue::encode(actualThis)); @@ -456,7 +456,7 @@ static inline JSC::EncodedJSValue jsEventEmitterPrototypeFunction_eventNamesBody for (auto& name : impl.getEventNames()) { args.append(JSC::identifierToSafePublicJSValue(vm, name)); } - auto array = JSC::constructArray(lexicalGlobalObject, static_cast(nullptr), WTFMove(args)); + auto array = JSC::constructArray(lexicalGlobalObject, static_cast(nullptr), WTF::move(args)); RETURN_IF_EXCEPTION(throwScope, {}); RELEASE_AND_RETURN(throwScope, JSC::JSValue::encode(array)); } @@ -496,7 +496,7 @@ static inline JSC::EncodedJSValue jsEventEmitterPrototypeFunction_listenersBody( for (auto* listener : impl.getListeners(eventType)) { args.append(listener); } - auto array = JSC::constructArray(lexicalGlobalObject, static_cast(nullptr), WTFMove(args)); + auto array = JSC::constructArray(lexicalGlobalObject, static_cast(nullptr), WTF::move(args)); RETURN_IF_EXCEPTION(throwScope, {}); RELEASE_AND_RETURN(throwScope, JSC::JSValue::encode(array)); } @@ -586,7 +586,7 @@ JSC_DEFINE_HOST_FUNCTION(Events_functionGetEventListeners, for (auto* listener : impl.getListeners(eventType)) { args.append(listener); } - auto array = JSC::constructArray(lexicalGlobalObject, static_cast(nullptr), WTFMove(args)); + auto array = JSC::constructArray(lexicalGlobalObject, static_cast(nullptr), WTF::move(args)); RETURN_IF_EXCEPTION(throwScope, {}); RELEASE_AND_RETURN(throwScope, JSC::JSValue::encode(array)); } @@ -652,7 +652,7 @@ JSC_DEFINE_HOST_FUNCTION(Events_functionOn, EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto listener = convert>>(*lexicalGlobalObject, argument2.value(), *argument0, [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentMustBeObjectError(lexicalGlobalObject, scope, 2, "listener"_s, "EventEmitter"_s, "removeListener"_s); }); RETURN_IF_EXCEPTION(throwScope, {}); - auto result = JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.addListenerForBindings(WTFMove(eventType), WTFMove(listener), false, false); })); + auto result = JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.addListenerForBindings(WTF::move(eventType), WTF::move(listener), false, false); })); RETURN_IF_EXCEPTION(throwScope, {}); vm.writeBarrier(argument0, argument2.value()); return result; diff --git a/src/bun.js/bindings/webcore/JSEventEmitter.h b/src/bun.js/bindings/webcore/JSEventEmitter.h index 83d4467028..f0c588327e 100644 --- a/src/bun.js/bindings/webcore/JSEventEmitter.h +++ b/src/bun.js/bindings/webcore/JSEventEmitter.h @@ -17,7 +17,7 @@ public: using Base = JSDOMWrapper; static JSEventEmitter* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSEventEmitter* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSEventEmitter(structure, *globalObject, WTFMove(impl)); + JSEventEmitter* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSEventEmitter(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSEventEmitterCustom.cpp b/src/bun.js/bindings/webcore/JSEventEmitterCustom.cpp index 3a174ce480..924ee30bb5 100644 --- a/src/bun.js/bindings/webcore/JSEventEmitterCustom.cpp +++ b/src/bun.js/bindings/webcore/JSEventEmitterCustom.cpp @@ -22,7 +22,7 @@ using namespace JSC; JSValue toJSNewlyCreated(JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref&& value) { - return createWrapper(globalObject, WTFMove(value)); + return createWrapper(globalObject, WTF::move(value)); } EventEmitter* JSEventEmitter::toWrapped(VM& vm, JSValue value) @@ -72,7 +72,7 @@ JSEventEmitter* jsEventEmitterCastFast(VM& vm, JSC::JSGlobalObject* lexicalGloba impl->setThisObject(thisObject); auto throwScope = DECLARE_THROW_SCOPE(vm); - auto result = toJSNewlyCreated>(*lexicalGlobalObject, *globalObject, throwScope, WTFMove(impl)); + auto result = toJSNewlyCreated>(*lexicalGlobalObject, *globalObject, throwScope, WTF::move(impl)); thisObject->putDirect(vm, name, result, 0); diff --git a/src/bun.js/bindings/webcore/JSEventTarget.cpp b/src/bun.js/bindings/webcore/JSEventTarget.cpp index d1fed97ce7..f2b75d165b 100644 --- a/src/bun.js/bindings/webcore/JSEventTarget.cpp +++ b/src/bun.js/bindings/webcore/JSEventTarget.cpp @@ -114,7 +114,7 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSEventTargetDOMConstruc if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -161,7 +161,7 @@ void JSEventTargetPrototype::finishCreation(VM& vm) const ClassInfo JSEventTarget::s_info = { "EventTarget"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSEventTarget) }; JSEventTarget::JSEventTarget(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -238,12 +238,12 @@ static inline JSC::EncodedJSValue jsEventTargetPrototypeFunction_addEventListene JSObject& target = *castedThis; errorInstance->putDirect(vm, vm.propertyNames->target, &target); RETURN_IF_EXCEPTION(throwScope, {}); - errorInstance->putDirect(vm, vm.propertyNames->type, jsString(vm, WTFMove(type))); + errorInstance->putDirect(vm, vm.propertyNames->type, jsString(vm, WTF::move(type))); Bun::Process::emitWarningErrorInstance(lexicalGlobalObject, errorInstance); if (throwScope.exception()) [[unlikely]] throwScope.clearException(); } - auto result = JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.addEventListenerForBindings(WTFMove(type), WTFMove(listener), WTFMove(options)); })); + auto result = JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.addEventListenerForBindings(WTF::move(type), WTF::move(listener), WTF::move(options)); })); RETURN_IF_EXCEPTION(throwScope, {}); vm.writeBarrier(&static_cast(*castedThis), argument1.value()); return result; @@ -272,7 +272,7 @@ static inline JSC::EncodedJSValue jsEventTargetPrototypeFunction_removeEventList EnsureStillAliveScope argument2 = callFrame->argument(2); auto options = argument2.value().isUndefined() ? false : convert, IDLBoolean>>(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, {}); - auto result = JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.removeEventListenerForBindings(WTFMove(type), WTFMove(listener), WTFMove(options)); })); + auto result = JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.removeEventListenerForBindings(WTF::move(type), WTF::move(listener), WTF::move(options)); })); RETURN_IF_EXCEPTION(throwScope, {}); vm.writeBarrier(&static_cast(*castedThis), argument1.value()); return result; diff --git a/src/bun.js/bindings/webcore/JSEventTarget.h b/src/bun.js/bindings/webcore/JSEventTarget.h index f8b2f99d14..a29c68e61f 100644 --- a/src/bun.js/bindings/webcore/JSEventTarget.h +++ b/src/bun.js/bindings/webcore/JSEventTarget.h @@ -36,7 +36,7 @@ public: using Base = JSDOMWrapper; static JSEventTarget* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSEventTarget* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSEventTarget(structure, *globalObject, WTFMove(impl)); + JSEventTarget* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSEventTarget(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSEventTargetCustom.cpp b/src/bun.js/bindings/webcore/JSEventTargetCustom.cpp index 368a57c74b..e30cd3033d 100644 --- a/src/bun.js/bindings/webcore/JSEventTargetCustom.cpp +++ b/src/bun.js/bindings/webcore/JSEventTargetCustom.cpp @@ -47,7 +47,7 @@ using namespace JSC; JSValue toJSNewlyCreated(JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref&& value) { - return createWrapper(globalObject, WTFMove(value)); + return createWrapper(globalObject, WTF::move(value)); } EventTarget* JSEventTarget::toWrapped(VM& vm, JSValue value) diff --git a/src/bun.js/bindings/webcore/JSFetchHeaders.cpp b/src/bun.js/bindings/webcore/JSFetchHeaders.cpp index 24c94caf95..e3ab16c356 100644 --- a/src/bun.js/bindings/webcore/JSFetchHeaders.cpp +++ b/src/bun.js/bindings/webcore/JSFetchHeaders.cpp @@ -136,7 +136,7 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSFetchHeadersDOMConstru if (argument0.value() && !argument0.value().isUndefined()) { if (auto* existingJsFetchHeaders = jsDynamicCast(argument0.value())) { auto newHeaders = FetchHeaders::create(existingJsFetchHeaders->wrapped()); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(newHeaders)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(newHeaders)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -147,11 +147,11 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSFetchHeadersDOMConstru } RETURN_IF_EXCEPTION(throwScope, {}); - auto object = FetchHeaders::create(WTFMove(init)); + auto object = FetchHeaders::create(WTF::move(init)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -331,7 +331,7 @@ void JSFetchHeadersPrototype::finishCreation(VM& vm) const ClassInfo JSFetchHeaders::s_info = { "Headers"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSFetchHeaders) }; JSFetchHeaders::JSFetchHeaders(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -401,7 +401,7 @@ static inline JSC::EncodedJSValue jsFetchHeadersPrototypeFunction_appendBody(JSC EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto value = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.append(WTFMove(name), WTFMove(value)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.append(WTF::move(name), WTF::move(value)); }))); } /** @@ -503,7 +503,7 @@ static inline JSC::EncodedJSValue jsFetchHeadersPrototypeFunction_setBody(JSC::J EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto value = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.set(WTFMove(name), WTFMove(value)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.set(WTF::move(name), WTF::move(value)); }))); } JSC_DEFINE_HOST_FUNCTION(jsFetchHeadersPrototypeFunction_set, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -760,7 +760,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, FetchHeaders& impl) diff --git a/src/bun.js/bindings/webcore/JSFetchHeaders.h b/src/bun.js/bindings/webcore/JSFetchHeaders.h index 46e52f703c..33ba364098 100644 --- a/src/bun.js/bindings/webcore/JSFetchHeaders.h +++ b/src/bun.js/bindings/webcore/JSFetchHeaders.h @@ -31,7 +31,7 @@ public: using Base = JSDOMWrapper; static JSFetchHeaders* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSFetchHeaders* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSFetchHeaders(structure, *globalObject, WTFMove(impl)); + JSFetchHeaders* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSFetchHeaders(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSMIMEType.cpp b/src/bun.js/bindings/webcore/JSMIMEType.cpp index 57edf53082..0f9b967741 100644 --- a/src/bun.js/bindings/webcore/JSMIMEType.cpp +++ b/src/bun.js/bindings/webcore/JSMIMEType.cpp @@ -272,7 +272,7 @@ static std::tuple parseTypeAndSubtype(JSGlobalObject* gl String subtype = subtypeView.convertToASCIILowercase(); // Return type, subtype, and the index where parameters start - return std::make_tuple(WTFMove(type), WTFMove(subtype), paramsStartIndex); + return std::make_tuple(WTF::move(type), WTF::move(subtype), paramsStartIndex); } //-- JSMIMEType (Instance) Implementation -- @@ -282,7 +282,7 @@ const ClassInfo JSMIMEType::s_info = { "MIMEType"_s, &Base::s_info, nullptr, nul JSMIMEType* JSMIMEType::create(VM& vm, Structure* structure, String type, String subtype, JSMIMEParams* params) { JSMIMEType* instance = new (NotNull, allocateCell(vm)) JSMIMEType(vm, structure); - instance->finishCreation(vm, WTFMove(type), WTFMove(subtype), params); + instance->finishCreation(vm, WTF::move(type), WTF::move(subtype), params); return instance; } @@ -300,8 +300,8 @@ void JSMIMEType::finishCreation(VM& vm, String type, String subtype, JSMIMEParam { Base::finishCreation(vm); ASSERT(inherits(info())); - m_type = WTFMove(type); - m_subtype = WTFMove(subtype); + m_type = WTF::move(type); + m_subtype = WTF::move(subtype); m_parameters.set(vm, this, params); } @@ -581,7 +581,7 @@ JSC_DEFINE_HOST_FUNCTION(constructMIMEType, (JSGlobalObject * globalObject, Call JSMIMEParams* paramsInstance = JSMIMEParams::create(vm, paramsStructure, paramsMap); // 4. Create the JSMIMEType instance - JSMIMEType* instance = JSMIMEType::create(vm, structure, WTFMove(type), WTFMove(subtype), paramsInstance); + JSMIMEType* instance = JSMIMEType::create(vm, structure, WTF::move(type), WTF::move(subtype), paramsInstance); return JSC::JSValue::encode(instance); } diff --git a/src/bun.js/bindings/webcore/JSMIMEType.h b/src/bun.js/bindings/webcore/JSMIMEType.h index f7bf15af92..f4697c2031 100644 --- a/src/bun.js/bindings/webcore/JSMIMEType.h +++ b/src/bun.js/bindings/webcore/JSMIMEType.h @@ -36,10 +36,10 @@ public: DECLARE_VISIT_CHILDREN; const WTF::String& type() const { return m_type; } - void setType(WTF::String type) { m_type = WTFMove(type); } + void setType(WTF::String type) { m_type = WTF::move(type); } const WTF::String& subtype() const { return m_subtype; } - void setSubtype(WTF::String subtype) { m_subtype = WTFMove(subtype); } + void setSubtype(WTF::String subtype) { m_subtype = WTF::move(subtype); } JSMIMEParams* parameters() const { return m_parameters.get(); } diff --git a/src/bun.js/bindings/webcore/JSMessageChannel.cpp b/src/bun.js/bindings/webcore/JSMessageChannel.cpp index 0d46552605..e7ebdd447f 100644 --- a/src/bun.js/bindings/webcore/JSMessageChannel.cpp +++ b/src/bun.js/bindings/webcore/JSMessageChannel.cpp @@ -102,7 +102,7 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSMessageChannelDOMConst if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -148,7 +148,7 @@ void JSMessageChannelPrototype::finishCreation(VM& vm) const ClassInfo JSMessageChannel::s_info = { "MessageChannel"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSMessageChannel) }; JSMessageChannel::JSMessageChannel(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -301,7 +301,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, MessageChannel& impl) diff --git a/src/bun.js/bindings/webcore/JSMessageChannel.h b/src/bun.js/bindings/webcore/JSMessageChannel.h index 08b5b96ff9..6dad079ed4 100644 --- a/src/bun.js/bindings/webcore/JSMessageChannel.h +++ b/src/bun.js/bindings/webcore/JSMessageChannel.h @@ -31,7 +31,7 @@ public: using Base = JSDOMWrapper; static JSMessageChannel* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSMessageChannel* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSMessageChannel(structure, *globalObject, WTFMove(impl)); + JSMessageChannel* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSMessageChannel(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSMessageEvent.cpp b/src/bun.js/bindings/webcore/JSMessageEvent.cpp index b7db3c24a4..90545ef958 100644 --- a/src/bun.js/bindings/webcore/JSMessageEvent.cpp +++ b/src/bun.js/bindings/webcore/JSMessageEvent.cpp @@ -244,11 +244,11 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSMessageEventDOMConstru EnsureStillAliveScope argument1 = callFrame->argument(1); auto eventInitDict = convert>(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - auto object = MessageEvent::create(WTFMove(type), WTFMove(eventInitDict)); + auto object = MessageEvent::create(WTF::move(type), WTF::move(eventInitDict)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -297,7 +297,7 @@ void JSMessageEventPrototype::finishCreation(VM& vm) const ClassInfo JSMessageEvent::s_info = { "MessageEvent"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSMessageEvent) }; JSMessageEvent::JSMessageEvent(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSEvent(structure, globalObject, WTFMove(impl)) + : JSEvent(structure, globalObject, WTF::move(impl)) { } @@ -430,7 +430,7 @@ static inline JSC::EncodedJSValue jsMessageEventPrototypeFunction_initMessageEve EnsureStillAliveScope argument7 = callFrame->argument(7); auto messagePorts = argument7.value().isUndefined() ? Converter>>::ReturnType {} : convert>>(*lexicalGlobalObject, argument7.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.initMessageEvent(WTFMove(type), WTFMove(bubbles), WTFMove(cancelable), WTFMove(data), WTFMove(originArg), WTFMove(lastEventId), WTFMove(source), WTFMove(messagePorts)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.initMessageEvent(WTF::move(type), WTF::move(bubbles), WTF::move(cancelable), WTF::move(data), WTF::move(originArg), WTF::move(lastEventId), WTF::move(source), WTF::move(messagePorts)); }))); } JSC_DEFINE_HOST_FUNCTION(jsMessageEventPrototypeFunction_initMessageEvent, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -518,7 +518,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, MessageEvent& impl) diff --git a/src/bun.js/bindings/webcore/JSMessageEvent.h b/src/bun.js/bindings/webcore/JSMessageEvent.h index 8f48568f77..d4a29c524a 100644 --- a/src/bun.js/bindings/webcore/JSMessageEvent.h +++ b/src/bun.js/bindings/webcore/JSMessageEvent.h @@ -33,7 +33,7 @@ public: using DOMWrapped = MessageEvent; static JSMessageEvent* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSMessageEvent* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSMessageEvent(structure, *globalObject, WTFMove(impl)); + JSMessageEvent* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSMessageEvent(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSMessagePort.cpp b/src/bun.js/bindings/webcore/JSMessagePort.cpp index 94aad037df..5fb0d1fec8 100644 --- a/src/bun.js/bindings/webcore/JSMessagePort.cpp +++ b/src/bun.js/bindings/webcore/JSMessagePort.cpp @@ -150,7 +150,7 @@ void JSMessagePortPrototype::finishCreation(VM& vm) const ClassInfo JSMessagePort::s_info = { "MessagePort"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSMessagePort) }; JSMessagePort::JSMessagePort(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSEventTarget(structure, globalObject, WTFMove(impl)) + : JSEventTarget(structure, globalObject, WTF::move(impl)) { } @@ -254,7 +254,7 @@ static inline JSC::EncodedJSValue jsMessagePortPrototypeFunction_postMessage1Bod EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto transfer = convert>(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.postMessage(*jsCast(lexicalGlobalObject), WTFMove(message), WTFMove(transfer)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.postMessage(*jsCast(lexicalGlobalObject), WTF::move(message), WTF::move(transfer)); }))); } static inline JSC::EncodedJSValue jsMessagePortPrototypeFunction_postMessage2Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) @@ -270,7 +270,7 @@ static inline JSC::EncodedJSValue jsMessagePortPrototypeFunction_postMessage2Bod EnsureStillAliveScope argument1 = callFrame->argument(1); auto options = convert>(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.postMessage(*jsCast(lexicalGlobalObject), WTFMove(message), WTFMove(options)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.postMessage(*jsCast(lexicalGlobalObject), WTF::move(message), WTF::move(options)); }))); } static inline JSC::EncodedJSValue jsMessagePortPrototypeFunction_postMessageOverloadDispatcher(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) @@ -478,7 +478,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, MessagePort& impl) diff --git a/src/bun.js/bindings/webcore/JSMessagePort.h b/src/bun.js/bindings/webcore/JSMessagePort.h index dda3f9988a..3cbd5e3ceb 100644 --- a/src/bun.js/bindings/webcore/JSMessagePort.h +++ b/src/bun.js/bindings/webcore/JSMessagePort.h @@ -33,7 +33,7 @@ public: using DOMWrapped = MessagePort; static JSMessagePort* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSMessagePort* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSMessagePort(structure, *globalObject, WTFMove(impl)); + JSMessagePort* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSMessagePort(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSPerformance.cpp b/src/bun.js/bindings/webcore/JSPerformance.cpp index 813a973501..7c0f987ab3 100644 --- a/src/bun.js/bindings/webcore/JSPerformance.cpp +++ b/src/bun.js/bindings/webcore/JSPerformance.cpp @@ -252,7 +252,7 @@ void JSPerformancePrototype::finishCreation(VM& vm) const ClassInfo JSPerformance::s_info = { "Performance"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSPerformance) }; JSPerformance::JSPerformance(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSEventTarget(structure, globalObject, WTFMove(impl)) + : JSEventTarget(structure, globalObject, WTF::move(impl)) { } @@ -452,7 +452,7 @@ static inline JSC::EncodedJSValue jsPerformancePrototypeFunction_getEntriesByTyp EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto type = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.getEntriesByType(WTFMove(type))))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.getEntriesByType(WTF::move(type))))); } JSC_DEFINE_HOST_FUNCTION(jsPerformancePrototypeFunction_getEntriesByType, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -475,7 +475,7 @@ static inline JSC::EncodedJSValue jsPerformancePrototypeFunction_getEntriesByNam EnsureStillAliveScope argument1 = callFrame->argument(1); auto type = argument1.value().isUndefined() ? String() : convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.getEntriesByName(WTFMove(name), WTFMove(type))))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.getEntriesByName(WTF::move(name), WTF::move(type))))); } JSC_DEFINE_HOST_FUNCTION(jsPerformancePrototypeFunction_getEntriesByName, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -510,7 +510,7 @@ static inline JSC::EncodedJSValue jsPerformancePrototypeFunction_setResourceTimi EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto maxSize = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.setResourceTimingBufferSize(WTFMove(maxSize)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.setResourceTimingBufferSize(WTF::move(maxSize)); }))); } JSC_DEFINE_HOST_FUNCTION(jsPerformancePrototypeFunction_setResourceTimingBufferSize, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -533,7 +533,7 @@ static inline JSC::EncodedJSValue jsPerformancePrototypeFunction_markBody(JSC::J EnsureStillAliveScope argument1 = callFrame->argument(1); auto markOptions = convert>(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.mark(*jsCast(lexicalGlobalObject), WTFMove(markName), WTFMove(markOptions))))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.mark(*jsCast(lexicalGlobalObject), WTF::move(markName), WTF::move(markOptions))))); } JSC_DEFINE_HOST_FUNCTION(jsPerformancePrototypeFunction_mark, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -551,7 +551,7 @@ static inline JSC::EncodedJSValue jsPerformancePrototypeFunction_clearMarksBody( EnsureStillAliveScope argument0 = callFrame->argument(0); auto markName = argument0.value().isUndefined() ? String() : convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.clearMarks(WTFMove(markName)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.clearMarks(WTF::move(markName)); }))); } JSC_DEFINE_HOST_FUNCTION(jsPerformancePrototypeFunction_clearMarks, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -577,7 +577,7 @@ static inline JSC::EncodedJSValue jsPerformancePrototypeFunction_measureBody(JSC EnsureStillAliveScope argument2 = callFrame->argument(2); auto endMark = argument2.value().isUndefined() ? String() : convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.measure(*jsCast(lexicalGlobalObject), WTFMove(measureName), WTFMove(startOrMeasureOptions), WTFMove(endMark))))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.measure(*jsCast(lexicalGlobalObject), WTF::move(measureName), WTF::move(startOrMeasureOptions), WTF::move(endMark))))); } JSC_DEFINE_HOST_FUNCTION(jsPerformancePrototypeFunction_measure, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -595,7 +595,7 @@ static inline JSC::EncodedJSValue jsPerformancePrototypeFunction_clearMeasuresBo EnsureStillAliveScope argument0 = callFrame->argument(0); auto measureName = argument0.value().isUndefined() ? String() : convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.clearMeasures(WTFMove(measureName)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.clearMeasures(WTF::move(measureName)); }))); } JSC_DEFINE_HOST_FUNCTION(jsPerformancePrototypeFunction_clearMeasures, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -672,7 +672,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, Performance& impl) diff --git a/src/bun.js/bindings/webcore/JSPerformance.h b/src/bun.js/bindings/webcore/JSPerformance.h index 9aa6f243e9..0cbb940959 100644 --- a/src/bun.js/bindings/webcore/JSPerformance.h +++ b/src/bun.js/bindings/webcore/JSPerformance.h @@ -35,7 +35,7 @@ public: using DOMWrapped = Performance; static JSPerformance* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSPerformance* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSPerformance(structure, *globalObject, WTFMove(impl)); + JSPerformance* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSPerformance(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSPerformanceEntry.cpp b/src/bun.js/bindings/webcore/JSPerformanceEntry.cpp index 1ff05b9c48..adf1d170fa 100644 --- a/src/bun.js/bindings/webcore/JSPerformanceEntry.cpp +++ b/src/bun.js/bindings/webcore/JSPerformanceEntry.cpp @@ -135,7 +135,7 @@ void JSPerformanceEntryPrototype::finishCreation(VM& vm) const ClassInfo JSPerformanceEntry::s_info = { "PerformanceEntry"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSPerformanceEntry) }; JSPerformanceEntry::JSPerformanceEntry(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } diff --git a/src/bun.js/bindings/webcore/JSPerformanceEntry.h b/src/bun.js/bindings/webcore/JSPerformanceEntry.h index 36a5df80a7..b8af390991 100644 --- a/src/bun.js/bindings/webcore/JSPerformanceEntry.h +++ b/src/bun.js/bindings/webcore/JSPerformanceEntry.h @@ -31,7 +31,7 @@ public: using Base = JSDOMWrapper; static JSPerformanceEntry* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSPerformanceEntry* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSPerformanceEntry(structure, *globalObject, WTFMove(impl)); + JSPerformanceEntry* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSPerformanceEntry(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSPerformanceEntryCustom.cpp b/src/bun.js/bindings/webcore/JSPerformanceEntryCustom.cpp index a7d86488b7..944427d627 100644 --- a/src/bun.js/bindings/webcore/JSPerformanceEntryCustom.cpp +++ b/src/bun.js/bindings/webcore/JSPerformanceEntryCustom.cpp @@ -51,21 +51,21 @@ JSValue toJSNewlyCreated(JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref

performanceEntryType()) { // case PerformanceEntry::Type::Navigation: - // return createWrapper(globalObject, WTFMove(entry)); + // return createWrapper(globalObject, WTF::move(entry)); case PerformanceEntry::Type::Mark: - return createWrapper(globalObject, WTFMove(entry)); + return createWrapper(globalObject, WTF::move(entry)); case PerformanceEntry::Type::Measure: - return createWrapper(globalObject, WTFMove(entry)); + return createWrapper(globalObject, WTF::move(entry)); // case PerformanceEntry::Type::Resource: - // return createWrapper(globalObject, WTFMove(entry)); + // return createWrapper(globalObject, WTF::move(entry)); // case PerformanceEntry::Type::Paint: - // return createWrapper(globalObject, WTFMove(entry)); + // return createWrapper(globalObject, WTF::move(entry)); default: { } } ASSERT_NOT_REACHED(); - return createWrapper(globalObject, WTFMove(entry)); + return createWrapper(globalObject, WTF::move(entry)); } JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, PerformanceEntry& entry) diff --git a/src/bun.js/bindings/webcore/JSPerformanceMark.cpp b/src/bun.js/bindings/webcore/JSPerformanceMark.cpp index a7fa5e5768..56a7b33bef 100644 --- a/src/bun.js/bindings/webcore/JSPerformanceMark.cpp +++ b/src/bun.js/bindings/webcore/JSPerformanceMark.cpp @@ -105,11 +105,11 @@ template<> EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSPerformanceMarkDOMConstruct EnsureStillAliveScope argument1 = callFrame->argument(1); auto markOptions = convert>(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - auto object = PerformanceMark::create(*castedThis->globalObject(), *context, WTFMove(markName), WTFMove(markOptions)); + auto object = PerformanceMark::create(*castedThis->globalObject(), *context, WTF::move(markName), WTF::move(markOptions)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -153,7 +153,7 @@ void JSPerformanceMarkPrototype::finishCreation(VM& vm) const ClassInfo JSPerformanceMark::s_info = { "PerformanceMark"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSPerformanceMark) }; JSPerformanceMark::JSPerformanceMark(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSPerformanceEntry(structure, globalObject, WTFMove(impl)) + : JSPerformanceEntry(structure, globalObject, WTF::move(impl)) { } @@ -266,7 +266,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, PerformanceMark& impl) diff --git a/src/bun.js/bindings/webcore/JSPerformanceMark.h b/src/bun.js/bindings/webcore/JSPerformanceMark.h index 00c92883ef..177af58fa9 100644 --- a/src/bun.js/bindings/webcore/JSPerformanceMark.h +++ b/src/bun.js/bindings/webcore/JSPerformanceMark.h @@ -32,7 +32,7 @@ public: using DOMWrapped = PerformanceMark; static JSPerformanceMark* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSPerformanceMark* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSPerformanceMark(structure, *globalObject, WTFMove(impl)); + JSPerformanceMark* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSPerformanceMark(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSPerformanceMeasure.cpp b/src/bun.js/bindings/webcore/JSPerformanceMeasure.cpp index c0dbd10789..008f4a29cb 100644 --- a/src/bun.js/bindings/webcore/JSPerformanceMeasure.cpp +++ b/src/bun.js/bindings/webcore/JSPerformanceMeasure.cpp @@ -119,7 +119,7 @@ void JSPerformanceMeasurePrototype::finishCreation(VM& vm) const ClassInfo JSPerformanceMeasure::s_info = { "PerformanceMeasure"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSPerformanceMeasure) }; JSPerformanceMeasure::JSPerformanceMeasure(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSPerformanceEntry(structure, globalObject, WTFMove(impl)) + : JSPerformanceEntry(structure, globalObject, WTF::move(impl)) { } diff --git a/src/bun.js/bindings/webcore/JSPerformanceMeasure.h b/src/bun.js/bindings/webcore/JSPerformanceMeasure.h index 15134c1891..62ab867472 100644 --- a/src/bun.js/bindings/webcore/JSPerformanceMeasure.h +++ b/src/bun.js/bindings/webcore/JSPerformanceMeasure.h @@ -32,7 +32,7 @@ public: using DOMWrapped = PerformanceMeasure; static JSPerformanceMeasure* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSPerformanceMeasure* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSPerformanceMeasure(structure, *globalObject, WTFMove(impl)); + JSPerformanceMeasure* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSPerformanceMeasure(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSPerformanceObserver.cpp b/src/bun.js/bindings/webcore/JSPerformanceObserver.cpp index 12621cb1d3..01b0b441bb 100644 --- a/src/bun.js/bindings/webcore/JSPerformanceObserver.cpp +++ b/src/bun.js/bindings/webcore/JSPerformanceObserver.cpp @@ -180,7 +180,7 @@ template<> EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSPerformanceObserverDOMConst if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -228,7 +228,7 @@ void JSPerformanceObserverPrototype::finishCreation(VM& vm) const ClassInfo JSPerformanceObserver::s_info = { "PerformanceObserver"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSPerformanceObserver) }; JSPerformanceObserver::JSPerformanceObserver(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -290,7 +290,7 @@ static inline JSC::EncodedJSValue jsPerformanceObserverPrototypeFunction_observe EnsureStillAliveScope argument0 = callFrame->argument(0); auto options = convert>(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.observe(WTFMove(options)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.observe(WTF::move(options)); }))); } JSC_DEFINE_HOST_FUNCTION(jsPerformanceObserverPrototypeFunction_observe, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -408,7 +408,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, PerformanceObserver& impl) diff --git a/src/bun.js/bindings/webcore/JSPerformanceObserver.h b/src/bun.js/bindings/webcore/JSPerformanceObserver.h index 6f6baef607..989fc79b7e 100644 --- a/src/bun.js/bindings/webcore/JSPerformanceObserver.h +++ b/src/bun.js/bindings/webcore/JSPerformanceObserver.h @@ -32,7 +32,7 @@ public: using Base = JSDOMWrapper; static JSPerformanceObserver* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSPerformanceObserver* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSPerformanceObserver(structure, *globalObject, WTFMove(impl)); + JSPerformanceObserver* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSPerformanceObserver(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSPerformanceObserverEntryList.cpp b/src/bun.js/bindings/webcore/JSPerformanceObserverEntryList.cpp index 7c5a4972b4..4b7a580efd 100644 --- a/src/bun.js/bindings/webcore/JSPerformanceObserverEntryList.cpp +++ b/src/bun.js/bindings/webcore/JSPerformanceObserverEntryList.cpp @@ -133,7 +133,7 @@ void JSPerformanceObserverEntryListPrototype::finishCreation(VM& vm) const ClassInfo JSPerformanceObserverEntryList::s_info = { "PerformanceObserverEntryList"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSPerformanceObserverEntryList) }; JSPerformanceObserverEntryList::JSPerformanceObserverEntryList(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -199,7 +199,7 @@ static inline JSC::EncodedJSValue jsPerformanceObserverEntryListPrototypeFunctio EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto type = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.getEntriesByType(WTFMove(type))))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.getEntriesByType(WTF::move(type))))); } JSC_DEFINE_HOST_FUNCTION(jsPerformanceObserverEntryListPrototypeFunction_getEntriesByType, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -222,7 +222,7 @@ static inline JSC::EncodedJSValue jsPerformanceObserverEntryListPrototypeFunctio EnsureStillAliveScope argument1 = callFrame->argument(1); auto type = argument1.value().isUndefined() ? String() : convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.getEntriesByName(WTFMove(name), WTFMove(type))))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.getEntriesByName(WTF::move(name), WTF::move(type))))); } JSC_DEFINE_HOST_FUNCTION(jsPerformanceObserverEntryListPrototypeFunction_getEntriesByName, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -296,7 +296,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, PerformanceObserverEntryList& impl) diff --git a/src/bun.js/bindings/webcore/JSPerformanceObserverEntryList.h b/src/bun.js/bindings/webcore/JSPerformanceObserverEntryList.h index 9c77f7a39b..2c7a8091e3 100644 --- a/src/bun.js/bindings/webcore/JSPerformanceObserverEntryList.h +++ b/src/bun.js/bindings/webcore/JSPerformanceObserverEntryList.h @@ -31,7 +31,7 @@ public: using Base = JSDOMWrapper; static JSPerformanceObserverEntryList* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSPerformanceObserverEntryList* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSPerformanceObserverEntryList(structure, *globalObject, WTFMove(impl)); + JSPerformanceObserverEntryList* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSPerformanceObserverEntryList(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSPerformanceResourceTiming.cpp b/src/bun.js/bindings/webcore/JSPerformanceResourceTiming.cpp index dbef65a877..a0e82c0094 100644 --- a/src/bun.js/bindings/webcore/JSPerformanceResourceTiming.cpp +++ b/src/bun.js/bindings/webcore/JSPerformanceResourceTiming.cpp @@ -166,7 +166,7 @@ void JSPerformanceResourceTimingPrototype::finishCreation(VM& vm) const ClassInfo JSPerformanceResourceTiming::s_info = { "PerformanceResourceTiming"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSPerformanceResourceTiming) }; JSPerformanceResourceTiming::JSPerformanceResourceTiming(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSPerformanceEntry(structure, globalObject, WTFMove(impl)) + : JSPerformanceEntry(structure, globalObject, WTF::move(impl)) { } diff --git a/src/bun.js/bindings/webcore/JSPerformanceResourceTiming.h b/src/bun.js/bindings/webcore/JSPerformanceResourceTiming.h index 86e6b29327..e9127b59d1 100644 --- a/src/bun.js/bindings/webcore/JSPerformanceResourceTiming.h +++ b/src/bun.js/bindings/webcore/JSPerformanceResourceTiming.h @@ -33,7 +33,7 @@ public: static JSPerformanceResourceTiming* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { auto& vm = JSC::getVM(globalObject); - JSPerformanceResourceTiming* ptr = new (NotNull, JSC::allocateCell(vm)) JSPerformanceResourceTiming(structure, *globalObject, WTFMove(impl)); + JSPerformanceResourceTiming* ptr = new (NotNull, JSC::allocateCell(vm)) JSPerformanceResourceTiming(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(vm); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSPerformanceServerTiming.cpp b/src/bun.js/bindings/webcore/JSPerformanceServerTiming.cpp index 492a393198..99abe5e87f 100644 --- a/src/bun.js/bindings/webcore/JSPerformanceServerTiming.cpp +++ b/src/bun.js/bindings/webcore/JSPerformanceServerTiming.cpp @@ -133,7 +133,7 @@ void JSPerformanceServerTimingPrototype::finishCreation(VM& vm) const ClassInfo JSPerformanceServerTiming::s_info = { "PerformanceServerTiming"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSPerformanceServerTiming) }; JSPerformanceServerTiming::JSPerformanceServerTiming(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -296,7 +296,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); // #endif // } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, PerformanceServerTiming& impl) diff --git a/src/bun.js/bindings/webcore/JSPerformanceServerTiming.h b/src/bun.js/bindings/webcore/JSPerformanceServerTiming.h index 7d549f3689..fd32594b17 100644 --- a/src/bun.js/bindings/webcore/JSPerformanceServerTiming.h +++ b/src/bun.js/bindings/webcore/JSPerformanceServerTiming.h @@ -32,7 +32,7 @@ public: static JSPerformanceServerTiming* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { auto& vm = JSC::getVM(globalObject); - JSPerformanceServerTiming* ptr = new (NotNull, JSC::allocateCell(vm)) JSPerformanceServerTiming(structure, *globalObject, WTFMove(impl)); + JSPerformanceServerTiming* ptr = new (NotNull, JSC::allocateCell(vm)) JSPerformanceServerTiming(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(vm); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSPerformanceTiming.cpp b/src/bun.js/bindings/webcore/JSPerformanceTiming.cpp index 1f21ac34f4..f9a93c638a 100644 --- a/src/bun.js/bindings/webcore/JSPerformanceTiming.cpp +++ b/src/bun.js/bindings/webcore/JSPerformanceTiming.cpp @@ -168,7 +168,7 @@ void JSPerformanceTimingPrototype::finishCreation(VM& vm) const ClassInfo JSPerformanceTiming::s_info = { "PerformanceTiming"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSPerformanceTiming) }; JSPerformanceTiming::JSPerformanceTiming(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -624,7 +624,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, PerformanceTiming& impl) diff --git a/src/bun.js/bindings/webcore/JSPerformanceTiming.h b/src/bun.js/bindings/webcore/JSPerformanceTiming.h index a9a1d0124e..e7c42ec4a0 100644 --- a/src/bun.js/bindings/webcore/JSPerformanceTiming.h +++ b/src/bun.js/bindings/webcore/JSPerformanceTiming.h @@ -31,7 +31,7 @@ public: using Base = JSDOMWrapper; static JSPerformanceTiming* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSPerformanceTiming* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSPerformanceTiming(structure, *globalObject, WTFMove(impl)); + JSPerformanceTiming* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSPerformanceTiming(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSReadableStreamSink.cpp b/src/bun.js/bindings/webcore/JSReadableStreamSink.cpp index 0a34f52ff5..93219a4700 100644 --- a/src/bun.js/bindings/webcore/JSReadableStreamSink.cpp +++ b/src/bun.js/bindings/webcore/JSReadableStreamSink.cpp @@ -106,7 +106,7 @@ void JSReadableStreamSinkPrototype::finishCreation(VM& vm) const ClassInfo JSReadableStreamSink::s_info = { "ReadableStreamSink"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSReadableStreamSink) }; JSReadableStreamSink::JSReadableStreamSink(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -148,7 +148,7 @@ static inline JSC::EncodedJSValue jsReadableStreamSinkPrototypeFunction_enqueueB EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto chunk = convert>(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.enqueue(WTFMove(chunk)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.enqueue(WTF::move(chunk)); }))); } JSC_DEFINE_HOST_FUNCTION(jsReadableStreamSinkPrototypeFunction_enqueue, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -183,7 +183,7 @@ static inline JSC::EncodedJSValue jsReadableStreamSinkPrototypeFunction_errorBod EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto message = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.error(WTFMove(message)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.error(WTF::move(message)); }))); } JSC_DEFINE_HOST_FUNCTION(jsReadableStreamSinkPrototypeFunction_error, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -227,7 +227,7 @@ void JSReadableStreamSinkOwner::finalize(JSC::Handle handle, void* JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref&& impl) { - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, ReadableStreamSink& impl) diff --git a/src/bun.js/bindings/webcore/JSReadableStreamSink.h b/src/bun.js/bindings/webcore/JSReadableStreamSink.h index 66c77c2c70..e029d9ac31 100644 --- a/src/bun.js/bindings/webcore/JSReadableStreamSink.h +++ b/src/bun.js/bindings/webcore/JSReadableStreamSink.h @@ -31,7 +31,7 @@ public: using Base = JSDOMWrapper; static JSReadableStreamSink* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSReadableStreamSink* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSReadableStreamSink(structure, *globalObject, WTFMove(impl)); + JSReadableStreamSink* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSReadableStreamSink(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSReadableStreamSource.cpp b/src/bun.js/bindings/webcore/JSReadableStreamSource.cpp index b2e5751b09..24115897c0 100644 --- a/src/bun.js/bindings/webcore/JSReadableStreamSource.cpp +++ b/src/bun.js/bindings/webcore/JSReadableStreamSource.cpp @@ -116,7 +116,7 @@ void JSReadableStreamSourcePrototype::finishCreation(VM& vm) const ClassInfo JSReadableStreamSource::s_info = { "ReadableStreamSource"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSReadableStreamSource) }; JSReadableStreamSource::JSReadableStreamSource(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -163,7 +163,7 @@ static inline JSC::EncodedJSValue jsReadableStreamSourcePrototypeFunction_startB auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); - RELEASE_AND_RETURN(throwScope, (JSValue::encode(castedThis->start(*lexicalGlobalObject, *callFrame, WTFMove(promise))))); + RELEASE_AND_RETURN(throwScope, (JSValue::encode(castedThis->start(*lexicalGlobalObject, *callFrame, WTF::move(promise))))); } JSC_DEFINE_HOST_FUNCTION(jsReadableStreamSourcePrototypeFunction_start, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -177,7 +177,7 @@ static inline JSC::EncodedJSValue jsReadableStreamSourcePrototypeFunction_pullBo auto throwScope = DECLARE_THROW_SCOPE(vm); UNUSED_PARAM(throwScope); UNUSED_PARAM(callFrame); - RELEASE_AND_RETURN(throwScope, (JSValue::encode(castedThis->pull(*lexicalGlobalObject, *callFrame, WTFMove(promise))))); + RELEASE_AND_RETURN(throwScope, (JSValue::encode(castedThis->pull(*lexicalGlobalObject, *callFrame, WTF::move(promise))))); } JSC_DEFINE_HOST_FUNCTION(jsReadableStreamSourcePrototypeFunction_pull, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -197,7 +197,7 @@ static inline JSC::EncodedJSValue jsReadableStreamSourcePrototypeFunction_cancel EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto reason = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.cancel(WTFMove(reason)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.cancel(WTF::move(reason)); }))); } JSC_DEFINE_HOST_FUNCTION(jsReadableStreamSourcePrototypeFunction_cancel, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -252,7 +252,7 @@ void JSReadableStreamSourceOwner::finalize(JSC::Handle handle, voi JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref&& impl) { - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, ReadableStreamSource& impl) diff --git a/src/bun.js/bindings/webcore/JSReadableStreamSource.h b/src/bun.js/bindings/webcore/JSReadableStreamSource.h index 6cd8f933f6..eb26e8018b 100644 --- a/src/bun.js/bindings/webcore/JSReadableStreamSource.h +++ b/src/bun.js/bindings/webcore/JSReadableStreamSource.h @@ -31,7 +31,7 @@ public: using Base = JSDOMWrapper; static JSReadableStreamSource* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSReadableStreamSource* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSReadableStreamSource(structure, *globalObject, WTFMove(impl)); + JSReadableStreamSource* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSReadableStreamSource(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSReadableStreamSourceCustom.cpp b/src/bun.js/bindings/webcore/JSReadableStreamSourceCustom.cpp index 7082fd6f29..64b2d40439 100644 --- a/src/bun.js/bindings/webcore/JSReadableStreamSourceCustom.cpp +++ b/src/bun.js/bindings/webcore/JSReadableStreamSourceCustom.cpp @@ -45,14 +45,14 @@ JSValue JSReadableStreamSource::start(JSGlobalObject& lexicalGlobalObject, CallF m_controller.set(vm, this, controller); - wrapped().start(ReadableStreamDefaultController(controller), WTFMove(promise)); + wrapped().start(ReadableStreamDefaultController(controller), WTF::move(promise)); return jsUndefined(); } JSValue JSReadableStreamSource::pull(JSGlobalObject&, CallFrame&, Ref&& promise) { - wrapped().pull(WTFMove(promise)); + wrapped().pull(WTF::move(promise)); return jsUndefined(); } diff --git a/src/bun.js/bindings/webcore/JSTextEncoder.cpp b/src/bun.js/bindings/webcore/JSTextEncoder.cpp index 0a1fcf212e..6eddba70b7 100644 --- a/src/bun.js/bindings/webcore/JSTextEncoder.cpp +++ b/src/bun.js/bindings/webcore/JSTextEncoder.cpp @@ -189,7 +189,7 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSTextEncoderDOMConstruc if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -314,7 +314,7 @@ void JSTextEncoderPrototype::finishCreation(VM& vm) const ClassInfo JSTextEncoder::s_info = { "TextEncoder"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSTextEncoder) }; JSTextEncoder::JSTextEncoder(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -527,7 +527,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, TextEncoder& impl) diff --git a/src/bun.js/bindings/webcore/JSTextEncoder.h b/src/bun.js/bindings/webcore/JSTextEncoder.h index 3b192f5223..9775edeae6 100644 --- a/src/bun.js/bindings/webcore/JSTextEncoder.h +++ b/src/bun.js/bindings/webcore/JSTextEncoder.h @@ -34,7 +34,7 @@ public: using Base = JSDOMWrapper; static JSTextEncoder* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSTextEncoder* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSTextEncoder(structure, *globalObject, WTFMove(impl)); + JSTextEncoder* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSTextEncoder(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSURLPattern.cpp b/src/bun.js/bindings/webcore/JSURLPattern.cpp index b6b531ca04..987ec667b6 100644 --- a/src/bun.js/bindings/webcore/JSURLPattern.cpp +++ b/src/bun.js/bindings/webcore/JSURLPattern.cpp @@ -63,15 +63,15 @@ using namespace JSC; static URLPattern::URLPatternInput convertToWTFVariant(std::variant&& input) { if (std::holds_alternative(input)) - return URLPattern::URLPatternInput(std::get(std::move(input))); - return URLPattern::URLPatternInput(std::get(std::move(input))); + return URLPattern::URLPatternInput(std::get(WTF::move(input))); + return URLPattern::URLPatternInput(std::get(WTF::move(input))); } static std::optional convertToOptionalWTFVariant(std::optional>&& input) { if (!input) return std::nullopt; - return convertToWTFVariant(std::move(*input)); + return convertToWTFVariant(WTF::move(*input)); } // Functions @@ -144,11 +144,11 @@ static inline EncodedJSValue constructJSURLPattern1(JSGlobalObject* lexicalGloba EnsureStillAliveScope argument2 = callFrame->argument(2); auto options = convert>(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); - auto object = URLPattern::create(*context, convertToWTFVariant(WTFMove(input)), WTFMove(baseURL), WTFMove(options)); + auto object = URLPattern::create(*context, convertToWTFVariant(WTF::move(input)), WTF::move(baseURL), WTF::move(options)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -171,11 +171,11 @@ static inline EncodedJSValue constructJSURLPattern2(JSGlobalObject* lexicalGloba EnsureStillAliveScope argument1 = callFrame->argument(1); auto options = convert>(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); - auto object = URLPattern::create(*context, convertToOptionalWTFVariant(WTFMove(input)), WTFMove(options)); + auto object = URLPattern::create(*context, convertToOptionalWTFVariant(WTF::move(input)), WTF::move(options)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -258,7 +258,7 @@ void JSURLPatternPrototype::finishCreation(VM& vm) const ClassInfo JSURLPattern::s_info = { "URLPattern"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSURLPattern) }; JSURLPattern::JSURLPattern(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -428,7 +428,7 @@ static inline JSC::EncodedJSValue jsURLPatternPrototypeFunction_testBody(JSC::JS EnsureStillAliveScope argument1 = callFrame->argument(1); auto baseURL = argument1.value().isUndefined() ? String() : convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, impl.test(*context, convertToOptionalWTFVariant(WTFMove(input)), WTFMove(baseURL))))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, impl.test(*context, convertToOptionalWTFVariant(WTF::move(input)), WTF::move(baseURL))))); } JSC_DEFINE_HOST_FUNCTION(jsURLPatternPrototypeFunction_test, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -452,7 +452,7 @@ static inline JSC::EncodedJSValue jsURLPatternPrototypeFunction_execBody(JSC::JS EnsureStillAliveScope argument1 = callFrame->argument(1); auto baseURL = argument1.value().isUndefined() ? String() : convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, encodedJSValue()); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.exec(*context, convertToOptionalWTFVariant(WTFMove(input)), WTFMove(baseURL))))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, impl.exec(*context, convertToOptionalWTFVariant(WTF::move(input)), WTF::move(baseURL))))); } JSC_DEFINE_HOST_FUNCTION(jsURLPatternPrototypeFunction_exec, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -527,7 +527,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj #if ENABLE(BINDING_INTEGRITY) verifyVTable(impl.ptr()); #endif - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, URLPattern& impl) diff --git a/src/bun.js/bindings/webcore/JSURLPattern.h b/src/bun.js/bindings/webcore/JSURLPattern.h index 1f7b6b520e..6eb14ed88b 100644 --- a/src/bun.js/bindings/webcore/JSURLPattern.h +++ b/src/bun.js/bindings/webcore/JSURLPattern.h @@ -32,7 +32,7 @@ public: static JSURLPattern* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { SUPPRESS_UNCOUNTED_LOCAL auto& vm = globalObject->vm(); - JSURLPattern* ptr = new (NotNull, JSC::allocateCell(vm)) JSURLPattern(structure, *globalObject, WTFMove(impl)); + JSURLPattern* ptr = new (NotNull, JSC::allocateCell(vm)) JSURLPattern(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(vm); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSURLSearchParams.cpp b/src/bun.js/bindings/webcore/JSURLSearchParams.cpp index b1e296f95f..4afb51317b 100644 --- a/src/bun.js/bindings/webcore/JSURLSearchParams.cpp +++ b/src/bun.js/bindings/webcore/JSURLSearchParams.cpp @@ -125,11 +125,11 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSURLSearchParamsDOMCons EnsureStillAliveScope argument0 = callFrame->argument(0); auto init = argument0.value().isUndefined() ? emptyString() : convert>, IDLRecord, IDLUSVString>>(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - auto object = URLSearchParams::create(WTFMove(init)); + auto object = URLSearchParams::create(WTF::move(init)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -199,7 +199,7 @@ void JSURLSearchParamsPrototype::finishCreation(VM& vm) const ClassInfo JSURLSearchParams::s_info = { "URLSearchParams"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSURLSearchParams) }; JSURLSearchParams::JSURLSearchParams(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -259,7 +259,7 @@ static inline JSC::EncodedJSValue jsURLSearchParamsPrototypeFunction_appendBody( EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto value = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.append(WTFMove(name), WTFMove(value)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.append(WTF::move(name), WTF::move(value)); }))); } JSC_DEFINE_HOST_FUNCTION(jsURLSearchParamsPrototypeFunction_append, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -287,7 +287,7 @@ static inline JSC::EncodedJSValue jsURLSearchParamsPrototypeFunction_deleteBody( RETURN_IF_EXCEPTION(throwScope, {}); } - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.remove(WTFMove(name), WTFMove(value)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.remove(WTF::move(name), WTF::move(value)); }))); } JSC_DEFINE_HOST_FUNCTION(jsURLSearchParamsPrototypeFunction_delete, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -361,7 +361,7 @@ static inline JSC::EncodedJSValue jsURLSearchParamsPrototypeFunction_hasBody(JSC RETURN_IF_EXCEPTION(throwScope, {}); } - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, impl.has(name, WTFMove(value))))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, impl.has(name, WTF::move(value))))); } JSC_DEFINE_HOST_FUNCTION(jsURLSearchParamsPrototypeFunction_has, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -384,7 +384,7 @@ static inline JSC::EncodedJSValue jsURLSearchParamsPrototypeFunction_setBody(JSC EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto value = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.set(WTFMove(name), WTFMove(value)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.set(WTF::move(name), WTF::move(value)); }))); } JSC_DEFINE_HOST_FUNCTION(jsURLSearchParamsPrototypeFunction_set, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -687,7 +687,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); // #endif // } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, URLSearchParams& impl) diff --git a/src/bun.js/bindings/webcore/JSURLSearchParams.h b/src/bun.js/bindings/webcore/JSURLSearchParams.h index 4c4ba34145..14f0609778 100644 --- a/src/bun.js/bindings/webcore/JSURLSearchParams.h +++ b/src/bun.js/bindings/webcore/JSURLSearchParams.h @@ -31,7 +31,7 @@ public: using Base = JSDOMWrapper; static JSURLSearchParams* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSURLSearchParams* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSURLSearchParams(structure, *globalObject, WTFMove(impl)); + JSURLSearchParams* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSURLSearchParams(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSValueInWrappedObject.h b/src/bun.js/bindings/webcore/JSValueInWrappedObject.h index 12a41ab257..28cb4897b1 100644 --- a/src/bun.js/bindings/webcore/JSValueInWrappedObject.h +++ b/src/bun.js/bindings/webcore/JSValueInWrappedObject.h @@ -95,7 +95,7 @@ inline void JSValueInWrappedObject::setWeakly(JSC::JSValue value) m_nonCell = {}; JSC::Weak weak { value.asCell() }; WTF::storeStoreFence(); - m_cell = WTFMove(weak); + m_cell = WTF::move(weak); } inline void JSValueInWrappedObject::set(JSC::VM& vm, const JSC::JSCell* owner, JSC::JSValue value) diff --git a/src/bun.js/bindings/webcore/JSWasmStreamingCompiler.cpp b/src/bun.js/bindings/webcore/JSWasmStreamingCompiler.cpp index 3b327f5b61..af3baa8a19 100644 --- a/src/bun.js/bindings/webcore/JSWasmStreamingCompiler.cpp +++ b/src/bun.js/bindings/webcore/JSWasmStreamingCompiler.cpp @@ -82,7 +82,7 @@ void JSWasmStreamingCompilerPrototype::finishCreation(VM& vm) const ClassInfo JSWasmStreamingCompiler::s_info = { "WasmStreamingCompiler"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSWasmStreamingCompiler) }; JSWasmStreamingCompiler::JSWasmStreamingCompiler(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -220,7 +220,7 @@ void JSWasmStreamingCompilerOwner::finalize(JSC::Handle handle, vo JSValue toJSNewlyCreated(JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref&& impl) { - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSValue toJS(JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, Wasm::StreamingCompiler& impl) diff --git a/src/bun.js/bindings/webcore/JSWasmStreamingCompiler.h b/src/bun.js/bindings/webcore/JSWasmStreamingCompiler.h index 86bdc4db83..d40eb990ea 100644 --- a/src/bun.js/bindings/webcore/JSWasmStreamingCompiler.h +++ b/src/bun.js/bindings/webcore/JSWasmStreamingCompiler.h @@ -11,7 +11,7 @@ public: using Base = JSDOMWrapper; static JSWasmStreamingCompiler* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSWasmStreamingCompiler* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSWasmStreamingCompiler(structure, *globalObject, WTFMove(impl)); + JSWasmStreamingCompiler* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSWasmStreamingCompiler(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSWebSocket.cpp b/src/bun.js/bindings/webcore/JSWebSocket.cpp index c9475097f9..db678ebc7b 100644 --- a/src/bun.js/bindings/webcore/JSWebSocket.cpp +++ b/src/bun.js/bindings/webcore/JSWebSocket.cpp @@ -158,11 +158,11 @@ static inline JSC::EncodedJSValue constructJSWebSocket1(JSGlobalObject* lexicalG EnsureStillAliveScope argument1 = callFrame->argument(1); auto protocols = argument1.value().isUndefined() ? Converter>::ReturnType {} : convert>(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - auto object = WebSocket::create(*context, WTFMove(url), WTFMove(protocols)); + auto object = WebSocket::create(*context, WTF::move(url), WTF::move(protocols)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -185,11 +185,11 @@ static inline JSC::EncodedJSValue constructJSWebSocket2(JSGlobalObject* lexicalG EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto protocol = convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - auto object = WebSocket::create(*context, WTFMove(url), WTFMove(protocol)); + auto object = WebSocket::create(*context, WTF::move(url), WTF::move(protocol)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -258,12 +258,12 @@ static inline JSC::EncodedJSValue constructJSWebSocket3(JSGlobalObject* lexicalG } } - auto object = (rejectUnauthorized == -1) ? WebSocket::create(*context, WTFMove(url), protocols, WTFMove(headersInit)) : WebSocket::create(*context, WTFMove(url), protocols, WTFMove(headersInit), rejectUnauthorized ? true : false); + auto object = (rejectUnauthorized == -1) ? WebSocket::create(*context, WTF::move(url), protocols, WTF::move(headersInit)) : WebSocket::create(*context, WTF::move(url), protocols, WTF::move(headersInit), rejectUnauthorized ? true : false); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *globalObject, throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *globalObject, throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -356,7 +356,7 @@ void JSWebSocketPrototype::finishCreation(VM& vm) const ClassInfo JSWebSocket::s_info = { "WebSocket"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSWebSocket) }; JSWebSocket::JSWebSocket(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSEventTarget(structure, globalObject, WTFMove(impl)) + : JSEventTarget(structure, globalObject, WTF::move(impl)) { } @@ -596,7 +596,7 @@ static inline bool setJSWebSocket_binaryTypeSetter(JSGlobalObject& lexicalGlobal auto nativeValue = convert(lexicalGlobalObject, value); RETURN_IF_EXCEPTION(throwScope, false); invokeFunctorPropagatingExceptionIfNecessary(lexicalGlobalObject, throwScope, [&] { - return impl.setBinaryType(WTFMove(nativeValue)); + return impl.setBinaryType(WTF::move(nativeValue)); }); return true; } @@ -642,7 +642,7 @@ static inline JSC::EncodedJSValue jsWebSocketPrototypeFunction_send4Body(JSC::JS EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto data = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.send(WTFMove(data)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.send(WTF::move(data)); }))); } static inline JSC::EncodedJSValue jsWebSocketPrototypeFunction_sendOverloadDispatcher(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) @@ -687,7 +687,7 @@ static inline JSC::EncodedJSValue jsWebSocketPrototypeFunction_closeBody(JSC::JS EnsureStillAliveScope argument1 = callFrame->argument(1); auto reason = argument1.value().isUndefined() ? String() : convert(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.close(WTFMove(code), WTFMove(reason)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.close(WTF::move(code), WTF::move(reason)); }))); } JSC_DEFINE_HOST_FUNCTION(jsWebSocketPrototypeFunction_close, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -741,7 +741,7 @@ static inline JSC::EncodedJSValue jsWebSocketPrototypeFunction_ping5Body(JSC::JS EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto data = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.ping(WTFMove(data)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.ping(WTF::move(data)); }))); } static inline JSC::EncodedJSValue jsWebSocketPrototypeFunction_pingOverloadDispatcher(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) @@ -820,7 +820,7 @@ static inline JSC::EncodedJSValue jsWebSocketPrototypeFunction_pong5Body(JSC::JS EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto data = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.pong(WTFMove(data)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.pong(WTF::move(data)); }))); } static inline JSC::EncodedJSValue jsWebSocketPrototypeFunction_pongOverloadDispatcher(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) @@ -951,7 +951,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, WebSocket& impl) diff --git a/src/bun.js/bindings/webcore/JSWebSocket.h b/src/bun.js/bindings/webcore/JSWebSocket.h index 29f82e4eec..46f4a2ab1b 100644 --- a/src/bun.js/bindings/webcore/JSWebSocket.h +++ b/src/bun.js/bindings/webcore/JSWebSocket.h @@ -33,7 +33,7 @@ public: using DOMWrapped = WebSocket; static JSWebSocket* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSWebSocket* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSWebSocket(structure, *globalObject, WTFMove(impl)); + JSWebSocket* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSWebSocket(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSWorker.cpp b/src/bun.js/bindings/webcore/JSWorker.cpp index bf44513e49..ce2c877375 100644 --- a/src/bun.js/bindings/webcore/JSWorker.cpp +++ b/src/bun.js/bindings/webcore/JSWorker.cpp @@ -194,7 +194,7 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSWorkerDOMConstructor:: std::optional> seq = convert>(*lexicalGlobalObject, array); RETURN_IF_EXCEPTION(throwScope, {}); if (seq) { - options.preloadModules = WTFMove(*seq); + options.preloadModules = WTF::move(*seq); options.preloadModules.removeAllMatching([](const String& str) { return str.isEmpty(); }); @@ -265,7 +265,7 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSWorkerDOMConstructor:: env.add(key.impl()->isolatedCopy(), str); } - options.env.emplace(WTFMove(env)); + options.env.emplace(WTF::move(env)); } // needed to match the coercion behavior of `String(value)`, which returns a descriptive @@ -303,7 +303,7 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSWorkerDOMConstructor:: execArgv.append(str); }); RETURN_IF_EXCEPTION(throwScope, {}); - options.execArgv.emplace(WTFMove(execArgv)); + options.execArgv.emplace(WTF::move(execArgv)); } } @@ -315,7 +315,7 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSWorkerDOMConstructor:: // If node:worker_threads has not been imported, environment data will not be set up yet. valueToTransfer->putDirectIndex(globalObject, 1, environmentData ? environmentData : jsUndefined()); - ExceptionOr> serialized = SerializedScriptValue::create(*lexicalGlobalObject, valueToTransfer, WTFMove(transferList), ports, SerializationForStorage::No, SerializationContext::WorkerPostMessage); + ExceptionOr> serialized = SerializedScriptValue::create(*lexicalGlobalObject, valueToTransfer, WTF::move(transferList), ports, SerializationForStorage::No, SerializationContext::WorkerPostMessage); if (serialized.hasException()) { WebCore::propagateException(*lexicalGlobalObject, throwScope, serialized.releaseException()); RELEASE_AND_RETURN(throwScope, {}); @@ -324,7 +324,7 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSWorkerDOMConstructor:: Vector transferredPorts; if (!ports.isEmpty()) { - auto disentangleResult = MessagePort::disentanglePorts(WTFMove(ports)); + auto disentangleResult = MessagePort::disentanglePorts(WTF::move(ports)); if (disentangleResult.hasException()) { WebCore::propagateException(*lexicalGlobalObject, throwScope, disentangleResult.releaseException()); RELEASE_AND_RETURN(throwScope, {}); @@ -333,14 +333,14 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSWorkerDOMConstructor:: } options.workerDataAndEnvironmentData = serialized.releaseReturnValue(); - options.dataMessagePorts = WTFMove(transferredPorts); + options.dataMessagePorts = WTF::move(transferredPorts); RETURN_IF_EXCEPTION(throwScope, {}); - auto object = Worker::create(*context, WTFMove(scriptUrl), WTFMove(options)); + auto object = Worker::create(*context, WTF::move(scriptUrl), WTF::move(options)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); @@ -425,7 +425,7 @@ void JSWorkerPrototype::finishCreation(VM& vm) const ClassInfo JSWorker::s_info = { "Worker"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSWorker) }; JSWorker::JSWorker(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSEventTarget(structure, globalObject, WTFMove(impl)) + : JSEventTarget(structure, globalObject, WTF::move(impl)) { } @@ -567,7 +567,7 @@ static inline JSC::EncodedJSValue jsWorkerPrototypeFunction_postMessage1Body(JSC EnsureStillAliveScope argument1 = callFrame->uncheckedArgument(1); auto transfer = convert>(*lexicalGlobalObject, argument1.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.postMessage(*jsCast(lexicalGlobalObject), WTFMove(message), WTFMove(transfer)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.postMessage(*jsCast(lexicalGlobalObject), WTF::move(message), WTF::move(transfer)); }))); } static inline JSC::EncodedJSValue jsWorkerPrototypeFunction_postMessage2Body(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) @@ -590,12 +590,12 @@ static inline JSC::EncodedJSValue jsWorkerPrototypeFunction_postMessage2Body(JSC if (transferListValue) { auto transferList = convert>(*lexicalGlobalObject, transferListValue); RETURN_IF_EXCEPTION(throwScope, {}); - options.transfer = WTFMove(transferList); + options.transfer = WTF::move(transferList); } } RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.postMessage(*jsCast(lexicalGlobalObject), WTFMove(message), WTFMove(options)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.postMessage(*jsCast(lexicalGlobalObject), WTF::move(message), WTF::move(options)); }))); } static inline JSC::EncodedJSValue jsWorkerPrototypeFunction_postMessageOverloadDispatcher(JSC::JSGlobalObject* lexicalGlobalObject, JSC::CallFrame* callFrame, typename IDLOperation::ClassParameter castedThis) @@ -782,7 +782,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, Worker& impl) diff --git a/src/bun.js/bindings/webcore/JSWorker.h b/src/bun.js/bindings/webcore/JSWorker.h index 736d7ac5fe..2aae0754cc 100644 --- a/src/bun.js/bindings/webcore/JSWorker.h +++ b/src/bun.js/bindings/webcore/JSWorker.h @@ -33,7 +33,7 @@ public: using DOMWrapped = Worker; static JSWorker* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSWorker* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSWorker(structure, *globalObject, WTFMove(impl)); + JSWorker* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSWorker(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSWritableStream.cpp b/src/bun.js/bindings/webcore/JSWritableStream.cpp index 2a3d29a291..8a773654de 100644 --- a/src/bun.js/bindings/webcore/JSWritableStream.cpp +++ b/src/bun.js/bindings/webcore/JSWritableStream.cpp @@ -107,11 +107,11 @@ template<> JSC::EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSWritableStreamDOMConst EnsureStillAliveScope argument1 = callFrame->argument(1); auto strategy = argument1.value().isUndefined() ? std::optional::ReturnType>() : std::optional::ReturnType>(convert(*lexicalGlobalObject, argument1.value())); RETURN_IF_EXCEPTION(throwScope, {}); - auto object = WritableStream::create(*castedThis->globalObject(), WTFMove(underlyingSink), WTFMove(strategy)); + auto object = WritableStream::create(*castedThis->globalObject(), WTF::move(underlyingSink), WTF::move(strategy)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); static_assert(TypeOrExceptionOrUnderlyingType::isRef); - auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTFMove(object)); + auto jsValue = toJSNewlyCreated>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, WTF::move(object)); if constexpr (IsExceptionOr) RETURN_IF_EXCEPTION(throwScope, {}); setSubclassStructureIfNeeded(lexicalGlobalObject, callFrame, asObject(jsValue)); @@ -159,7 +159,7 @@ void JSWritableStreamPrototype::finishCreation(VM& vm) const ClassInfo JSWritableStream::s_info = { "WritableStream"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSWritableStream) }; JSWritableStream::JSWritableStream(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -295,7 +295,7 @@ void JSWritableStreamOwner::finalize(JSC::Handle handle, void* con JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref&& impl) { - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, WritableStream& impl) diff --git a/src/bun.js/bindings/webcore/JSWritableStream.h b/src/bun.js/bindings/webcore/JSWritableStream.h index dd5cbc885f..424e6a16d6 100644 --- a/src/bun.js/bindings/webcore/JSWritableStream.h +++ b/src/bun.js/bindings/webcore/JSWritableStream.h @@ -31,7 +31,7 @@ public: using Base = JSDOMWrapper; static JSWritableStream* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSWritableStream* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSWritableStream(structure, *globalObject, WTFMove(impl)); + JSWritableStream* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSWritableStream(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/JSWritableStreamSink.cpp b/src/bun.js/bindings/webcore/JSWritableStreamSink.cpp index 225e0ff17b..512235aa3e 100644 --- a/src/bun.js/bindings/webcore/JSWritableStreamSink.cpp +++ b/src/bun.js/bindings/webcore/JSWritableStreamSink.cpp @@ -108,7 +108,7 @@ void JSWritableStreamSinkPrototype::finishCreation(VM& vm) const ClassInfo JSWritableStreamSink::s_info = { "WritableStreamSink"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSWritableStreamSink) }; JSWritableStreamSink::JSWritableStreamSink(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -153,7 +153,7 @@ static inline JSC::EncodedJSValue jsWritableStreamSinkPrototypeFunction_writeBod EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto value = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.write(*context, WTFMove(value), WTFMove(promise)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.write(*context, WTF::move(value), WTF::move(promise)); }))); } JSC_DEFINE_HOST_FUNCTION(jsWritableStreamSinkPrototypeFunction_write, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -188,7 +188,7 @@ static inline JSC::EncodedJSValue jsWritableStreamSinkPrototypeFunction_errorBod EnsureStillAliveScope argument0 = callFrame->uncheckedArgument(0); auto message = convert(*lexicalGlobalObject, argument0.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.error(WTFMove(message)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS(*lexicalGlobalObject, throwScope, [&]() -> decltype(auto) { return impl.error(WTF::move(message)); }))); } JSC_DEFINE_HOST_FUNCTION(jsWritableStreamSinkPrototypeFunction_error, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -232,7 +232,7 @@ void JSWritableStreamSinkOwner::finalize(JSC::Handle handle, void* JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref&& impl) { - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, WritableStreamSink& impl) diff --git a/src/bun.js/bindings/webcore/JSWritableStreamSink.h b/src/bun.js/bindings/webcore/JSWritableStreamSink.h index a6cac9d237..ec98d4f23e 100644 --- a/src/bun.js/bindings/webcore/JSWritableStreamSink.h +++ b/src/bun.js/bindings/webcore/JSWritableStreamSink.h @@ -31,7 +31,7 @@ public: using Base = JSDOMWrapper; static JSWritableStreamSink* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSWritableStreamSink* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSWritableStreamSink(structure, *globalObject, WTFMove(impl)); + JSWritableStreamSink* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSWritableStreamSink(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcore/MessageEvent.cpp b/src/bun.js/bindings/webcore/MessageEvent.cpp index a050adfe02..113a7eb210 100644 --- a/src/bun.js/bindings/webcore/MessageEvent.cpp +++ b/src/bun.js/bindings/webcore/MessageEvent.cpp @@ -49,30 +49,30 @@ inline MessageEvent::MessageEvent(const AtomString& type, Init&& initializer, Is , m_data(JSValueTag {}) , m_origin(initializer.origin) , m_lastEventId(initializer.lastEventId) - , m_source(WTFMove(initializer.source)) - , m_ports(WTFMove(initializer.ports)) + , m_source(WTF::move(initializer.source)) + , m_ports(WTF::move(initializer.ports)) , m_jsData(initializer.data) { } inline MessageEvent::MessageEvent(const AtomString& type, DataType&& data, const String& origin, const String& lastEventId, RefPtr&& source, Vector>&& ports) : Event(type, CanBubble::No, IsCancelable::No) - , m_data(WTFMove(data)) + , m_data(WTF::move(data)) , m_origin(origin) , m_lastEventId(lastEventId) - , m_source(WTFMove(source)) - , m_ports(WTFMove(ports)) + , m_source(WTF::move(source)) + , m_ports(WTF::move(ports)) { } Ref MessageEvent::create(const AtomString& type, DataType&& data, const String& origin, const String& lastEventId, RefPtr&& source, Vector>&& ports) { - return adoptRef(*new MessageEvent(type, WTFMove(data), origin, lastEventId, WTFMove(source), WTFMove(ports))); + return adoptRef(*new MessageEvent(type, WTF::move(data), origin, lastEventId, WTF::move(source), WTF::move(ports))); } Ref MessageEvent::create(DataType&& data, const String& origin, const String& lastEventId, RefPtr&& source, Vector>&& ports) { - return create(eventNames().messageEvent, WTFMove(data), origin, lastEventId, WTFMove(source), WTFMove(ports)); + return create(eventNames().messageEvent, WTF::move(data), origin, lastEventId, WTF::move(source), WTF::move(ports)); } Ref MessageEvent::createForBindings() @@ -82,14 +82,14 @@ Ref MessageEvent::createForBindings() Ref MessageEvent::create(const AtomString& type, Init&& initializer, IsTrusted isTrusted) { - return adoptRef(*new MessageEvent(type, WTFMove(initializer), isTrusted)); + return adoptRef(*new MessageEvent(type, WTF::move(initializer), isTrusted)); } MessageEvent::~MessageEvent() = default; auto MessageEvent::create(JSC::JSGlobalObject& globalObject, Ref&& data, RefPtr&& source, Vector>&& ports) -> MessageEventWithStrongData { - return create(globalObject, WTFMove(data), {}, {}, WTFMove(source), WTFMove(ports)); + return create(globalObject, WTF::move(data), {}, {}, WTF::move(source), WTF::move(ports)); } auto MessageEvent::create(JSC::JSGlobalObject& globalObject, Ref&& data, const String& origin, const String& lastEventId, RefPtr&& source, Vector>&& ports) -> MessageEventWithStrongData @@ -107,13 +107,13 @@ auto MessageEvent::create(JSC::JSGlobalObject& globalObject, Ref strongData(vm, deserialized); auto& eventType = didFail ? eventNames().messageerrorEvent : eventNames().messageEvent; - auto event = adoptRef(*new MessageEvent(eventType, WTFMove(data), origin, lastEventId, WTFMove(source), WTFMove(ports))); + auto event = adoptRef(*new MessageEvent(eventType, WTF::move(data), origin, lastEventId, WTF::move(source), WTF::move(ports))); JSC::Strong strongWrapper(vm, JSC::jsCast(toJS(&globalObject, JSC::jsCast(&globalObject), event.get()))); // Since we've already deserialized the SerializedScriptValue, cache the result so we don't have to deserialize // again the next time JSMessageEvent::data() gets called by the main world. event->cachedData().set(vm, strongWrapper.get(), deserialized); - return MessageEventWithStrongData { event, WTFMove(strongWrapper) }; + return MessageEventWithStrongData { event, WTF::move(strongWrapper) }; } void MessageEvent::initMessageEvent(const AtomString& type, bool canBubble, bool cancelable, JSValue data, const String& origin, const String& lastEventId, RefPtr&& source, Vector>&& ports) @@ -133,8 +133,8 @@ void MessageEvent::initMessageEvent(const AtomString& type, bool canBubble, bool m_cachedData.clear(); m_origin = origin; m_lastEventId = lastEventId; - m_source = WTFMove(source); - m_ports = WTFMove(ports); + m_source = WTF::move(source); + m_ports = WTF::move(ports); m_cachedPorts.clear(); } diff --git a/src/bun.js/bindings/webcore/MessagePort.cpp b/src/bun.js/bindings/webcore/MessagePort.cpp index a99084d387..8cdca2d979 100644 --- a/src/bun.js/bindings/webcore/MessagePort.cpp +++ b/src/bun.js/bindings/webcore/MessagePort.cpp @@ -95,7 +95,7 @@ void MessagePort::notifyMessageAvailable(const MessagePortIdentifier& identifier if (!scriptExecutionContextIdentifier) return; - ScriptExecutionContext::ensureOnContextThread(*scriptExecutionContextIdentifier, [weakPort = WTFMove(weakPort)](auto&) { + ScriptExecutionContext::ensureOnContextThread(*scriptExecutionContextIdentifier, [weakPort = WTF::move(weakPort)](auto&) { if (RefPtr port = weakPort.get()) port->messageAvailable(); }); @@ -159,7 +159,7 @@ ExceptionOr MessagePort::postMessage(JSC::JSGlobalObject& state, JSC::JSVa // LOG(MessagePorts, "Attempting to post message to port %s (to be received by port %s)", m_identifier.logString().utf8().data(), m_remoteIdentifier.logString().utf8().data()); Vector> ports; - auto messageData = SerializedScriptValue::create(state, messageValue, WTFMove(options.transfer), ports, SerializationForStorage::No, SerializationContext::WorkerPostMessage); + auto messageData = SerializedScriptValue::create(state, messageValue, WTF::move(options.transfer), ports, SerializationForStorage::No, SerializationContext::WorkerPostMessage); if (messageData.hasException()) return messageData.releaseException(); @@ -175,15 +175,15 @@ ExceptionOr MessagePort::postMessage(JSC::JSGlobalObject& state, JSC::JSVa return Exception { ExceptionCode::DataCloneError }; } - auto disentangleResult = MessagePort::disentanglePorts(WTFMove(ports)); + auto disentangleResult = MessagePort::disentanglePorts(WTF::move(ports)); if (disentangleResult.hasException()) return disentangleResult.releaseException(); transferredPorts = disentangleResult.releaseReturnValue(); } - MessageWithMessagePorts message { messageData.releaseReturnValue(), WTFMove(transferredPorts) }; + MessageWithMessagePorts message { messageData.releaseReturnValue(), WTF::move(transferredPorts) }; - MessagePortChannelProvider::fromContext(*protectedScriptExecutionContext()).postMessageToRemote(WTFMove(message), m_remoteIdentifier); + MessagePortChannelProvider::fromContext(*protectedScriptExecutionContext()).postMessageToRemote(WTF::move(message), m_remoteIdentifier); return {}; } @@ -254,7 +254,7 @@ void MessagePort::dispatchMessages() return; auto messagesTakenHandler = [this, protectedThis = Ref { *this }](Vector&& messages, CompletionHandler&& completionCallback) mutable { - auto scopeExit = makeScopeExit(WTFMove(completionCallback)); + auto scopeExit = makeScopeExit(WTF::move(completionCallback)); // LOG(MessagePorts, "MessagePort %s (%p) dispatching %zu messages", m_identifier.logString().utf8().data(), this, messages.size()); @@ -272,7 +272,7 @@ void MessagePort::dispatchMessages() if (Zig::GlobalObject::scriptExecutionStatus(globalObject, globalObject) != ScriptExecutionStatus::Running) return; - auto ports = MessagePort::entanglePorts(*context, WTFMove(message.transferredPorts)); + auto ports = MessagePort::entanglePorts(*context, WTF::move(message.transferredPorts)); if (scope.exception()) [[unlikely]] { // Currently, we assume that the only way we can get here is if we have a termination. RELEASE_ASSERT(vm->hasPendingTerminationException()); @@ -280,18 +280,18 @@ void MessagePort::dispatchMessages() } // Per specification, each MessagePort object has a task source called the port message queue. - // queueTaskKeepingObjectAlive(context, *this, TaskSource::PostedMessageQueue, [this, event = WTFMove(event)] { + // queueTaskKeepingObjectAlive(context, *this, TaskSource::PostedMessageQueue, [this, event = WTF::move(event)] { // dispatchEvent(event.event); // }); - ScriptExecutionContext::postTaskTo(context->identifier(), [protectedThis = Ref { *this }, ports = WTFMove(ports), message = WTFMove(message)](ScriptExecutionContext& context) mutable { - auto event = MessageEvent::create(*context.jsGlobalObject(), message.message.releaseNonNull(), {}, {}, {}, WTFMove(ports)); + ScriptExecutionContext::postTaskTo(context->identifier(), [protectedThis = Ref { *this }, ports = WTF::move(ports), message = WTF::move(message)](ScriptExecutionContext& context) mutable { + auto event = MessageEvent::create(*context.jsGlobalObject(), message.message.releaseNonNull(), {}, {}, {}, WTF::move(ports)); protectedThis->dispatchEvent(event.event); }); } }; - MessagePortChannelProvider::fromContext(*context).takeAllMessagesForPort(m_identifier, WTFMove(messagesTakenHandler)); + MessagePortChannelProvider::fromContext(*context).takeAllMessagesForPort(m_identifier, WTF::move(messagesTakenHandler)); } JSValue MessagePort::tryTakeMessage(JSGlobalObject* lexicalGlobalObject) @@ -305,9 +305,9 @@ JSValue MessagePort::tryTakeMessage(JSGlobalObject* lexicalGlobalObject) if (!messageWithPorts) return jsUndefined(); - auto ports = MessagePort::entanglePorts(*context, WTFMove(messageWithPorts->transferredPorts)); + auto ports = MessagePort::entanglePorts(*context, WTF::move(messageWithPorts->transferredPorts)); auto message = messageWithPorts->message.releaseNonNull(); - return message->deserialize(*lexicalGlobalObject, lexicalGlobalObject, WTFMove(ports), SerializationErrorMode::NonThrowing); + return message->deserialize(*lexicalGlobalObject, lexicalGlobalObject, WTF::move(ports), SerializationErrorMode::NonThrowing); } void MessagePort::dispatchEvent(Event& event) @@ -371,7 +371,7 @@ Vector> MessagePort::entanglePorts(ScriptExecutionContext& c return {}; return WTF::map(transferredPorts, [&](auto& port) -> RefPtr { - return MessagePort::entangle(context, WTFMove(port)); + return MessagePort::entangle(context, WTF::move(port)); }); } @@ -430,7 +430,7 @@ bool MessagePort::addEventListener(const AtomString& eventType, Ref MessagePortChannel::tryTakeMessageForPort auto message = m_pendingMessages[i].first(); m_pendingMessages[i].removeAt(0); - return WTFMove(message); + return WTF::move(message); } } // namespace WebCore diff --git a/src/bun.js/bindings/webcore/MessagePortChannelProviderImpl.cpp b/src/bun.js/bindings/webcore/MessagePortChannelProviderImpl.cpp index 62b9818bbb..4524c4fe1e 100644 --- a/src/bun.js/bindings/webcore/MessagePortChannelProviderImpl.cpp +++ b/src/bun.js/bindings/webcore/MessagePortChannelProviderImpl.cpp @@ -61,19 +61,19 @@ void MessagePortChannelProviderImpl::messagePortClosed(const MessagePortIdentifi void MessagePortChannelProviderImpl::postMessageToRemote(MessageWithMessagePorts&& message, const MessagePortIdentifier& remoteTarget) { - if (m_registry.didPostMessageToRemote(WTFMove(message), remoteTarget)) + if (m_registry.didPostMessageToRemote(WTF::move(message), remoteTarget)) MessagePort::notifyMessageAvailable(remoteTarget); } void MessagePortChannelProviderImpl::takeAllMessagesForPort(const MessagePortIdentifier& port, CompletionHandler&&, CompletionHandler&&)>&& outerCallback) { // It is the responsibility of outerCallback to get itself to the appropriate thread (e.g. WebWorker thread) - auto callback = [outerCallback = WTFMove(outerCallback)](Vector&& messages, CompletionHandler&& messageDeliveryCallback) mutable { + auto callback = [outerCallback = WTF::move(outerCallback)](Vector&& messages, CompletionHandler&& messageDeliveryCallback) mutable { // ASSERT(isMainThread()); - outerCallback(WTFMove(messages), WTFMove(messageDeliveryCallback)); + outerCallback(WTF::move(messages), WTF::move(messageDeliveryCallback)); }; - m_registry.takeAllMessagesForPort(port, WTFMove(callback)); + m_registry.takeAllMessagesForPort(port, WTF::move(callback)); } std::optional MessagePortChannelProviderImpl::tryTakeMessageForPort(const MessagePortIdentifier& port) diff --git a/src/bun.js/bindings/webcore/MessagePortChannelRegistry.cpp b/src/bun.js/bindings/webcore/MessagePortChannelRegistry.cpp index 55f61f75c3..66ed5997cf 100644 --- a/src/bun.js/bindings/webcore/MessagePortChannelRegistry.cpp +++ b/src/bun.js/bindings/webcore/MessagePortChannelRegistry.cpp @@ -135,7 +135,7 @@ bool MessagePortChannelRegistry::didPostMessageToRemote(MessageWithMessagePorts& return false; } - return channel->postMessageToRemote(WTFMove(message), remoteTarget); + return channel->postMessageToRemote(WTF::move(message), remoteTarget); } void MessagePortChannelRegistry::takeAllMessagesForPort(const MessagePortIdentifier& port, CompletionHandler&&, CompletionHandler&&)>&& callback) @@ -149,7 +149,7 @@ void MessagePortChannelRegistry::takeAllMessagesForPort(const MessagePortIdentif return; } - channel->takeAllMessagesForPort(port, WTFMove(callback)); + channel->takeAllMessagesForPort(port, WTF::move(callback)); } std::optional MessagePortChannelRegistry::tryTakeMessageForPort(const MessagePortIdentifier& port) diff --git a/src/bun.js/bindings/webcore/NetworkLoadMetrics.cpp b/src/bun.js/bindings/webcore/NetworkLoadMetrics.cpp index 5eab2ae951..c34988b5ce 100644 --- a/src/bun.js/bindings/webcore/NetworkLoadMetrics.cpp +++ b/src/bun.js/bindings/webcore/NetworkLoadMetrics.cpp @@ -33,15 +33,15 @@ namespace WebCore { NetworkLoadMetrics::NetworkLoadMetrics() = default; NetworkLoadMetrics::NetworkLoadMetrics(MonotonicTime&& redirectStart, MonotonicTime&& fetchStart, MonotonicTime&& domainLookupStart, MonotonicTime&& domainLookupEnd, MonotonicTime&& connectStart, MonotonicTime&& secureConnectionStart, MonotonicTime&& connectEnd, MonotonicTime&& requestStart, MonotonicTime&& responseStart, MonotonicTime&& responseEnd, MonotonicTime&& workerStart, String&& protocol, uint16_t redirectCount, bool complete, bool cellular, bool expensive, bool constrained, bool multipath, bool isReusedConnection, bool failsTAOCheck, bool hasCrossOriginRedirect, PrivacyStance privacyStance, uint64_t responseBodyBytesReceived, uint64_t responseBodyDecodedSize, RefPtr&& additionalNetworkLoadMetricsForWebInspector) - : redirectStart(WTFMove(redirectStart)) - , fetchStart(WTFMove(fetchStart)) - , domainLookupStart(WTFMove(domainLookupStart)) - , domainLookupEnd(WTFMove(domainLookupEnd)) - , connectStart(WTFMove(connectStart)) - , secureConnectionStart(WTFMove(secureConnectionStart)) - , connectEnd(WTFMove(connectEnd)) - , requestStart(WTFMove(requestStart)) - , responseStart(WTFMove(responseStart)) + : redirectStart(WTF::move(redirectStart)) + , fetchStart(WTF::move(fetchStart)) + , domainLookupStart(WTF::move(domainLookupStart)) + , domainLookupEnd(WTF::move(domainLookupEnd)) + , connectStart(WTF::move(connectStart)) + , secureConnectionStart(WTF::move(secureConnectionStart)) + , connectEnd(WTF::move(connectEnd)) + , requestStart(WTF::move(requestStart)) + , responseStart(WTF::move(responseStart)) , responseEnd(responseEnd) , workerStart(workerStart) , protocol(protocol) @@ -57,7 +57,7 @@ NetworkLoadMetrics::NetworkLoadMetrics(MonotonicTime&& redirectStart, MonotonicT , privacyStance(privacyStance) , responseBodyBytesReceived(responseBodyBytesReceived) , responseBodyDecodedSize(responseBodyDecodedSize) - , additionalNetworkLoadMetricsForWebInspector(WTFMove(additionalNetworkLoadMetricsForWebInspector)) + , additionalNetworkLoadMetricsForWebInspector(WTF::move(additionalNetworkLoadMetricsForWebInspector)) { } @@ -169,16 +169,16 @@ NetworkLoadMetrics NetworkLoadMetrics::isolatedCopy() const Ref AdditionalNetworkLoadMetricsForWebInspector::create(NetworkLoadPriority&& priority, String&& remoteAddress, String&& connectionIdentifier, String&& tlsProtocol, String&& tlsCipher, HTTPHeaderMap&& requestHeaders, uint64_t requestHeaderBytesSent, uint64_t responseHeaderBytesReceived, uint64_t requestBodyBytesSent, bool isProxyConnection) { - return adoptRef(*new AdditionalNetworkLoadMetricsForWebInspector(WTFMove(priority), WTFMove(remoteAddress), WTFMove(connectionIdentifier), WTFMove(tlsProtocol), WTFMove(tlsCipher), WTFMove(requestHeaders), requestHeaderBytesSent, responseHeaderBytesReceived, requestBodyBytesSent, isProxyConnection)); + return adoptRef(*new AdditionalNetworkLoadMetricsForWebInspector(WTF::move(priority), WTF::move(remoteAddress), WTF::move(connectionIdentifier), WTF::move(tlsProtocol), WTF::move(tlsCipher), WTF::move(requestHeaders), requestHeaderBytesSent, responseHeaderBytesReceived, requestBodyBytesSent, isProxyConnection)); } AdditionalNetworkLoadMetricsForWebInspector::AdditionalNetworkLoadMetricsForWebInspector(NetworkLoadPriority&& priority, String&& remoteAddress, String&& connectionIdentifier, String&& tlsProtocol, String&& tlsCipher, HTTPHeaderMap&& requestHeaders, uint64_t requestHeaderBytesSent, uint64_t responseHeaderBytesReceived, uint64_t requestBodyBytesSent, bool isProxyConnection) - : priority(WTFMove(priority)) - , remoteAddress(WTFMove(remoteAddress)) - , connectionIdentifier(WTFMove(connectionIdentifier)) - , tlsProtocol(WTFMove(tlsProtocol)) - , tlsCipher(WTFMove(tlsCipher)) - , requestHeaders(WTFMove(requestHeaders)) + : priority(WTF::move(priority)) + , remoteAddress(WTF::move(remoteAddress)) + , connectionIdentifier(WTF::move(connectionIdentifier)) + , tlsProtocol(WTF::move(tlsProtocol)) + , tlsCipher(WTF::move(tlsCipher)) + , requestHeaders(WTF::move(requestHeaders)) , requestHeaderBytesSent(requestHeaderBytesSent) , responseHeaderBytesReceived(responseHeaderBytesReceived) , requestBodyBytesSent(requestBodyBytesSent) diff --git a/src/bun.js/bindings/webcore/Performance.cpp b/src/bun.js/bindings/webcore/Performance.cpp index 5d3a885db2..f525008217 100644 --- a/src/bun.js/bindings/webcore/Performance.cpp +++ b/src/bun.js/bindings/webcore/Performance.cpp @@ -288,10 +288,10 @@ void Performance::addResourceTiming(ResourceTiming&& resourceTiming) { ASSERT(scriptExecutionContext()); - auto entry = PerformanceResourceTiming::create(m_timeOrigin, WTFMove(resourceTiming)); + auto entry = PerformanceResourceTiming::create(m_timeOrigin, WTF::move(resourceTiming)); if (m_waitingForBackupBufferToBeProcessed) { - m_backupResourceTimingBuffer.append(WTFMove(entry)); + m_backupResourceTimingBuffer.append(WTF::move(entry)); return; } @@ -304,14 +304,14 @@ void Performance::addResourceTiming(ResourceTiming&& resourceTiming) if (isResourceTimingBufferFull()) { // ASSERT(!m_resourceTimingBufferFullTimer.isActive()); - m_backupResourceTimingBuffer.append(WTFMove(entry)); + m_backupResourceTimingBuffer.append(WTF::move(entry)); m_waitingForBackupBufferToBeProcessed = true; // m_resourceTimingBufferFullTimer.startOneShot(0_s); return; } queueEntry(entry.get()); - m_resourceTimingBuffer.append(WTFMove(entry)); + m_resourceTimingBuffer.append(WTF::move(entry)); } bool Performance::isResourceTimingBufferFull() const @@ -326,7 +326,7 @@ bool Performance::isResourceTimingBufferFull() const // while (!m_backupResourceTimingBuffer.isEmpty()) { // auto beforeCount = m_backupResourceTimingBuffer.size(); -// auto backupBuffer = WTFMove(m_backupResourceTimingBuffer); +// auto backupBuffer = WTF::move(m_backupResourceTimingBuffer); // ASSERT(m_backupResourceTimingBuffer.isEmpty()); // if (isResourceTimingBufferFull()) { @@ -371,7 +371,7 @@ ExceptionOr> Performance::mark(JSC::JSGlobalObject& globalO if (!m_userTiming) m_userTiming = makeUnique(*this); - auto mark = m_userTiming->mark(globalObject, markName, WTFMove(markOptions)); + auto mark = m_userTiming->mark(globalObject, markName, WTF::move(markOptions)); if (mark.hasException()) return mark.releaseException(); @@ -391,7 +391,7 @@ ExceptionOr> Performance::measure(JSC::JSGlobalObject& g if (!m_userTiming) m_userTiming = makeUnique(*this); - auto measure = m_userTiming->measure(globalObject, measureName, WTFMove(startOrMeasureOptions), endMark); + auto measure = m_userTiming->measure(globalObject, measureName, WTF::move(startOrMeasureOptions), endMark); if (measure.hasException()) return measure.releaseException(); diff --git a/src/bun.js/bindings/webcore/PerformanceMark.cpp b/src/bun.js/bindings/webcore/PerformanceMark.cpp index c61bd847a6..d6530ed809 100644 --- a/src/bun.js/bindings/webcore/PerformanceMark.cpp +++ b/src/bun.js/bindings/webcore/PerformanceMark.cpp @@ -79,7 +79,7 @@ ExceptionOr> PerformanceMark::create(JSC::JSGlobalObject& g PerformanceMark::PerformanceMark(const String& name, double startTime, RefPtr&& serializedDetail) : PerformanceEntry(name, startTime, startTime) - , m_serializedDetail(WTFMove(serializedDetail)) + , m_serializedDetail(WTF::move(serializedDetail)) { } diff --git a/src/bun.js/bindings/webcore/PerformanceMeasure.cpp b/src/bun.js/bindings/webcore/PerformanceMeasure.cpp index 358257de43..9f8fc2e421 100644 --- a/src/bun.js/bindings/webcore/PerformanceMeasure.cpp +++ b/src/bun.js/bindings/webcore/PerformanceMeasure.cpp @@ -41,12 +41,12 @@ size_t PerformanceMeasure::memoryCost() const ExceptionOr> PerformanceMeasure::create(const String& name, double startTime, double endTime, RefPtr&& serializedDetail) { - return adoptRef(*new PerformanceMeasure(name, startTime, endTime, WTFMove(serializedDetail))); + return adoptRef(*new PerformanceMeasure(name, startTime, endTime, WTF::move(serializedDetail))); } PerformanceMeasure::PerformanceMeasure(const String& name, double startTime, double endTime, RefPtr&& serializedDetail) : PerformanceEntry(name, startTime, endTime) - , m_serializedDetail(WTFMove(serializedDetail)) + , m_serializedDetail(WTF::move(serializedDetail)) { } diff --git a/src/bun.js/bindings/webcore/PerformanceObserver.cpp b/src/bun.js/bindings/webcore/PerformanceObserver.cpp index 5efb33e00b..73b2c3e21c 100644 --- a/src/bun.js/bindings/webcore/PerformanceObserver.cpp +++ b/src/bun.js/bindings/webcore/PerformanceObserver.cpp @@ -36,7 +36,7 @@ namespace WebCore { PerformanceObserver::PerformanceObserver(ScriptExecutionContext& scriptExecutionContext, Ref&& callback) - : m_callback(WTFMove(callback)) + : m_callback(WTF::move(callback)) { // if (is(scriptExecutionContext)) { // auto& document = downcast(scriptExecutionContext); @@ -138,7 +138,7 @@ void PerformanceObserver::deliver() return; Vector> entries = std::exchange(m_entriesToDeliver, {}); - auto list = PerformanceObserverEntryList::create(WTFMove(entries)); + auto list = PerformanceObserverEntryList::create(WTF::move(entries)); // InspectorInstrumentation::willFireObserverCallback(*context, "PerformanceObserver"_s); m_callback->handleEvent(*this, list, *this); diff --git a/src/bun.js/bindings/webcore/PerformanceObserver.h b/src/bun.js/bindings/webcore/PerformanceObserver.h index 095d8a5ba9..1049dce4de 100644 --- a/src/bun.js/bindings/webcore/PerformanceObserver.h +++ b/src/bun.js/bindings/webcore/PerformanceObserver.h @@ -48,7 +48,7 @@ public: static Ref create(ScriptExecutionContext& context, Ref&& callback) { - return adoptRef(*new PerformanceObserver(context, WTFMove(callback))); + return adoptRef(*new PerformanceObserver(context, WTF::move(callback))); } static Vector supportedEntryTypes(ScriptExecutionContext&); diff --git a/src/bun.js/bindings/webcore/PerformanceObserverEntryList.cpp b/src/bun.js/bindings/webcore/PerformanceObserverEntryList.cpp index a9bd8f8ccd..e921ca7d18 100644 --- a/src/bun.js/bindings/webcore/PerformanceObserverEntryList.cpp +++ b/src/bun.js/bindings/webcore/PerformanceObserverEntryList.cpp @@ -32,11 +32,11 @@ namespace WebCore { Ref PerformanceObserverEntryList::create(Vector>&& entries) { - return adoptRef(*new PerformanceObserverEntryList(WTFMove(entries))); + return adoptRef(*new PerformanceObserverEntryList(WTF::move(entries))); } PerformanceObserverEntryList::PerformanceObserverEntryList(Vector>&& entries) - : m_entries(WTFMove(entries)) + : m_entries(WTF::move(entries)) { ASSERT(!m_entries.isEmpty()); diff --git a/src/bun.js/bindings/webcore/PerformanceResourceTiming.cpp b/src/bun.js/bindings/webcore/PerformanceResourceTiming.cpp index ecbe7b114b..582e3c018f 100644 --- a/src/bun.js/bindings/webcore/PerformanceResourceTiming.cpp +++ b/src/bun.js/bindings/webcore/PerformanceResourceTiming.cpp @@ -91,13 +91,13 @@ static double entryEndTime(MonotonicTime timeOrigin, const ResourceTiming& resou Ref PerformanceResourceTiming::create(MonotonicTime timeOrigin, ResourceTiming&& resourceTiming) { - return adoptRef(*new PerformanceResourceTiming(timeOrigin, WTFMove(resourceTiming))); + return adoptRef(*new PerformanceResourceTiming(timeOrigin, WTF::move(resourceTiming))); } PerformanceResourceTiming::PerformanceResourceTiming(MonotonicTime timeOrigin, ResourceTiming&& resourceTiming) : PerformanceEntry(resourceTiming.url().string(), entryStartTime(timeOrigin, resourceTiming), entryEndTime(timeOrigin, resourceTiming)) , m_timeOrigin(timeOrigin) - , m_resourceTiming(WTFMove(resourceTiming)) + , m_resourceTiming(WTF::move(resourceTiming)) , m_serverTiming(m_resourceTiming.populateServerTiming()) { } diff --git a/src/bun.js/bindings/webcore/PerformanceServerTiming.cpp b/src/bun.js/bindings/webcore/PerformanceServerTiming.cpp index 484087699e..29e2c4b6c0 100644 --- a/src/bun.js/bindings/webcore/PerformanceServerTiming.cpp +++ b/src/bun.js/bindings/webcore/PerformanceServerTiming.cpp @@ -31,13 +31,13 @@ namespace WebCore { Ref PerformanceServerTiming::create(String&& name, double duration, String&& description) { - return adoptRef(*new PerformanceServerTiming(WTFMove(name), duration, WTFMove(description))); + return adoptRef(*new PerformanceServerTiming(WTF::move(name), duration, WTF::move(description))); } PerformanceServerTiming::PerformanceServerTiming(String&& name, double duration, String&& description) - : m_name(WTFMove(name)) + : m_name(WTF::move(name)) , m_duration(duration) - , m_description(WTFMove(description)) + , m_description(WTF::move(description)) { } diff --git a/src/bun.js/bindings/webcore/PerformanceUserTiming.cpp b/src/bun.js/bindings/webcore/PerformanceUserTiming.cpp index d9d67ebb21..9870e42f39 100644 --- a/src/bun.js/bindings/webcore/PerformanceUserTiming.cpp +++ b/src/bun.js/bindings/webcore/PerformanceUserTiming.cpp @@ -43,7 +43,7 @@ namespace WebCore { using NavigationTimingFunction = unsigned long long (PerformanceTiming::*)() const; -static constexpr std::pair restrictedMarkMappings[] = { +static constexpr std::array, 21> restrictedMarkMappings { { { "connectEnd"_s, &PerformanceTiming::connectEnd }, { "connectStart"_s, &PerformanceTiming::connectStart }, { "domComplete"_s, &PerformanceTiming::domComplete }, @@ -65,7 +65,7 @@ static constexpr std::pair res { "secureConnectionStart"_s, &PerformanceTiming::secureConnectionStart }, { "unloadEventEnd"_s, &PerformanceTiming::unloadEventEnd }, { "unloadEventStart"_s, &PerformanceTiming::unloadEventStart }, -}; +} }; static constexpr SortedArrayMap restrictedMarkFunctions { restrictedMarkMappings }; bool PerformanceUserTiming::isRestrictedMarkName(const String& markName) @@ -125,7 +125,7 @@ ExceptionOr> PerformanceUserTiming::mark(JSC::JSGlobalObjec // InspectorInstrumentation::performanceMark(context.get(), markName, timestamp, nullptr); - auto mark = PerformanceMark::create(globalObject, context, markName, WTFMove(markOptions)); + auto mark = PerformanceMark::create(globalObject, context, markName, WTF::move(markOptions)); if (mark.hasException()) return mark.releaseException(); diff --git a/src/bun.js/bindings/webcore/ReadableStreamDefaultController.cpp b/src/bun.js/bindings/webcore/ReadableStreamDefaultController.cpp index 11e6675ef9..77d99afb6e 100644 --- a/src/bun.js/bindings/webcore/ReadableStreamDefaultController.cpp +++ b/src/bun.js/bindings/webcore/ReadableStreamDefaultController.cpp @@ -143,7 +143,7 @@ bool ReadableStreamDefaultController::enqueue(RefPtr&& buffer) JSC::JSLockHolder lock(vm); auto scope = DECLARE_CATCH_SCOPE(vm); auto length = buffer->byteLength(); - auto value = JSC::JSUint8Array::create(&lexicalGlobalObject, lexicalGlobalObject.typedArrayStructureWithTypedArrayType(), WTFMove(buffer), 0, length); + auto value = JSC::JSUint8Array::create(&lexicalGlobalObject, lexicalGlobalObject.typedArrayStructureWithTypedArrayType(), WTF::move(buffer), 0, length); EXCEPTION_ASSERT(!scope.exception() || vm.hasPendingTerminationException()); RETURN_IF_EXCEPTION(scope, false); diff --git a/src/bun.js/bindings/webcore/ReadableStreamSink.cpp b/src/bun.js/bindings/webcore/ReadableStreamSink.cpp index d79e7d3581..67078d6ded 100644 --- a/src/bun.js/bindings/webcore/ReadableStreamSink.cpp +++ b/src/bun.js/bindings/webcore/ReadableStreamSink.cpp @@ -33,7 +33,7 @@ namespace WebCore { ReadableStreamToSharedBufferSink::ReadableStreamToSharedBufferSink(Callback&& callback) - : m_callback { WTFMove(callback) } + : m_callback { WTF::move(callback) } { } @@ -61,8 +61,8 @@ void ReadableStreamToSharedBufferSink::close() void ReadableStreamToSharedBufferSink::error(String&& message) { - if (auto callback = WTFMove(m_callback)) - callback(Exception { TypeError, WTFMove(message) }); + if (auto callback = WTF::move(m_callback)) + callback(Exception { TypeError, WTF::move(message) }); } } // namespace WebCore diff --git a/src/bun.js/bindings/webcore/ReadableStreamSink.h b/src/bun.js/bindings/webcore/ReadableStreamSink.h index 7db31e38ab..68dfefb001 100644 --- a/src/bun.js/bindings/webcore/ReadableStreamSink.h +++ b/src/bun.js/bindings/webcore/ReadableStreamSink.h @@ -47,7 +47,7 @@ public: class ReadableStreamToSharedBufferSink final : public ReadableStreamSink { public: using Callback = Function*>&&)>; - static Ref create(Callback&& callback) { return adoptRef(*new ReadableStreamToSharedBufferSink(WTFMove(callback))); } + static Ref create(Callback&& callback) { return adoptRef(*new ReadableStreamToSharedBufferSink(WTF::move(callback))); } void pipeFrom(ReadableStream&); void clearCallback() { m_callback = {}; } diff --git a/src/bun.js/bindings/webcore/ReadableStreamSource.cpp b/src/bun.js/bindings/webcore/ReadableStreamSource.cpp index e0537b4188..dfae6d6055 100644 --- a/src/bun.js/bindings/webcore/ReadableStreamSource.cpp +++ b/src/bun.js/bindings/webcore/ReadableStreamSource.cpp @@ -32,8 +32,8 @@ ReadableStreamSource::~ReadableStreamSource() = default; void ReadableStreamSource::start(ReadableStreamDefaultController&& controller, DOMPromiseDeferred&& promise) { ASSERT(!m_promise); - m_promise = makeUnique>(WTFMove(promise)); - m_controller = WTFMove(controller); + m_promise = makeUnique>(WTF::move(promise)); + m_controller = WTF::move(controller); setActive(); doStart(); @@ -44,7 +44,7 @@ void ReadableStreamSource::pull(DOMPromiseDeferred&& promise) ASSERT(!m_promise); ASSERT(m_controller); - m_promise = makeUnique>(WTFMove(promise)); + m_promise = makeUnique>(WTF::move(promise)); setActive(); doPull(); diff --git a/src/bun.js/bindings/webcore/RegisteredEventListener.h b/src/bun.js/bindings/webcore/RegisteredEventListener.h index a52890ef42..54e9487aac 100644 --- a/src/bun.js/bindings/webcore/RegisteredEventListener.h +++ b/src/bun.js/bindings/webcore/RegisteredEventListener.h @@ -46,7 +46,7 @@ public: static Ref create(Ref&& listener, const Options& options) { - return adoptRef(*new RegisteredEventListener(WTFMove(listener), options)); + return adoptRef(*new RegisteredEventListener(WTF::move(listener), options)); } EventListener& callback() const { return m_callback; } @@ -63,7 +63,7 @@ private: , m_isPassive(options.passive) , m_isOnce(options.once) , m_wasRemoved(false) - , m_callback(WTFMove(listener)) + , m_callback(WTF::move(listener)) { } diff --git a/src/bun.js/bindings/webcore/ResourceTiming.cpp b/src/bun.js/bindings/webcore/ResourceTiming.cpp index 1c18ae6e85..f777f8a97f 100644 --- a/src/bun.js/bindings/webcore/ResourceTiming.cpp +++ b/src/bun.js/bindings/webcore/ResourceTiming.cpp @@ -97,11 +97,11 @@ ResourceTiming ResourceTiming::isolatedCopy() const& ResourceTiming ResourceTiming::isolatedCopy() && { return ResourceTiming { - WTFMove(m_url).isolatedCopy(), - WTFMove(m_initiatorType).isolatedCopy(), - // WTFMove(m_resourceLoadTiming).isolatedCopy(), - WTFMove(m_networkLoadMetrics).isolatedCopy(), - crossThreadCopy(WTFMove(m_serverTiming)) + WTF::move(m_url).isolatedCopy(), + WTF::move(m_initiatorType).isolatedCopy(), + // WTF::move(m_resourceLoadTiming).isolatedCopy(), + WTF::move(m_networkLoadMetrics).isolatedCopy(), + crossThreadCopy(WTF::move(m_serverTiming)) }; } diff --git a/src/bun.js/bindings/webcore/ResourceTiming.h b/src/bun.js/bindings/webcore/ResourceTiming.h index 996874cfe8..6abbb03bce 100644 --- a/src/bun.js/bindings/webcore/ResourceTiming.h +++ b/src/bun.js/bindings/webcore/ResourceTiming.h @@ -66,11 +66,11 @@ public: private: ResourceTiming(const URL& url, const String& initiatorType, const NetworkLoadMetrics& networkLoadMetrics); ResourceTiming(URL&& url, String&& initiatorType, NetworkLoadMetrics&& networkLoadMetrics, Vector&& serverTiming) - : m_url(WTFMove(url)) - , m_initiatorType(WTFMove(initiatorType)) + : m_url(WTF::move(url)) + , m_initiatorType(WTF::move(initiatorType)) , m_resourceLoadTiming(ResourceLoadTiming()) - , m_networkLoadMetrics(WTFMove(networkLoadMetrics)) - , m_serverTiming(WTFMove(serverTiming)) + , m_networkLoadMetrics(WTF::move(networkLoadMetrics)) + , m_serverTiming(WTF::move(serverTiming)) { } diff --git a/src/bun.js/bindings/webcore/SerializedScriptValue.cpp b/src/bun.js/bindings/webcore/SerializedScriptValue.cpp index 751a1bac48..0240fbc8c0 100644 --- a/src/bun.js/bindings/webcore/SerializedScriptValue.cpp +++ b/src/bun.js/bindings/webcore/SerializedScriptValue.cpp @@ -1532,7 +1532,7 @@ private: auto index = m_serializedVideoFrames.find(videoFrame.ptr()); if (index == notFound) { index = m_serializedVideoChunks.size(); - m_serializedVideoFrames.append(WTFMove(videoFrame)); + m_serializedVideoFrames.append(WTF::move(videoFrame)); } write(WebCodecsVideoFrameTag); write(static_cast(index)); @@ -1760,7 +1760,7 @@ private: ArrayBufferContents contents; if (arrayBuffer->shareWith(contents)) { write(SharedArrayBufferTag); - m_sharedBuffers.append(WTFMove(contents)); + m_sharedBuffers.append(WTF::move(contents)); write(index); return true; } @@ -1960,7 +1960,7 @@ private: write(TerminatorTag); return true; } - StructuredCloneableSerialize to_write = WTFMove(_cloneable.value()); + StructuredCloneableSerialize to_write = WTF::move(_cloneable.value()); write(to_write.tag); to_write.write(this, m_lexicalGlobalObject); return true; @@ -2878,14 +2878,14 @@ public: // { // if (!buffer.size()) // return std::make_pair(jsNull(), SerializationReturnCode::UnspecifiedError); - // CloneDeserializer deserializer(lexicalGlobalObject, globalObject, messagePorts, arrayBufferContentsArray, buffer, blobURLs, blobFilePaths, sharedBuffers, WTFMove(backingStores) + // CloneDeserializer deserializer(lexicalGlobalObject, globalObject, messagePorts, arrayBufferContentsArray, buffer, blobURLs, blobFilePaths, sharedBuffers, WTF::move(backingStores) // #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) // , - // WTFMove(detachedOffscreenCanvases) + // WTF::move(detachedOffscreenCanvases) // #endif // #if ENABLE(WEB_RTC) // , - // WTFMove(detachedRTCDataChannels) + // WTF::move(detachedRTCDataChannels) // #endif // #if ENABLE(WEBASSEMBLY) // , @@ -2893,7 +2893,7 @@ public: // #endif // #if ENABLE(WEB_CODECS) // , - // WTFMove(serializedVideoChunks), WTFMove(serializedVideoFrames) + // WTF::move(serializedVideoChunks), WTF::move(serializedVideoFrames) // #endif // ); // if (!deserializer.isValid()) @@ -2927,11 +2927,11 @@ public: CloneDeserializer deserializer(lexicalGlobalObject, globalObject, messagePorts, arrayBufferContentsArray, std::span { buffer.begin(), buffer.end() }, blobURLs, blobFilePaths, sharedBuffers #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) , - WTFMove(detachedOffscreenCanvases) + WTF::move(detachedOffscreenCanvases) #endif #if ENABLE(WEB_RTC) , - WTFMove(detachedRTCDataChannels) + WTF::move(detachedRTCDataChannels) #endif #if ENABLE(WEBASSEMBLY) , @@ -2939,7 +2939,7 @@ public: #endif #if ENABLE(WEB_CODECS) , - WTFMove(serializedVideoChunks), WTFMove(serializedVideoFrames) + WTF::move(serializedVideoChunks), WTF::move(serializedVideoFrames) #endif ); if (!deserializer.isValid()) @@ -2974,7 +2974,7 @@ private: return m_jsString; } const String& string() { return m_string; } - String takeString() { return WTFMove(m_string); } + String takeString() { return WTF::move(m_string); } private: String m_string; @@ -3033,14 +3033,14 @@ private: // , m_messagePorts(messagePorts) // , m_arrayBufferContents(arrayBufferContents) // , m_arrayBuffers(arrayBufferContents ? arrayBufferContents->size() : 0) - // , m_backingStores(WTFMove(backingStores)) + // , m_backingStores(WTF::move(backingStores)) // , m_imageBitmaps(m_backingStores.size()) // #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) - // , m_detachedOffscreenCanvases(WTFMove(detachedOffscreenCanvases)) + // , m_detachedOffscreenCanvases(WTF::move(detachedOffscreenCanvases)) // , m_offscreenCanvases(m_detachedOffscreenCanvases.size()) // #endif // #if ENABLE(WEB_RTC) - // , m_detachedRTCDataChannels(WTFMove(detachedRTCDataChannels)) + // , m_detachedRTCDataChannels(WTF::move(detachedRTCDataChannels)) // , m_rtcDataChannels(m_detachedRTCDataChannels.size()) // #endif // #if ENABLE(WEBASSEMBLY) @@ -3048,9 +3048,9 @@ private: // , m_wasmMemoryHandles(wasmMemoryHandles) // #endif // #if ENABLE(WEB_CODECS) - // , m_serializedVideoChunks(WTFMove(serializedVideoChunks)) + // , m_serializedVideoChunks(WTF::move(serializedVideoChunks)) // , m_videoChunks(m_serializedVideoChunks.size()) - // , m_serializedVideoFrames(WTFMove(serializedVideoFrames)) + // , m_serializedVideoFrames(WTF::move(serializedVideoFrames)) // , m_videoFrames(m_serializedVideoFrames.size()) // #endif // { @@ -3087,11 +3087,11 @@ private: , m_arrayBufferContents(arrayBufferContents) , m_arrayBuffers(arrayBufferContents ? arrayBufferContents->size() : 0) #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) - , m_detachedOffscreenCanvases(WTFMove(detachedOffscreenCanvases)) + , m_detachedOffscreenCanvases(WTF::move(detachedOffscreenCanvases)) , m_offscreenCanvases(m_detachedOffscreenCanvases.size()) #endif #if ENABLE(WEB_RTC) - , m_detachedRTCDataChannels(WTFMove(detachedRTCDataChannels)) + , m_detachedRTCDataChannels(WTF::move(detachedRTCDataChannels)) , m_rtcDataChannels(m_detachedRTCDataChannels.size()) #endif #if ENABLE(WEBASSEMBLY) @@ -3099,9 +3099,9 @@ private: , m_wasmMemoryHandles(wasmMemoryHandles) #endif #if ENABLE(WEB_CODECS) - , m_serializedVideoChunks(WTFMove(serializedVideoChunks)) + , m_serializedVideoChunks(WTF::move(serializedVideoChunks)) , m_videoChunks(m_serializedVideoChunks.size()) - , m_serializedVideoFrames(WTFMove(serializedVideoFrames)) + , m_serializedVideoFrames(WTF::move(serializedVideoFrames)) , m_videoFrames(m_serializedVideoFrames.size()) #endif { @@ -3140,14 +3140,14 @@ private: // , m_blobURLs(blobURLs) // , m_blobFilePaths(blobFilePaths) // , m_sharedBuffers(sharedBuffers) - // , m_backingStores(WTFMove(backingStores)) + // , m_backingStores(WTF::move(backingStores)) // , m_imageBitmaps(m_backingStores.size()) // #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) - // , m_detachedOffscreenCanvases(WTFMove(detachedOffscreenCanvases)) + // , m_detachedOffscreenCanvases(WTF::move(detachedOffscreenCanvases)) // , m_offscreenCanvases(m_detachedOffscreenCanvases.size()) // #endif // #if ENABLE(WEB_RTC) - // , m_detachedRTCDataChannels(WTFMove(detachedRTCDataChannels)) + // , m_detachedRTCDataChannels(WTF::move(detachedRTCDataChannels)) // , m_rtcDataChannels(m_detachedRTCDataChannels.size()) // #endif // #if ENABLE(WEBASSEMBLY) @@ -3155,9 +3155,9 @@ private: // , m_wasmMemoryHandles(wasmMemoryHandles) // #endif // #if ENABLE(WEB_CODECS) - // , m_serializedVideoChunks(WTFMove(serializedVideoChunks)) + // , m_serializedVideoChunks(WTF::move(serializedVideoChunks)) // , m_videoChunks(m_serializedVideoChunks.size()) - // , m_serializedVideoFrames(WTFMove(serializedVideoFrames)) + // , m_serializedVideoFrames(WTF::move(serializedVideoFrames)) // , m_videoFrames(m_serializedVideoFrames.size()) // #endif // { @@ -3197,11 +3197,11 @@ private: , m_blobFilePaths(blobFilePaths) , m_sharedBuffers(sharedBuffers) #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) - , m_detachedOffscreenCanvases(WTFMove(detachedOffscreenCanvases)) + , m_detachedOffscreenCanvases(WTF::move(detachedOffscreenCanvases)) , m_offscreenCanvases(m_detachedOffscreenCanvases.size()) #endif #if ENABLE(WEB_RTC) - , m_detachedRTCDataChannels(WTFMove(detachedRTCDataChannels)) + , m_detachedRTCDataChannels(WTF::move(detachedRTCDataChannels)) , m_rtcDataChannels(m_detachedRTCDataChannels.size()) #endif #if ENABLE(WEBASSEMBLY) @@ -3209,9 +3209,9 @@ private: , m_wasmMemoryHandles(wasmMemoryHandles) #endif #if ENABLE(WEB_CODECS) - , m_serializedVideoChunks(WTFMove(serializedVideoChunks)) + , m_serializedVideoChunks(WTF::move(serializedVideoChunks)) , m_videoChunks(m_serializedVideoChunks.size()) - , m_serializedVideoFrames(WTFMove(serializedVideoFrames)) + , m_serializedVideoFrames(WTF::move(serializedVideoFrames)) , m_videoFrames(m_serializedVideoFrames.size()) #endif { @@ -3954,7 +3954,7 @@ private: CryptoAlgorithmIdentifier hash; if (!read(hash)) return false; - result = CryptoKeyHMAC::importRaw(0, hash, WTFMove(keyData), extractable, usages); + result = CryptoKeyHMAC::importRaw(0, hash, WTF::move(keyData), extractable, usages); return true; } @@ -3968,7 +3968,7 @@ private: Vector keyData; if (!read(keyData)) return false; - result = CryptoKeyAES::importRaw(algorithm, WTFMove(keyData), extractable, usages); + result = CryptoKeyAES::importRaw(algorithm, WTF::move(keyData), extractable, usages); return true; } @@ -3999,7 +3999,7 @@ private: if (type == CryptoKeyAsymmetricTypeSubtag::Public) { auto keyData = CryptoKeyRSAComponents::createPublic(modulus, exponent); auto key = CryptoKeyRSA::create(algorithm, hash, isRestrictedToHash, *keyData, extractable, usages); - result = WTFMove(key); + result = WTF::move(key); return true; } @@ -4014,7 +4014,7 @@ private: if (!primeCount) { auto keyData = CryptoKeyRSAComponents::createPrivate(modulus, exponent, privateExponent); auto key = CryptoKeyRSA::create(algorithm, hash, isRestrictedToHash, *keyData, extractable, usages); - result = WTFMove(key); + result = WTF::move(key); return true; } @@ -4046,7 +4046,7 @@ private: auto keyData = CryptoKeyRSAComponents::createPrivateWithAdditionalData(modulus, exponent, privateExponent, firstPrimeInfo, secondPrimeInfo, otherPrimeInfos); auto key = CryptoKeyRSA::create(algorithm, hash, isRestrictedToHash, *keyData, extractable, usages); - result = WTFMove(key); + result = WTF::move(key); return true; } @@ -4069,10 +4069,10 @@ private: switch (type) { case CryptoKeyAsymmetricTypeSubtag::Public: - result = CryptoKeyEC::importRaw(algorithm, curve->string(), WTFMove(keyData), extractable, usages); + result = CryptoKeyEC::importRaw(algorithm, curve->string(), WTF::move(keyData), extractable, usages); break; case CryptoKeyAsymmetricTypeSubtag::Private: - result = CryptoKeyEC::importPkcs8(algorithm, curve->string(), WTFMove(keyData), extractable, usages); + result = CryptoKeyEC::importPkcs8(algorithm, curve->string(), WTF::move(keyData), extractable, usages); break; } @@ -4093,7 +4093,7 @@ private: if (!read(keyData)) return false; - result = CryptoKeyOKP::importRaw(algorithm, namedCurve, WTFMove(keyData), extractable, usages); + result = CryptoKeyOKP::importRaw(algorithm, namedCurve, WTF::move(keyData), extractable, usages); return true; } @@ -4105,7 +4105,7 @@ private: Vector keyData; if (!read(keyData)) return false; - result = CryptoKeyRaw::create(algorithm, WTFMove(keyData), usages); + result = CryptoKeyRaw::create(algorithm, WTF::move(keyData), usages); return true; } @@ -4254,7 +4254,7 @@ private: // return {}; // TransformationMatrix matrix(m11, m12, m21, m22, m41, m42); - // return toJSNewlyCreated(m_lexicalGlobalObject, jsCast(m_globalObject), T::create(WTFMove(matrix), DOMMatrixReadOnly::Is2D::Yes)); + // return toJSNewlyCreated(m_lexicalGlobalObject, jsCast(m_globalObject), T::create(WTF::move(matrix), DOMMatrixReadOnly::Is2D::Yes)); // } else { // double m11; // if (!read(m11)) @@ -4306,7 +4306,7 @@ private: // return {}; // TransformationMatrix matrix(m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44); - // return toJSNewlyCreated(m_lexicalGlobalObject, jsCast(m_globalObject), T::create(WTFMove(matrix), DOMMatrixReadOnly::Is2D::No)); + // return toJSNewlyCreated(m_lexicalGlobalObject, jsCast(m_globalObject), T::create(WTF::move(matrix), DOMMatrixReadOnly::Is2D::No)); // } // } @@ -4373,7 +4373,7 @@ private: // if (!m_imageBitmaps[index]) { // m_backingStores.at(index)->connect(*executionContext(m_lexicalGlobalObject)); - // m_imageBitmaps[index] = ImageBitmap::create(WTFMove(m_backingStores.at(index))); + // m_imageBitmaps[index] = ImageBitmap::create(WTF::move(m_backingStores.at(index))); // } // auto bitmap = m_imageBitmaps[index].get(); @@ -4391,7 +4391,7 @@ private: } if (!m_offscreenCanvases[index]) - m_offscreenCanvases[index] = OffscreenCanvas::create(*executionContext(m_lexicalGlobalObject), WTFMove(m_detachedOffscreenCanvases.at(index))); + m_offscreenCanvases[index] = OffscreenCanvas::create(*executionContext(m_lexicalGlobalObject), WTF::move(m_detachedOffscreenCanvases.at(index))); auto offscreenCanvas = m_offscreenCanvases[index].get(); return getJSValue(offscreenCanvas); @@ -4440,8 +4440,8 @@ private: if (!m_canCreateDOMObject) return constructEmptyObject(m_lexicalGlobalObject, m_globalObject->objectPrototype()); - auto rtcCertificate = RTCCertificate::create(SecurityOrigin::createFromString(origin->string()), expires, WTFMove(fingerprints), certificate->takeString(), keyedMaterial->takeString()); - return toJSNewlyCreated(m_lexicalGlobalObject, jsCast(m_globalObject), WTFMove(rtcCertificate)); + auto rtcCertificate = RTCCertificate::create(SecurityOrigin::createFromString(origin->string()), expires, WTF::move(fingerprints), certificate->takeString(), keyedMaterial->takeString()); + return toJSNewlyCreated(m_lexicalGlobalObject, jsCast(m_globalObject), WTF::move(rtcCertificate)); } JSValue readRTCDataChannel() @@ -4454,8 +4454,8 @@ private: } if (!m_rtcDataChannels[index]) { - auto detachedChannel = WTFMove(m_detachedRTCDataChannels.at(index)); - m_rtcDataChannels[index] = RTCDataChannel::create(*executionContext(m_lexicalGlobalObject), detachedChannel->identifier, WTFMove(detachedChannel->label), WTFMove(detachedChannel->options), detachedChannel->state); + auto detachedChannel = WTF::move(m_detachedRTCDataChannels.at(index)); + m_rtcDataChannels[index] = RTCDataChannel::create(*executionContext(m_lexicalGlobalObject), detachedChannel->identifier, WTF::move(detachedChannel->label), WTF::move(detachedChannel->options), detachedChannel->state); } return getJSValue(m_rtcDataChannels[index].get()); @@ -4487,7 +4487,7 @@ private: } if (!m_videoFrames[index]) - m_videoFrames[index] = WebCodecsVideoFrame::create(*executionContext(m_lexicalGlobalObject), WTFMove(m_serializedVideoFrames.at(index))); + m_videoFrames[index] = WebCodecsVideoFrame::create(*executionContext(m_lexicalGlobalObject), WTF::move(m_serializedVideoFrames.at(index))); return getJSValue(m_videoFrames[index].get()); } @@ -4526,7 +4526,7 @@ private: // buffer->putPixelBuffer(*pixelBuffer, { IntPoint::zero(), logicalSize }); - // auto bitmap = ImageBitmap::create(ImageBitmapBacking(WTFMove(buffer), OptionSet::fromRaw(serializationState))); + // auto bitmap = ImageBitmap::create(ImageBitmapBacking(WTF::move(buffer), OptionSet::fromRaw(serializationState))); // return getJSValue(bitmap); // } @@ -4554,7 +4554,7 @@ private: auto cert_ptr = ncrypto::X509Pointer(cert); auto* domGlobalObject = defaultGlobalObject(m_globalObject); - auto* cert_obj = Bun::JSX509Certificate::create(m_lexicalGlobalObject->vm(), domGlobalObject->m_JSX509CertificateClassStructure.get(domGlobalObject), m_globalObject, WTFMove(cert_ptr)); + auto* cert_obj = Bun::JSX509Certificate::create(m_lexicalGlobalObject->vm(), domGlobalObject->m_JSX509CertificateClassStructure.get(domGlobalObject), m_globalObject, WTF::move(cert_ptr)); m_gcBuffer.appendWithCrashOnOverflow(cert_obj); return cert_obj; @@ -4579,9 +4579,9 @@ private: return JSValue(); } - KeyObject keyObject = KeyObject::create(WTFMove(keyData)); + KeyObject keyObject = KeyObject::create(WTF::move(keyData)); Structure* structure = globalObject->m_JSSecretKeyObjectClassStructure.get(m_globalObject); - return JSSecretKeyObject::create(vm, structure, m_globalObject, WTFMove(keyObject)); + return JSSecretKeyObject::create(vm, structure, m_globalObject, WTF::move(keyObject)); } case CryptoKeyType::Public: case CryptoKeyType::Private: { @@ -4605,7 +4605,7 @@ private: } auto keyObject = KeyObject::create(CryptoKeyType::Public, ncrypto::EVPKeyPointer(pkey)); Structure* structure = globalObject->m_JSPublicKeyObjectClassStructure.get(m_globalObject); - return JSPublicKeyObject::create(vm, structure, m_globalObject, WTFMove(keyObject)); + return JSPublicKeyObject::create(vm, structure, m_globalObject, WTF::move(keyObject)); } EVP_PKEY* pkey = PEM_read_bio_PrivateKey(bio, nullptr, nullptr, nullptr); @@ -4615,7 +4615,7 @@ private: } auto keyObject = KeyObject::create(CryptoKeyType::Private, ncrypto::EVPKeyPointer(pkey)); Structure* structure = globalObject->m_JSPrivateKeyObjectClassStructure.get(m_globalObject); - return JSPrivateKeyObject::create(vm, structure, m_globalObject, WTFMove(keyObject)); + return JSPrivateKeyObject::create(vm, structure, m_globalObject, WTF::move(keyObject)); } } } @@ -4824,7 +4824,7 @@ private: // } // if (!m_canCreateDOMObject) // return jsNull(); - // return getJSValue(FileList::create(WTFMove(files)).get()); + // return getJSValue(FileList::create(WTF::move(files)).get()); // } // case ImageDataTag: { // uint32_t width; @@ -4960,7 +4960,7 @@ private: fail(); return JSValue(); } - return ErrorInstance::create(m_lexicalGlobalObject, WTFMove(message), toErrorType(serializedErrorType), { line, column }, WTFMove(sourceURL), WTFMove(stackString)); + return ErrorInstance::create(m_lexicalGlobalObject, WTF::move(message), toErrorType(serializedErrorType), { line, column }, WTF::move(sourceURL), WTF::move(stackString)); } case ObjectReferenceTag: { auto index = readConstantPoolIndex(m_gcBuffer); @@ -5029,10 +5029,10 @@ private: fail(); return JSValue(); } - memory = Wasm::Memory::create(vm, contents.releaseNonNull(), WTFMove(handler)); + memory = Wasm::Memory::create(contents.releaseNonNull(), WTF::move(handler)); } else { // zero size & max-size. - memory = Wasm::Memory::createZeroSized(vm, JSC::MemorySharingMode::Shared, WTFMove(handler)); + memory = Wasm::Memory::createZeroSized(JSC::MemorySharingMode::Shared, WTF::move(handler)); } result->adopt(memory.releaseNonNull()); @@ -5053,7 +5053,7 @@ private: fail(); return JSValue(); } - JSValue result = JSArrayBuffer::create(m_lexicalGlobalObject->vm(), structure, WTFMove(arrayBuffer)); + JSValue result = JSArrayBuffer::create(m_lexicalGlobalObject->vm(), structure, WTF::move(arrayBuffer)); m_gcBuffer.appendWithCrashOnOverflow(result); return result; } @@ -5070,7 +5070,7 @@ private: fail(); return JSValue(); } - JSValue result = JSArrayBuffer::create(m_lexicalGlobalObject->vm(), structure, WTFMove(arrayBuffer)); + JSValue result = JSArrayBuffer::create(m_lexicalGlobalObject->vm(), structure, WTF::move(arrayBuffer)); m_gcBuffer.appendWithCrashOnOverflow(result); return result; } @@ -5083,7 +5083,7 @@ private: } if (!m_arrayBuffers[index]) - m_arrayBuffers[index] = ArrayBuffer::create(WTFMove(m_arrayBufferContents->at(index))); + m_arrayBuffers[index] = ArrayBuffer::create(WTF::move(m_arrayBufferContents->at(index))); return getJSValue(m_arrayBuffers[index].get()); } @@ -5099,7 +5099,7 @@ private: RELEASE_ASSERT(m_sharedBuffers->at(index)); ArrayBufferContents arrayBufferContents; m_sharedBuffers->at(index).shareWith(arrayBufferContents); - auto buffer = ArrayBuffer::create(WTFMove(arrayBufferContents)); + auto buffer = ArrayBuffer::create(WTF::move(arrayBufferContents)); JSValue result = getJSValue(buffer.get()); m_gcBuffer.appendWithCrashOnOverflow(result); return result; @@ -5474,14 +5474,14 @@ SerializedScriptValue::SerializedScriptValue(Vector&& buffer, std::uniq Vector>&& serializedVideoChunks, Vector&& serializedVideoFrames #endif ) - : m_data(WTFMove(buffer)) - , m_arrayBufferContentsArray(WTFMove(arrayBufferContentsArray)) + : m_data(WTF::move(buffer)) + , m_arrayBufferContentsArray(WTF::move(arrayBufferContentsArray)) #if ENABLE(WEB_RTC) - , m_detachedRTCDataChannels(WTFMove(detachedRTCDataChannels)) + , m_detachedRTCDataChannels(WTF::move(detachedRTCDataChannels)) #endif #if ENABLE(WEB_CODECS) - , m_serializedVideoChunks(WTFMove(serializedVideoChunks)) - , m_serializedVideoFrames(WTFMove(serializedVideoFrames)) + , m_serializedVideoChunks(WTF::move(serializedVideoChunks)) + , m_serializedVideoFrames(WTF::move(serializedVideoFrames)) #endif { m_memoryCost = computeMemoryCost(); @@ -5505,25 +5505,25 @@ SerializedScriptValue::SerializedScriptValue(Vector&& buffer, std::uniq // Vector>&& serializedVideoChunks, Vector&& serializedVideoFrames // #endif // ) -// : m_data(WTFMove(buffer)) -// , m_arrayBufferContentsArray(WTFMove(arrayBufferContentsArray)) -// , m_sharedBufferContentsArray(WTFMove(sharedBufferContentsArray)) -// , m_backingStores(WTFMove(backingStores)) +// : m_data(WTF::move(buffer)) +// , m_arrayBufferContentsArray(WTF::move(arrayBufferContentsArray)) +// , m_sharedBufferContentsArray(WTF::move(sharedBufferContentsArray)) +// , m_backingStores(WTF::move(backingStores)) // #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) -// , m_detachedOffscreenCanvases(WTFMove(detachedOffscreenCanvases)) +// , m_detachedOffscreenCanvases(WTF::move(detachedOffscreenCanvases)) // #endif // #if ENABLE(WEB_RTC) -// , m_detachedRTCDataChannels(WTFMove(detachedRTCDataChannels)) +// , m_detachedRTCDataChannels(WTF::move(detachedRTCDataChannels)) // #endif // #if ENABLE(WEBASSEMBLY) -// , m_wasmModulesArray(WTFMove(wasmModulesArray)) -// , m_wasmMemoryHandlesArray(WTFMove(wasmMemoryHandlesArray)) +// , m_wasmModulesArray(WTF::move(wasmModulesArray)) +// , m_wasmMemoryHandlesArray(WTF::move(wasmMemoryHandlesArray)) // #endif // #if ENABLE(WEB_CODECS) -// , m_serializedVideoChunks(WTFMove(serializedVideoChunks)) -// , m_serializedVideoFrames(WTFMove(serializedVideoFrames)) +// , m_serializedVideoChunks(WTF::move(serializedVideoChunks)) +// , m_serializedVideoFrames(WTF::move(serializedVideoFrames)) // #endif -// , m_blobHandles(crossThreadCopy(WTFMove(blobHandles))) +// , m_blobHandles(crossThreadCopy(WTF::move(blobHandles))) // { // m_memoryCost = computeMemoryCost(); // } @@ -5546,29 +5546,29 @@ SerializedScriptValue::SerializedScriptValue(Vector&& buffer, std::uniq Vector>&& serializedVideoChunks, Vector&& serializedVideoFrames #endif ) - : m_data(WTFMove(buffer)) - , m_arrayBufferContentsArray(WTFMove(arrayBufferContentsArray)) - , m_sharedBufferContentsArray(WTFMove(sharedBufferContentsArray)) + : m_data(WTF::move(buffer)) + , m_arrayBufferContentsArray(WTF::move(arrayBufferContentsArray)) + , m_sharedBufferContentsArray(WTF::move(sharedBufferContentsArray)) #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) - , m_detachedOffscreenCanvases(WTFMove(detachedOffscreenCanvases)) + , m_detachedOffscreenCanvases(WTF::move(detachedOffscreenCanvases)) #endif #if ENABLE(WEB_RTC) - , m_detachedRTCDataChannels(WTFMove(detachedRTCDataChannels)) + , m_detachedRTCDataChannels(WTF::move(detachedRTCDataChannels)) #endif #if ENABLE(WEBASSEMBLY) - , m_wasmModulesArray(WTFMove(wasmModulesArray)) - , m_wasmMemoryHandlesArray(WTFMove(wasmMemoryHandlesArray)) + , m_wasmModulesArray(WTF::move(wasmModulesArray)) + , m_wasmMemoryHandlesArray(WTF::move(wasmMemoryHandlesArray)) #endif #if ENABLE(WEB_CODECS) - , m_serializedVideoChunks(WTFMove(serializedVideoChunks)) - , m_serializedVideoFrames(WTFMove(serializedVideoFrames)) + , m_serializedVideoChunks(WTF::move(serializedVideoChunks)) + , m_serializedVideoFrames(WTF::move(serializedVideoFrames)) #endif { m_memoryCost = computeMemoryCost(); } SerializedScriptValue::SerializedScriptValue(WTF::FixedVector&& object) - : m_simpleInMemoryPropertyTable(WTFMove(object)) + : m_simpleInMemoryPropertyTable(WTF::move(object)) , m_fastPath(FastPath::SimpleObject) { m_memoryCost = computeMemoryCost(); @@ -5819,12 +5819,12 @@ RefPtr SerializedScriptValue::create(JSC::JSGlobalObject& // ExceptionOr> SerializedScriptValue::create(JSGlobalObject& globalObject, JSValue value, Vector>&& transferList, Vector>& messagePorts, SerializationForStorage forStorage, SerializationContext serializationContext) // { -// return create(globalObject, value, WTFMove(transferList), messagePorts, forStorage, SerializationErrorMode::NonThrowing, serializationContext); +// return create(globalObject, value, WTF::move(transferList), messagePorts, forStorage, SerializationErrorMode::NonThrowing, serializationContext); // } ExceptionOr> SerializedScriptValue::create(JSGlobalObject& globalObject, JSValue value, Vector>&& transferList, Vector>& messagePorts, SerializationForStorage forStorage, SerializationContext serializationContext, SerializationForCrossProcessTransfer forTransfer) { - return create(globalObject, value, WTFMove(transferList), messagePorts, forStorage, SerializationErrorMode::Throwing, serializationContext, forTransfer); + return create(globalObject, value, WTF::move(transferList), messagePorts, forStorage, SerializationErrorMode::Throwing, serializationContext, forTransfer); } // ExceptionOr> SerializedScriptValue::create(JSGlobalObject& lexicalGlobalObject, JSValue value, Vector>&& transferList, SerializationForStorage forStorage, SerializationErrorMode throwExceptions, SerializationContext context) @@ -5911,7 +5911,7 @@ ExceptionOr> SerializedScriptValue::create(JSGlobalOb RETURN_IF_EXCEPTION(scope, Exception { ExistingExceptionError }); if (canUseObjectFastPath) { - return SerializedScriptValue::createObjectFastPath(WTF::FixedVector(WTFMove(properties))); + return SerializedScriptValue::createObjectFastPath(WTF::FixedVector(WTF::move(properties))); } } } @@ -5947,13 +5947,13 @@ ExceptionOr> SerializedScriptValue::create(JSGlobalOb throwVMTypeError(&lexicalGlobalObject, scope, errorMessageForTransfer(arrayBuffer)); RELEASE_AND_RETURN(scope, Exception { ExistingExceptionError }); } - arrayBuffers.append(WTFMove(arrayBuffer)); + arrayBuffers.append(WTF::move(arrayBuffer)); continue; } if (auto port = JSMessagePort::toWrapped(vm, transferable.get())) { if (port->isDetached()) return Exception { DataCloneError, "MessagePort in transfer list is already detached"_s }; - messagePorts.append(WTFMove(port)); + messagePorts.append(WTF::move(port)); continue; } @@ -5963,13 +5963,13 @@ ExceptionOr> SerializedScriptValue::create(JSGlobalOb // if (!imageBitmap->originClean()) // return Exception { DataCloneError }; - // imageBitmaps.append(WTFMove(imageBitmap)); + // imageBitmaps.append(WTF::move(imageBitmap)); // continue; // } #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) if (auto offscreenCanvas = JSOffscreenCanvas::toWrapped(vm, transferable.get())) { - offscreenCanvases.append(WTFMove(offscreenCanvas)); + offscreenCanvases.append(WTF::move(offscreenCanvas)); continue; } #endif @@ -6064,7 +6064,7 @@ ExceptionOr> SerializedScriptValue::create(JSGlobalOb RELEASE_AND_RETURN(scope, arrayBufferContentsArray.releaseException()); } - // auto backingStores = ImageBitmap::detachBitmaps(WTFMove(imageBitmaps)); + // auto backingStores = ImageBitmap::detachBitmaps(WTF::move(imageBitmaps)); #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) Vector> detachedCanvases; @@ -6085,14 +6085,14 @@ ExceptionOr> SerializedScriptValue::create(JSGlobalOb videoFrame->close(); #endif - // return adoptRef(*new SerializedScriptValue(WTFMove(buffer), WTFMove(blobHandles), arrayBufferContentsArray.releaseReturnValue(), context == SerializationContext::WorkerPostMessage ? WTFMove(sharedBuffers) : nullptr, WTFMove(backingStores) + // return adoptRef(*new SerializedScriptValue(WTF::move(buffer), WTF::move(blobHandles), arrayBufferContentsArray.releaseReturnValue(), context == SerializationContext::WorkerPostMessage ? WTF::move(sharedBuffers) : nullptr, WTF::move(backingStores) // #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) // , - // WTFMove(detachedCanvases) + // WTF::move(detachedCanvases) // #endif // #if ENABLE(WEB_RTC) // , - // WTFMove(detachedRTCDataChannels) + // WTF::move(detachedRTCDataChannels) // #endif // #if ENABLE(WEBASSEMBLY) // , @@ -6100,18 +6100,18 @@ ExceptionOr> SerializedScriptValue::create(JSGlobalOb // #endif // #if ENABLE(WEB_CODECS) // , - // WTFMove(serializedVideoChunks), WTFMove(serializedVideoFrameData) + // WTF::move(serializedVideoChunks), WTF::move(serializedVideoFrameData) // #endif // )); scope.releaseAssertNoException(); - return adoptRef(*new SerializedScriptValue(WTFMove(buffer), arrayBufferContentsArray.releaseReturnValue(), context == SerializationContext::WorkerPostMessage ? WTFMove(sharedBuffers) : nullptr + return adoptRef(*new SerializedScriptValue(WTF::move(buffer), arrayBufferContentsArray.releaseReturnValue(), context == SerializationContext::WorkerPostMessage ? WTF::move(sharedBuffers) : nullptr #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) , - WTFMove(detachedCanvases) + WTF::move(detachedCanvases) #endif #if ENABLE(WEB_RTC) , - WTFMove(detachedRTCDataChannels) + WTF::move(detachedRTCDataChannels) #endif #if ENABLE(WEBASSEMBLY) , @@ -6119,7 +6119,7 @@ ExceptionOr> SerializedScriptValue::create(JSGlobalOb #endif #if ENABLE(WEB_CODECS) , - WTFMove(serializedVideoChunks), WTFMove(serializedVideoFrameData) + WTF::move(serializedVideoChunks), WTF::move(serializedVideoFrameData) #endif )); } @@ -6129,7 +6129,7 @@ RefPtr SerializedScriptValue::create(StringView string) Vector buffer; if (!CloneSerializer::serialize(string, buffer)) return nullptr; - return adoptRef(*new SerializedScriptValue(WTFMove(buffer))); + return adoptRef(*new SerializedScriptValue(WTF::move(buffer))); } Ref SerializedScriptValue::createStringFastPath(const String& string) @@ -6139,7 +6139,7 @@ Ref SerializedScriptValue::createStringFastPath(const Str Ref SerializedScriptValue::createObjectFastPath(WTF::FixedVector&& object) { - return adoptRef(*new SerializedScriptValue(WTFMove(object))); + return adoptRef(*new SerializedScriptValue(WTF::move(object))); } RefPtr SerializedScriptValue::create(JSContextRef originContext, JSValueRef apiValue, JSValueRef* exception) @@ -6217,7 +6217,7 @@ JSC::JSValue SerializedScriptValue::fromArrayBuffer(JSC::JSGlobalObject& domGlob #endif #if ENABLE(WEB_CODECS) , - WTFMove(m_serializedVideoChunks), WTFMove(m_serializedVideoFrames) + WTF::move(m_serializedVideoChunks), WTF::move(m_serializedVideoFrames) #endif ); @@ -6296,11 +6296,11 @@ JSValue SerializedScriptValue::deserialize(JSGlobalObject& lexicalGlobalObject, DeserializationResult result = CloneDeserializer::deserialize(&lexicalGlobalObject, globalObject, messagePorts #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) , - WTFMove(m_detachedOffscreenCanvases) + WTF::move(m_detachedOffscreenCanvases) #endif #if ENABLE(WEB_RTC) , - WTFMove(m_detachedRTCDataChannels) + WTF::move(m_detachedRTCDataChannels) #endif , m_arrayBufferContentsArray.get(), m_data, blobURLs, blobFilePaths, m_sharedBufferContentsArray.get() @@ -6310,7 +6310,7 @@ JSValue SerializedScriptValue::deserialize(JSGlobalObject& lexicalGlobalObject, #endif #if ENABLE(WEB_CODECS) , - WTFMove(m_serializedVideoChunks), WTFMove(m_serializedVideoFrames) + WTF::move(m_serializedVideoChunks), WTF::move(m_serializedVideoFrames) #endif ); if (didFail) @@ -6327,14 +6327,14 @@ JSValue SerializedScriptValue::deserialize(JSGlobalObject& lexicalGlobalObject, } // JSValue SerializedScriptValue::deserialize(JSGlobalObject& lexicalGlobalObject, JSGlobalObject* globalObject, const Vector& blobURLs, const Vector& blobFilePaths, SerializationErrorMode throwExceptions, bool* didFail) // { -// // DeserializationResult result = CloneDeserializer::deserialize(&lexicalGlobalObject, globalObject, messagePorts, WTFMove(m_backingStores) +// // DeserializationResult result = CloneDeserializer::deserialize(&lexicalGlobalObject, globalObject, messagePorts, WTF::move(m_backingStores) // // #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) // // , -// // WTFMove(m_detachedOffscreenCanvases) +// // WTF::move(m_detachedOffscreenCanvases) // // #endif // // #if ENABLE(WEB_RTC) // // , -// // WTFMove(m_detachedRTCDataChannels) +// // WTF::move(m_detachedRTCDataChannels) // // #endif // // , // // m_arrayBufferContentsArray.get(), m_data, blobURLs, blobFilePaths, m_sharedBufferContentsArray.get() @@ -6344,17 +6344,17 @@ JSValue SerializedScriptValue::deserialize(JSGlobalObject& lexicalGlobalObject, // // #endif // // #if ENABLE(WEB_CODECS) // // , -// // WTFMove(m_serializedVideoChunks), WTFMove(m_serializedVideoFrames) +// // WTF::move(m_serializedVideoChunks), WTF::move(m_serializedVideoFrames) // // #endif // // ); // DeserializationResult result = CloneDeserializer::deserialize(&lexicalGlobalObject, globalObject // #if ENABLE(OFFSCREEN_CANVAS_IN_WORKERS) // , -// WTFMove(m_detachedOffscreenCanvases) +// WTF::move(m_detachedOffscreenCanvases) // #endif // #if ENABLE(WEB_RTC) // , -// WTFMove(m_detachedRTCDataChannels) +// WTF::move(m_detachedRTCDataChannels) // #endif // , // m_arrayBufferContentsArray.get(), m_data, blobURLs, blobFilePaths, m_sharedBufferContentsArray.get() @@ -6364,7 +6364,7 @@ JSValue SerializedScriptValue::deserialize(JSGlobalObject& lexicalGlobalObject, // #endif // #if ENABLE(WEB_CODECS) // , -// WTFMove(m_serializedVideoChunks), WTFMove(m_serializedVideoFrames) +// WTF::move(m_serializedVideoChunks), WTF::move(m_serializedVideoFrames) // #endif // ); // if (didFail) @@ -6415,7 +6415,7 @@ uint32_t SerializedScriptValue::wireFormatVersion() // ASSERT(isMainThread()); // ASSERT(hasBlobURLs()); -// blobRegistry().writeBlobsToTemporaryFilesForIndexedDB(blobURLs(), [completionHandler = WTFMove(completionHandler), this, protectedThis = Ref { *this }](auto&& blobFilePaths) mutable { +// blobRegistry().writeBlobsToTemporaryFilesForIndexedDB(blobURLs(), [completionHandler = WTF::move(completionHandler), this, protectedThis = Ref { *this }](auto&& blobFilePaths) mutable { // ASSERT(isMainThread()); // if (blobFilePaths.isEmpty()) { diff --git a/src/bun.js/bindings/webcore/SerializedScriptValue.h b/src/bun.js/bindings/webcore/SerializedScriptValue.h index ba434e9c12..9956f06b42 100644 --- a/src/bun.js/bindings/webcore/SerializedScriptValue.h +++ b/src/bun.js/bindings/webcore/SerializedScriptValue.h @@ -156,7 +156,7 @@ public: // IDBValue writeBlobsToDiskForIndexedDBSynchronously(); static Ref createFromWireBytes(Vector&& data) { - return adoptRef(*new SerializedScriptValue(WTFMove(data))); + return adoptRef(*new SerializedScriptValue(WTF::move(data))); } const Vector& wireBytes() const { return m_data; } @@ -322,7 +322,7 @@ RefPtr SerializedScriptValue::decode(Decoder& decoder) static_assert(sizeof(std::span::element_type) == 1); memcpy(buffer, data.data(), data.size_bytes()); JSC::ArrayBufferDestructorFunction destructor = ArrayBuffer::primitiveGigacageDestructor(); - arrayBufferContentsArray->append({ buffer, data.size_bytes(), std::nullopt, WTFMove(destructor) }); + arrayBufferContentsArray->append({ buffer, data.size_bytes(), std::nullopt, WTF::move(destructor) }); } } @@ -337,7 +337,7 @@ RefPtr SerializedScriptValue::decode(Decoder& decoder) decoder >> detachedRTCDataChannel; if (!detachedRTCDataChannel) return nullptr; - detachedRTCDataChannels.append(makeUnique(WTFMove(*detachedRTCDataChannel))); + detachedRTCDataChannels.append(makeUnique(WTF::move(*detachedRTCDataChannel))); } #endif #if ENABLE(WEB_CODECS) @@ -351,24 +351,24 @@ RefPtr SerializedScriptValue::decode(Decoder& decoder) decoder >> videoChunkData; if (!videoChunkData) return nullptr; - serializedVideoChunks.append(WebCodecsEncodedVideoChunkStorage::create(WTFMove(*videoChunkData))); + serializedVideoChunks.append(WebCodecsEncodedVideoChunkStorage::create(WTF::move(*videoChunkData))); } // FIXME: decode video frames Vector serializedVideoFrames; #endif - return adoptRef(*new SerializedScriptValue(WTFMove(data), WTFMove(arrayBufferContentsArray) + return adoptRef(*new SerializedScriptValue(WTF::move(data), WTF::move(arrayBufferContentsArray) #if ENABLE(WEB_RTC) - , - WTFMove(detachedRTCDataChannels) + , + WTF::move(detachedRTCDataChannels) #endif #if ENABLE(WEB_CODECS) , - WTFMove(serializedVideoChunks) + WTF::move(serializedVideoChunks) #endif #if ENABLE(WEB_CODECS) , - WTFMove(serializedVideoFrames) + WTF::move(serializedVideoFrames) #endif )); } diff --git a/src/bun.js/bindings/webcore/ServerTiming.cpp b/src/bun.js/bindings/webcore/ServerTiming.cpp index eac63d8f2d..05662c6934 100644 --- a/src/bun.js/bindings/webcore/ServerTiming.cpp +++ b/src/bun.js/bindings/webcore/ServerTiming.cpp @@ -53,7 +53,7 @@ ServerTiming ServerTiming::isolatedCopy() const& ServerTiming ServerTiming::isolatedCopy() && { - return ServerTiming { WTFMove(name).isolatedCopy(), duration, WTFMove(description).isolatedCopy(), durationSet, descriptionSet }; + return ServerTiming { WTF::move(name).isolatedCopy(), duration, WTF::move(description).isolatedCopy(), durationSet, descriptionSet }; } } // namespace WebCore diff --git a/src/bun.js/bindings/webcore/ServerTiming.h b/src/bun.js/bindings/webcore/ServerTiming.h index dc24c76ca5..292a16202c 100644 --- a/src/bun.js/bindings/webcore/ServerTiming.h +++ b/src/bun.js/bindings/webcore/ServerTiming.h @@ -47,21 +47,21 @@ struct ServerTiming { }; inline ServerTiming::ServerTiming(String&& name) - : name(WTFMove(name)) + : name(WTF::move(name)) { } inline ServerTiming::ServerTiming(String&& name, double duration, String&& description) - : name(WTFMove(name)) + : name(WTF::move(name)) , duration(duration) - , description(WTFMove(description)) + , description(WTF::move(description)) { } inline ServerTiming::ServerTiming(String&& name, double duration, String&& description, bool durationSet, bool descriptionSet) - : name(WTFMove(name)) + : name(WTF::move(name)) , duration(duration) - , description(WTFMove(description)) + , description(WTF::move(description)) , durationSet(durationSet) , descriptionSet(descriptionSet) { diff --git a/src/bun.js/bindings/webcore/ServerTimingParser.cpp b/src/bun.js/bindings/webcore/ServerTimingParser.cpp index 73a0b04b5e..1b2f79bf6b 100644 --- a/src/bun.js/bindings/webcore/ServerTimingParser.cpp +++ b/src/bun.js/bindings/webcore/ServerTimingParser.cpp @@ -49,7 +49,7 @@ Vector parseServerTiming(const String& headerValue) if (name.isNull()) break; - ServerTiming entry(WTFMove(name)); + ServerTiming entry(WTF::move(name)); while (tokenizer.consume(';')) { String parameterName = tokenizer.consumeToken(); @@ -64,7 +64,7 @@ Vector parseServerTiming(const String& headerValue) entry.setParameter(parameterName, value); } - entries.append(WTFMove(entry)); + entries.append(WTF::move(entry)); if (!tokenizer.consume(',')) break; diff --git a/src/bun.js/bindings/webcore/StructuredClone.cpp b/src/bun.js/bindings/webcore/StructuredClone.cpp index 5c85999cc1..ea62c2044f 100644 --- a/src/bun.js/bindings/webcore/StructuredClone.cpp +++ b/src/bun.js/bindings/webcore/StructuredClone.cpp @@ -98,10 +98,10 @@ JSC_DEFINE_HOST_FUNCTION(structuredCloneForStream, (JSGlobalObject * globalObjec auto bufferClone = buffer->slice(0); Structure* structure = bufferView->structure(); -#define CLONE_TYPED_ARRAY(name) \ - do { \ - if (bufferView->inherits()) \ - RELEASE_AND_RETURN(scope, JSValue::encode(JS##name##Array::create(globalObject, structure, WTFMove(bufferClone), bufferView->byteOffset(), bufferView->length()))); \ +#define CLONE_TYPED_ARRAY(name) \ + do { \ + if (bufferView->inherits()) \ + RELEASE_AND_RETURN(scope, JSValue::encode(JS##name##Array::create(globalObject, structure, WTF::move(bufferClone), bufferView->byteOffset(), bufferView->length()))); \ } while (0); FOR_EACH_TYPED_ARRAY_TYPE_EXCLUDING_DATA_VIEW(CLONE_TYPED_ARRAY) @@ -109,7 +109,7 @@ JSC_DEFINE_HOST_FUNCTION(structuredCloneForStream, (JSGlobalObject * globalObjec #undef CLONE_TYPED_ARRAY if (value.inherits()) - RELEASE_AND_RETURN(scope, JSValue::encode(JSDataView::create(globalObject, structure, WTFMove(bufferClone), bufferView->byteOffset(), bufferView->length()))); + RELEASE_AND_RETURN(scope, JSValue::encode(JSDataView::create(globalObject, structure, WTF::move(bufferClone), bufferView->byteOffset(), bufferView->length()))); } throwTypeError(globalObject, scope, "structuredClone not implemented for non-ArrayBuffer / non-ArrayBufferView"_s); @@ -151,7 +151,7 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionStructuredClone, (JSC::JSGlobalObject * globa } Vector> ports; - ExceptionOr> serialized = SerializedScriptValue::create(*globalObject, value, WTFMove(transferList), ports); + ExceptionOr> serialized = SerializedScriptValue::create(*globalObject, value, WTF::move(transferList), ports); if (serialized.hasException()) { WebCore::propagateException(*globalObject, throwScope, serialized.releaseException()); RELEASE_AND_RETURN(throwScope, {}); @@ -214,7 +214,7 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionStructuredCloneAdvanced, (JSC::JSGlobalObject } Vector> ports; - ExceptionOr> serialized = SerializedScriptValue::create(*globalObject, value, WTFMove(transferList), ports, forStorage, serializationContext, forTransfer); + ExceptionOr> serialized = SerializedScriptValue::create(*globalObject, value, WTF::move(transferList), ports, forStorage, serializationContext, forTransfer); if (serialized.hasException()) { WebCore::propagateException(*globalObject, throwScope, serialized.releaseException()); RELEASE_AND_RETURN(throwScope, {}); diff --git a/src/bun.js/bindings/webcore/StructuredSerializeOptions.h b/src/bun.js/bindings/webcore/StructuredSerializeOptions.h index c1470f94a2..b1ee67aa62 100644 --- a/src/bun.js/bindings/webcore/StructuredSerializeOptions.h +++ b/src/bun.js/bindings/webcore/StructuredSerializeOptions.h @@ -34,7 +34,7 @@ namespace WebCore { struct StructuredSerializeOptions { StructuredSerializeOptions() = default; StructuredSerializeOptions(Vector>&& transfer) - : transfer(WTFMove(transfer)) + : transfer(WTF::move(transfer)) { } diff --git a/src/bun.js/bindings/webcore/URLPattern.cpp b/src/bun.js/bindings/webcore/URLPattern.cpp index 705ca93cd0..17884dfe8a 100644 --- a/src/bun.js/bindings/webcore/URLPattern.cpp +++ b/src/bun.js/bindings/webcore/URLPattern.cpp @@ -36,7 +36,6 @@ #include "URLPatternResult.h" #include #include -#include #include #include #include @@ -45,8 +44,6 @@ namespace WebCore { using namespace JSC; -WTF_MAKE_TZONE_OR_ISO_ALLOCATED_IMPL(URLPattern); - // https://urlpattern.spec.whatwg.org/#process-a-base-url-string static String processBaseURLString(StringView input, BaseURLStringType type) { @@ -75,7 +72,7 @@ URLPattern::URLPattern() = default; // https://urlpattern.spec.whatwg.org/#process-a-urlpatterninit static ExceptionOr processInit(URLPatternInit&& init, BaseURLStringType type, String&& protocol = {}, String&& username = {}, String&& password = {}, String&& hostname = {}, String&& port = {}, String&& pathname = {}, String&& search = {}, String&& hash = {}) { - URLPatternInit result { WTFMove(protocol), WTFMove(username), WTFMove(password), WTFMove(hostname), WTFMove(port), WTFMove(pathname), WTFMove(search), WTFMove(hash), {} }; + URLPatternInit result { WTF::move(protocol), WTF::move(username), WTF::move(password), WTF::move(hostname), WTF::move(port), WTF::move(pathname), WTF::move(search), WTF::move(hash), {} }; URL baseURL; @@ -218,21 +215,21 @@ ExceptionOr> URLPattern::create(ScriptExecutionContext& context, URLPatternInit init; if (std::holds_alternative(input) && !std::get(input).isNull()) { - auto maybeInit = URLPatternConstructorStringParser(WTFMove(std::get(input))).parse(context); + auto maybeInit = URLPatternConstructorStringParser(WTF::move(std::get(input))).parse(context); if (maybeInit.hasException()) return maybeInit.releaseException(); init = maybeInit.releaseReturnValue(); if (baseURL.isNull() && init.protocol.isEmpty()) return Exception { ExceptionCode::TypeError, "Relative constructor string must have additional baseURL argument."_s }; - init.baseURL = WTFMove(baseURL); + init.baseURL = WTF::move(baseURL); } else if (std::holds_alternative(input)) { if (!baseURL.isNull()) return Exception { ExceptionCode::TypeError, "Constructor with a URLPatternInit should have a null baseURL argument."_s }; init = std::get(input); } - auto maybeProcessedInit = processInit(WTFMove(init), BaseURLStringType::Pattern); + auto maybeProcessedInit = processInit(WTF::move(init), BaseURLStringType::Pattern); if (maybeProcessedInit.hasException()) return maybeProcessedInit.releaseException(); @@ -262,7 +259,7 @@ ExceptionOr> URLPattern::create(ScriptExecutionContext& context, Ref result = adoptRef(*new URLPattern); - auto maybeCompileException = result->compileAllComponents(context, WTFMove(processedInit), options); + auto maybeCompileException = result->compileAllComponents(context, WTF::move(processedInit), options); if (maybeCompileException.hasException()) return maybeCompileException.releaseException(); @@ -275,13 +272,13 @@ ExceptionOr> URLPattern::create(ScriptExecutionContext& context, if (!input) input = URLPatternInit {}; - return create(context, WTFMove(*input), String {}, WTFMove(options)); + return create(context, WTF::move(*input), String {}, WTF::move(options)); } // https://urlpattern.spec.whatwg.org/#build-a-url-pattern-from-a-web-idl-value ExceptionOr> URLPattern::create(ScriptExecutionContext& context, Compatible&& value, const String& baseURL) { - return switchOn(WTFMove(value), [&](RefPtr&& pattern) -> ExceptionOr> { return pattern.releaseNonNull(); }, [&](URLPatternInit&& init) -> ExceptionOr> { return URLPattern::create(context, WTFMove(init), {}, {}); }, [&](String&& string) -> ExceptionOr> { return URLPattern::create(context, WTFMove(string), String { baseURL }, {}); }); + return switchOn(WTF::move(value), [&](RefPtr&& pattern) -> ExceptionOr> { return pattern.releaseNonNull(); }, [&](URLPatternInit&& init) -> ExceptionOr> { return URLPattern::create(context, WTF::move(init), {}, {}); }, [&](String&& string) -> ExceptionOr> { return URLPattern::create(context, WTF::move(string), String { baseURL }, {}); }); } URLPattern::~URLPattern() = default; @@ -292,7 +289,7 @@ ExceptionOr URLPattern::test(ScriptExecutionContext& context, std::optiona if (!input) input = URLPatternInit {}; - auto maybeResult = match(context, WTFMove(*input), WTFMove(baseURL)); + auto maybeResult = match(context, WTF::move(*input), WTF::move(baseURL)); if (maybeResult.hasException()) return maybeResult.releaseException(); @@ -305,7 +302,7 @@ ExceptionOr> URLPattern::exec(ScriptExecutionCon if (!input) input = URLPatternInit {}; - return match(context, WTFMove(*input), WTFMove(baseURL)); + return match(context, WTF::move(*input), WTF::move(baseURL)); } ExceptionOr URLPattern::compileAllComponents(ScriptExecutionContext& context, URLPatternInit&& processedInit, const URLPatternOptions& options) @@ -404,7 +401,7 @@ ExceptionOr> URLPattern::match(ScriptExecutionCo return Exception { ExceptionCode::TypeError, "Base URL string is provided with a URLPatternInit. If URLPatternInit is provided, please use URLPatternInit.baseURL property instead"_s }; URLPatternInit initCopy = value; - auto maybeResult = processInit(WTFMove(initCopy), BaseURLStringType::URL); + auto maybeResult = processInit(WTF::move(initCopy), BaseURLStringType::URL); if (maybeResult.hasException()) return true; @@ -437,42 +434,42 @@ ExceptionOr> URLPattern::match(ScriptExecutionCo auto* globalObject = context.globalObject(); if (!globalObject) return { std::nullopt }; - result.protocol = m_protocolComponent.createComponentMatchResult(globalObject, WTFMove(protocol), protocolExecResult); + result.protocol = m_protocolComponent.createComponentMatchResult(globalObject, WTF::move(protocol), protocolExecResult); auto usernameExecResult = m_usernameComponent.componentExec(context, username); if (usernameExecResult.isNull() || usernameExecResult.isUndefined()) return { std::nullopt }; - result.username = m_usernameComponent.createComponentMatchResult(globalObject, WTFMove(username), usernameExecResult); + result.username = m_usernameComponent.createComponentMatchResult(globalObject, WTF::move(username), usernameExecResult); auto passwordExecResult = m_passwordComponent.componentExec(context, password); if (passwordExecResult.isNull() || passwordExecResult.isUndefined()) return { std::nullopt }; - result.password = m_passwordComponent.createComponentMatchResult(globalObject, WTFMove(password), passwordExecResult); + result.password = m_passwordComponent.createComponentMatchResult(globalObject, WTF::move(password), passwordExecResult); auto hostnameExecResult = m_hostnameComponent.componentExec(context, hostname); if (hostnameExecResult.isNull() || hostnameExecResult.isUndefined()) return { std::nullopt }; - result.hostname = m_hostnameComponent.createComponentMatchResult(globalObject, WTFMove(hostname), hostnameExecResult); + result.hostname = m_hostnameComponent.createComponentMatchResult(globalObject, WTF::move(hostname), hostnameExecResult); auto pathnameExecResult = m_pathnameComponent.componentExec(context, pathname); if (pathnameExecResult.isNull() || pathnameExecResult.isUndefined()) return { std::nullopt }; - result.pathname = m_pathnameComponent.createComponentMatchResult(globalObject, WTFMove(pathname), pathnameExecResult); + result.pathname = m_pathnameComponent.createComponentMatchResult(globalObject, WTF::move(pathname), pathnameExecResult); auto portExecResult = m_portComponent.componentExec(context, port); if (portExecResult.isNull() || portExecResult.isUndefined()) return { std::nullopt }; - result.port = m_portComponent.createComponentMatchResult(globalObject, WTFMove(port), portExecResult); + result.port = m_portComponent.createComponentMatchResult(globalObject, WTF::move(port), portExecResult); auto searchExecResult = m_searchComponent.componentExec(context, search); if (searchExecResult.isNull() || searchExecResult.isUndefined()) return { std::nullopt }; - result.search = m_searchComponent.createComponentMatchResult(globalObject, WTFMove(search), searchExecResult); + result.search = m_searchComponent.createComponentMatchResult(globalObject, WTF::move(search), searchExecResult); auto hashExecResult = m_hashComponent.componentExec(context, hash); if (hashExecResult.isNull() || hashExecResult.isUndefined()) return { std::nullopt }; - result.hash = m_hashComponent.createComponentMatchResult(globalObject, WTFMove(hash), hashExecResult); + result.hash = m_hashComponent.createComponentMatchResult(globalObject, WTF::move(hash), hashExecResult); return { result }; } diff --git a/src/bun.js/bindings/webcore/URLPattern.h b/src/bun.js/bindings/webcore/URLPattern.h index 838eb24596..85d5111a74 100644 --- a/src/bun.js/bindings/webcore/URLPattern.h +++ b/src/bun.js/bindings/webcore/URLPattern.h @@ -49,7 +49,7 @@ class URLPatternComponent; } class URLPattern final : public RefCounted { - WTF_MAKE_TZONE_OR_ISO_ALLOCATED(URLPattern); + WTF_MAKE_TZONE_ALLOCATED(URLPattern); public: using URLPatternInput = Variant; diff --git a/src/bun.js/bindings/webcore/URLPatternComponent.cpp b/src/bun.js/bindings/webcore/URLPatternComponent.cpp index cb2c139aa6..0d7d8458fa 100644 --- a/src/bun.js/bindings/webcore/URLPatternComponent.cpp +++ b/src/bun.js/bindings/webcore/URLPatternComponent.cpp @@ -41,9 +41,9 @@ using namespace JSC; namespace URLPatternUtilities { URLPatternComponent::URLPatternComponent(String&& patternString, JSC::Strong&& regex, Vector&& groupNameList, bool hasRegexpGroupsFromPartsList) - : m_patternString(WTFMove(patternString)) - , m_regularExpression(WTFMove(regex)) - , m_groupNameList(WTFMove(groupNameList)) + : m_patternString(WTF::move(patternString)) + , m_regularExpression(WTF::move(regex)) + , m_groupNameList(WTF::move(groupNameList)) , m_hasRegexGroupsFromPartList(hasRegexpGroupsFromPartsList) { } @@ -72,7 +72,7 @@ ExceptionOr URLPatternComponent::compile(Ref vm, S return part.type == PartType::Regexp; }); - return URLPatternComponent { WTFMove(patternString), JSC::Strong { vm, regularExpression }, WTFMove(nameList), hasRegexGroups }; + return URLPatternComponent { WTF::move(patternString), JSC::Strong { vm, regularExpression }, WTF::move(nameList), hasRegexGroups }; } // https://urlpattern.spec.whatwg.org/#protocol-component-matches-a-special-scheme @@ -136,10 +136,10 @@ URLPatternComponentResult URLPatternComponent::createComponentMatchResult(JSC::J size_t groupIndex = index - 1; String groupName = groupIndex < m_groupNameList.size() ? m_groupNameList[groupIndex] : emptyString(); - groups.append(URLPatternComponentResult::NameMatchPair { WTFMove(groupName), WTFMove(value) }); + groups.append(URLPatternComponentResult::NameMatchPair { WTF::move(groupName), WTF::move(value) }); } - return URLPatternComponentResult { !input.isEmpty() ? WTFMove(input) : emptyString(), WTFMove(groups) }; + return URLPatternComponentResult { !input.isEmpty() ? WTF::move(input) : emptyString(), WTF::move(groups) }; } } diff --git a/src/bun.js/bindings/webcore/URLPatternConstructorStringParser.cpp b/src/bun.js/bindings/webcore/URLPatternConstructorStringParser.cpp index 80d405e820..914b72a450 100644 --- a/src/bun.js/bindings/webcore/URLPatternConstructorStringParser.cpp +++ b/src/bun.js/bindings/webcore/URLPatternConstructorStringParser.cpp @@ -37,7 +37,7 @@ namespace WebCore { using namespace JSC; URLPatternConstructorStringParser::URLPatternConstructorStringParser(String&& input) - : m_input(WTFMove(input)) + : m_input(WTF::move(input)) { } @@ -116,28 +116,28 @@ static inline void setInitComponentFromState(URLPatternInit& init, URLPatternCon { switch (state) { case URLPatternConstructorStringParserState::Protocol: - init.protocol = WTFMove(componentString); + init.protocol = WTF::move(componentString); break; case URLPatternConstructorStringParserState::Username: - init.username = WTFMove(componentString); + init.username = WTF::move(componentString); break; case URLPatternConstructorStringParserState::Password: - init.password = WTFMove(componentString); + init.password = WTF::move(componentString); break; case URLPatternConstructorStringParserState::Hostname: - init.hostname = WTFMove(componentString); + init.hostname = WTF::move(componentString); break; case URLPatternConstructorStringParserState::Port: - init.port = WTFMove(componentString); + init.port = WTF::move(componentString); break; case URLPatternConstructorStringParserState::Pathname: - init.pathname = WTFMove(componentString); + init.pathname = WTF::move(componentString); break; case URLPatternConstructorStringParserState::Search: - init.search = WTFMove(componentString); + init.search = WTF::move(componentString); break; case URLPatternConstructorStringParserState::Hash: - init.hash = WTFMove(componentString); + init.hash = WTF::move(componentString); break; default: break; diff --git a/src/bun.js/bindings/webcore/URLPatternParser.cpp b/src/bun.js/bindings/webcore/URLPatternParser.cpp index 9224932aae..2193dc0396 100644 --- a/src/bun.js/bindings/webcore/URLPatternParser.cpp +++ b/src/bun.js/bindings/webcore/URLPatternParser.cpp @@ -37,7 +37,7 @@ namespace URLPatternUtilities { URLPatternParser::URLPatternParser(EncodingCallbackType type, String&& segmentWildcardRegexp) : m_callbackType(type) - , m_segmentWildcardRegexp(WTFMove(segmentWildcardRegexp)) + , m_segmentWildcardRegexp(WTF::move(segmentWildcardRegexp)) { } @@ -65,7 +65,7 @@ ExceptionOr URLPatternParser::performParse(const URLPatternStringOptions& auto modifierToken = tryToConsumeModifierToken(); - maybeFunctionException = addPart(WTFMove(prefix), nameToken, regexOrWildcardToken, {}, modifierToken); + maybeFunctionException = addPart(WTF::move(prefix), nameToken, regexOrWildcardToken, {}, modifierToken); if (maybeFunctionException.hasException()) return maybeFunctionException.releaseException(); @@ -78,7 +78,7 @@ ExceptionOr URLPatternParser::performParse(const URLPatternStringOptions& fixedToken = tryToConsumeToken(TokenType::EscapedChar); if (!fixedToken.isNull()) { - m_pendingFixedValue.append(WTFMove(fixedToken.value)); + m_pendingFixedValue.append(WTF::move(fixedToken.value)); continue; } @@ -94,7 +94,7 @@ ExceptionOr URLPatternParser::performParse(const URLPatternStringOptions& return maybeCloseError.releaseException(); auto modifierToken = tryToConsumeModifierToken(); - maybeFunctionException = addPart(WTFMove(prefix), nameToken, regexOrWildcardToken, WTFMove(suffix), modifierToken); + maybeFunctionException = addPart(WTF::move(prefix), nameToken, regexOrWildcardToken, WTF::move(suffix), modifierToken); if (maybeFunctionException.hasException()) return maybeFunctionException.releaseException(); @@ -213,7 +213,7 @@ ExceptionOr URLPatternParser::addPart(String&& prefix, const Token& nameTo } if (nameToken.isNull() && regexpOrWildcardToken.isNull() && modifier == Modifier::None) { - m_pendingFixedValue.append(WTFMove(prefix)); + m_pendingFixedValue.append(WTF::move(prefix)); return {}; } @@ -228,7 +228,7 @@ ExceptionOr URLPatternParser::addPart(String&& prefix, const Token& nameTo if (prefix.isEmpty()) return {}; - auto encodedValue = callEncodingCallback(m_callbackType, WTFMove(prefix)); + auto encodedValue = callEncodingCallback(m_callbackType, WTF::move(prefix)); if (encodedValue.hasException()) return encodedValue.releaseException(); @@ -268,15 +268,15 @@ ExceptionOr URLPatternParser::addPart(String&& prefix, const Token& nameTo if (isDuplicateName(name)) return Exception { ExceptionCode::TypeError, "Duplicate name token produced when adding to parser part list."_s }; - auto encodedPrefix = callEncodingCallback(m_callbackType, WTFMove(prefix)); + auto encodedPrefix = callEncodingCallback(m_callbackType, WTF::move(prefix)); if (encodedPrefix.hasException()) return encodedPrefix.releaseException(); - auto encodedSuffix = callEncodingCallback(m_callbackType, WTFMove(suffix)); + auto encodedSuffix = callEncodingCallback(m_callbackType, WTF::move(suffix)); if (encodedSuffix.hasException()) return encodedSuffix.releaseException(); - m_partList.append(Part { type, WTFMove(regexValue), modifier, WTFMove(name), encodedPrefix.releaseReturnValue(), encodedSuffix.releaseReturnValue() }); + m_partList.append(Part { type, WTF::move(regexValue), modifier, WTF::move(name), encodedPrefix.releaseReturnValue(), encodedSuffix.releaseReturnValue() }); return {}; } @@ -424,7 +424,7 @@ std::pair> generateRegexAndNameList(const Vector& p result.append('$'); - return { result.toString(), WTFMove(nameList) }; + return { result.toString(), WTF::move(nameList) }; } // https://urlpattern.spec.whatwg.org/#generate-a-pattern-string diff --git a/src/bun.js/bindings/webcore/URLPatternParser.h b/src/bun.js/bindings/webcore/URLPatternParser.h index 3d942e454c..1f95d0b2e6 100644 --- a/src/bun.js/bindings/webcore/URLPatternParser.h +++ b/src/bun.js/bindings/webcore/URLPatternParser.h @@ -70,7 +70,7 @@ public: URLPatternParser(EncodingCallbackType, String&& segmentWildcardRegexp); ExceptionOr performParse(const URLPatternStringOptions&); - void setTokenList(Vector&& tokenList) { m_tokenList = WTFMove(tokenList); } + void setTokenList(Vector&& tokenList) { m_tokenList = WTF::move(tokenList); } static ExceptionOr> parse(StringView, const URLPatternStringOptions&, EncodingCallbackType); private: diff --git a/src/bun.js/bindings/webcore/URLPatternTokenizer.cpp b/src/bun.js/bindings/webcore/URLPatternTokenizer.cpp index d505f740d0..4c8d87700c 100644 --- a/src/bun.js/bindings/webcore/URLPatternTokenizer.cpp +++ b/src/bun.js/bindings/webcore/URLPatternTokenizer.cpp @@ -266,7 +266,7 @@ ExceptionOr> Tokenizer::tokenize() } addToken(TokenType::End, m_index, m_index); - return WTFMove(m_tokenList); + return WTF::move(m_tokenList); } } // namespace URLPatternUtilities diff --git a/src/bun.js/bindings/webcore/WebSocket.cpp b/src/bun.js/bindings/webcore/WebSocket.cpp index 6ce10f2119..5a85a027b8 100644 --- a/src/bun.js/bindings/webcore/WebSocket.cpp +++ b/src/bun.js/bindings/webcore/WebSocket.cpp @@ -238,7 +238,7 @@ ExceptionOr> WebSocket::create(ScriptExecutionContext& context, c auto socket = adoptRef(*new WebSocket(context)); // socket->suspendIfNeeded(); - auto result = socket->connect(url, protocols, WTFMove(headers)); + auto result = socket->connect(url, protocols, WTF::move(headers)); // auto result = socket->connect(url, protocols); if (result.hasException()) @@ -255,7 +255,7 @@ ExceptionOr> WebSocket::create(ScriptExecutionContext& context, c socket->setRejectUnauthorized(rejectUnauthorized); // socket->suspendIfNeeded(); - auto result = socket->connect(url, protocols, WTFMove(headers)); + auto result = socket->connect(url, protocols, WTF::move(headers)); // auto result = socket->connect(url, protocols); if (result.hasException()) @@ -437,7 +437,7 @@ ExceptionOr WebSocket::connect(const String& url, const Vector& pr Vector headerNames; Vector headerValues; - auto headersOrException = FetchHeaders::create(WTFMove(headersInit)); + auto headersOrException = FetchHeaders::create(WTF::move(headersInit)); if (headersOrException.hasException()) [[unlikely]] { m_state = CLOSED; updateHasPendingActivity(); @@ -479,8 +479,8 @@ ExceptionOr WebSocket::connect(const String& url, const Vector& pr auto eventInit = createErrorEventInit(protectedThis, "Failed to connect"_s, globalObject); auto message = eventInit.message; - protectedThis->dispatchEvent(ErrorEvent::create(eventNames().errorEvent, WTFMove(eventInit), EventIsTrusted::Yes)); - protectedThis->dispatchEvent(CloseEvent::create(false, 1006, WTFMove(message))); + protectedThis->dispatchEvent(ErrorEvent::create(eventNames().errorEvent, WTF::move(eventInit), EventIsTrusted::Yes)); + protectedThis->dispatchEvent(CloseEvent::create(false, 1006, WTF::move(message))); protectedThis->decPendingActivityCount(); }); @@ -493,12 +493,12 @@ ExceptionOr WebSocket::connect(const String& url, const Vector& pr // #if ENABLE(INTELLIGENT_TRACKING_PREVENTION) // auto reportRegistrableDomain = [domain = RegistrableDomain(m_url).isolatedCopy()](auto& context) mutable { // if (auto* frame = downcast(context).frame()) - // frame->loader().client().didLoadFromRegistrableDomain(WTFMove(domain)); + // frame->loader().client().didLoadFromRegistrableDomain(WTF::move(domain)); // }; // if (is(context)) // reportRegistrableDomain(context); // else - // downcast(context).thread().workerLoaderProxy().postTaskToLoader(WTFMove(reportRegistrableDomain)); + // downcast(context).thread().workerLoaderProxy().postTaskToLoader(WTF::move(reportRegistrableDomain)); // #endif // m_pendingActivity = makePendingActivity(*this); @@ -1069,7 +1069,7 @@ void WebSocket::didConnect() void WebSocket::didReceiveMessage(String&& message) { // LOG(Network, "WebSocket %p didReceiveMessage() Text message '%s'", this, message.utf8().data()); - // queueTaskKeepingObjectAlive(*this, TaskSource::WebSocket, [this, message = WTFMove(message)]() mutable { + // queueTaskKeepingObjectAlive(*this, TaskSource::WebSocket, [this, message = WTF::move(message)]() mutable { if (m_state != OPEN) return; @@ -1083,14 +1083,14 @@ void WebSocket::didReceiveMessage(String&& message) if (this->hasEventListeners("message"_s)) { // the main reason for dispatching on a separate tick is to handle when you haven't yet attached an event listener this->incPendingActivityCount(); - dispatchEvent(MessageEvent::create(WTFMove(message), m_url.string())); + dispatchEvent(MessageEvent::create(WTF::move(message), m_url.string())); this->decPendingActivityCount(); return; } if (auto* context = scriptExecutionContext()) { this->incPendingActivityCount(); - context->postTask([this, message_ = WTFMove(message), protectedThis = Ref { *this }](ScriptExecutionContext& context) { + context->postTask([this, message_ = WTF::move(message), protectedThis = Ref { *this }](ScriptExecutionContext& context) { ASSERT(scriptExecutionContext()); protectedThis->dispatchEvent(MessageEvent::create(message_, protectedThis->m_url.string())); protectedThis->decPendingActivityCount(); @@ -1103,7 +1103,7 @@ void WebSocket::didReceiveMessage(String&& message) void WebSocket::didReceiveBinaryData(const AtomString& eventName, const std::span binaryData) { // LOG(Network, "WebSocket %p didReceiveBinaryData() %u byte binary message", this, static_cast(binaryData.size())); - // queueTaskKeepingObjectAlive(*this, TaskSource::WebSocket, [this, binaryData = WTFMove(binaryData)]() mutable { + // queueTaskKeepingObjectAlive(*this, TaskSource::WebSocket, [this, binaryData = WTF::move(binaryData)]() mutable { if (m_state != OPEN) return; @@ -1144,7 +1144,7 @@ void WebSocket::didReceiveBinaryData(const AtomString& eventName, const std::spa if (auto* context = scriptExecutionContext()) { auto arrayBuffer = JSC::ArrayBuffer::create(binaryData); this->incPendingActivityCount(); - context->postTask([this, name = eventName, buffer = WTFMove(arrayBuffer), protectedThis = Ref { *this }](ScriptExecutionContext& context) { + context->postTask([this, name = eventName, buffer = WTF::move(arrayBuffer), protectedThis = Ref { *this }](ScriptExecutionContext& context) { ASSERT(scriptExecutionContext()); protectedThis->dispatchEvent(MessageEvent::create(name, buffer, m_url.string())); protectedThis->decPendingActivityCount(); @@ -1176,7 +1176,7 @@ void WebSocket::didReceiveBinaryData(const AtomString& eventName, const std::spa init.data = buffer; init.origin = this->m_url.string(); - dispatchEvent(MessageEvent::create(eventName, WTFMove(init), EventIsTrusted::Yes)); + dispatchEvent(MessageEvent::create(eventName, WTF::move(init), EventIsTrusted::Yes)); this->decPendingActivityCount(); return; } @@ -1186,7 +1186,7 @@ void WebSocket::didReceiveBinaryData(const AtomString& eventName, const std::spa this->incPendingActivityCount(); - context->postTask([name = eventName, buffer = WTFMove(arrayBuffer), protectedThis = Ref { *this }](ScriptExecutionContext& context) { + context->postTask([name = eventName, buffer = WTF::move(arrayBuffer), protectedThis = Ref { *this }](ScriptExecutionContext& context) { size_t length = buffer->byteLength(); auto* globalObject = context.jsGlobalObject(); auto* subclassStructure = static_cast(globalObject)->JSBufferSubclassStructure(); @@ -1195,7 +1195,7 @@ void WebSocket::didReceiveBinaryData(const AtomString& eventName, const std::spa MessageEvent::Init init; init.data = uint8array; init.origin = protectedThis->m_url.string(); - protectedThis->dispatchEvent(MessageEvent::create(name, WTFMove(init), EventIsTrusted::Yes)); + protectedThis->dispatchEvent(MessageEvent::create(name, WTF::move(init), EventIsTrusted::Yes)); protectedThis->decPendingActivityCount(); }); } @@ -1209,7 +1209,7 @@ void WebSocket::didReceiveBinaryData(const AtomString& eventName, const std::spa void WebSocket::didReceiveClose(CleanStatus wasClean, unsigned short code, WTF::String reason, bool isConnectionError) { // LOG(Network, "WebSocket %p didReceiveErrorMessage()", this); - // queueTaskKeepingObjectAlive(*this, TaskSource::WebSocket, [this, reason = WTFMove(reason)] { + // queueTaskKeepingObjectAlive(*this, TaskSource::WebSocket, [this, reason = WTF::move(reason)] { if (m_state == CLOSED) return; const bool wasConnecting = m_state == CONNECTING; @@ -1218,7 +1218,7 @@ void WebSocket::didReceiveClose(CleanStatus wasClean, unsigned short code, WTF:: this->incPendingActivityCount(); if (wasConnecting && isConnectionError) { auto eventInit = createErrorEventInit(*this, reason, context->jsGlobalObject()); - dispatchEvent(ErrorEvent::create(eventNames().errorEvent, WTFMove(eventInit), EventIsTrusted::Yes)); + dispatchEvent(ErrorEvent::create(eventNames().errorEvent, WTF::move(eventInit), EventIsTrusted::Yes)); } // https://html.spec.whatwg.org/multipage/web-sockets.html#feedback-from-the-protocol:concept-websocket-closed, we should synchronously fire a close event. dispatchEvent(CloseEvent::create(wasClean == CleanStatus::Clean, code, reason)); @@ -1517,13 +1517,13 @@ extern "C" void WebSocket__didAbruptClose(WebCore::WebSocket* webSocket, Bun::We extern "C" void WebSocket__didClose(WebCore::WebSocket* webSocket, uint16_t errorCode, BunString* reason) { WTF::String wtf_reason = reason->transferToWTFString(); - webSocket->didClose(0, errorCode, WTFMove(wtf_reason)); + webSocket->didClose(0, errorCode, WTF::move(wtf_reason)); } extern "C" void WebSocket__didReceiveText(WebCore::WebSocket* webSocket, bool clone, const ZigString* str) { WTF::String wtf_str = clone ? Zig::toStringCopy(*str) : Zig::toString(*str); - webSocket->didReceiveMessage(WTFMove(wtf_str)); + webSocket->didReceiveMessage(WTF::move(wtf_str)); } extern "C" void WebSocket__didReceiveBytes(WebCore::WebSocket* webSocket, const uint8_t* bytes, size_t len, const uint8_t op) { diff --git a/src/bun.js/bindings/webcore/Worker.cpp b/src/bun.js/bindings/webcore/Worker.cpp index 3891d6fba3..8db7b462b3 100644 --- a/src/bun.js/bindings/webcore/Worker.cpp +++ b/src/bun.js/bindings/webcore/Worker.cpp @@ -94,7 +94,7 @@ void Worker::networkStateChanged(bool isOnline) Worker::Worker(ScriptExecutionContext& context, WorkerOptions&& options) : EventTargetWithInlineData() , ContextDestructionObserver(&context) - , m_options(WTFMove(options)) + , m_options(WTF::move(options)) , m_identifier(makeString("worker:"_s, Inspector::IdentifiersFactory::createIdentifier())) , m_clientIdentifier(ScriptExecutionContext::generateIdentifier()) { @@ -149,7 +149,7 @@ bool Worker::updatePtr() ExceptionOr> Worker::create(ScriptExecutionContext& context, const String& urlInit, WorkerOptions&& options) { - auto worker = adoptRef(*new Worker(context, WTFMove(options))); + auto worker = adoptRef(*new Worker(context, WTF::move(options))); WTF::String url = urlInit; if (url.startsWith("file://"_s)) { @@ -237,22 +237,22 @@ ExceptionOr Worker::postMessage(JSC::JSGlobalObject& state, JSC::JSValue m return Exception { InvalidStateError, "Worker has been terminated"_s }; Vector> ports; - auto serialized = SerializedScriptValue::create(state, messageValue, WTFMove(options.transfer), ports, SerializationForStorage::No, SerializationContext::WorkerPostMessage); + auto serialized = SerializedScriptValue::create(state, messageValue, WTF::move(options.transfer), ports, SerializationForStorage::No, SerializationContext::WorkerPostMessage); if (serialized.hasException()) return serialized.releaseException(); - ExceptionOr> disentangledPorts = MessagePort::disentanglePorts(WTFMove(ports)); + ExceptionOr> disentangledPorts = MessagePort::disentanglePorts(WTF::move(ports)); if (disentangledPorts.hasException()) { return disentangledPorts.releaseException(); } MessageWithMessagePorts messageWithMessagePorts { serialized.releaseReturnValue(), disentangledPorts.releaseReturnValue() }; - this->postTaskToWorkerGlobalScope([message = WTFMove(messageWithMessagePorts)](auto& context) mutable { + this->postTaskToWorkerGlobalScope([message = WTF::move(messageWithMessagePorts)](auto& context) mutable { Zig::GlobalObject* globalObject = jsCast(context.jsGlobalObject()); - auto ports = MessagePort::entanglePorts(context, WTFMove(message.transferredPorts)); - auto event = MessageEvent::create(*globalObject, message.message.releaseNonNull(), nullptr, WTFMove(ports)); + auto ports = MessagePort::entanglePorts(context, WTF::move(message.transferredPorts)); + auto event = MessageEvent::create(*globalObject, message.message.releaseNonNull(), nullptr, WTF::move(ports)); globalObject->globalEventScope->dispatchEvent(event.event); }); @@ -336,8 +336,8 @@ void Worker::createRTCRtpScriptTransformer(RTCRtpScriptTransform& transform, Mes if (!scriptExecutionContext()) return; - m_contextProxy.postTaskToWorkerGlobalScope([transform = Ref { transform }, options = WTFMove(options)](auto& context) mutable { - if (auto transformer = downcast(context).createRTCRtpScriptTransformer(WTFMove(options))) + m_contextProxy.postTaskToWorkerGlobalScope([transform = Ref { transform }, options = WTF::move(options)](auto& context) mutable { + if (auto transformer = downcast(context).createRTCRtpScriptTransformer(WTF::move(options))) transform->setTransformer(*transformer); }); } @@ -347,7 +347,7 @@ void Worker::drainEvents() { Locker lock(this->m_pendingTasksMutex); for (auto& task : m_pendingTasks) - postTaskToWorkerGlobalScope(WTFMove(task)); + postTaskToWorkerGlobalScope(WTF::move(task)); m_pendingTasks.clear(); } @@ -386,7 +386,7 @@ void Worker::fireEarlyMessages(Zig::GlobalObject* workerGlobalObject) task(*thisContext); } } else { - thisContext->postTask([tasks = WTFMove(tasks)](auto& ctx) mutable { + thisContext->postTask([tasks = WTF::move(tasks)](auto& ctx) mutable { for (auto& task : tasks) { task(ctx); } @@ -451,11 +451,11 @@ void Worker::postTaskToWorkerGlobalScope(Function { if (!(m_onlineClosingFlags & OnlineFlag)) { Locker lock(this->m_pendingTasksMutex); - this->m_pendingTasks.append(WTFMove(task)); + this->m_pendingTasks.append(WTF::move(task)); return; } - ScriptExecutionContext::postTaskTo(m_clientIdentifier, WTFMove(task)); + ScriptExecutionContext::postTaskTo(m_clientIdentifier, WTF::move(task)); } void Worker::forEachWorker(const Function()>& callback) @@ -565,9 +565,9 @@ JSValue createNodeWorkerThreadsBinding(Zig::GlobalObject* globalObject) if (auto* worker = WebWorker__getParentWorker(globalObject->bunVM())) { auto& options = worker->options(); - auto ports = MessagePort::entanglePorts(*ScriptExecutionContext::getScriptExecutionContext(worker->clientIdentifier()), WTFMove(options.dataMessagePorts)); - RefPtr serialized = WTFMove(options.workerDataAndEnvironmentData); - JSValue deserialized = serialized->deserialize(*globalObject, globalObject, WTFMove(ports)); + auto ports = MessagePort::entanglePorts(*ScriptExecutionContext::getScriptExecutionContext(worker->clientIdentifier()), WTF::move(options.dataMessagePorts)); + RefPtr serialized = WTF::move(options.workerDataAndEnvironmentData); + JSValue deserialized = serialized->deserialize(*globalObject, globalObject, WTF::move(ports)); RETURN_IF_EXCEPTION(scope, {}); // Should always be set to an Array of length 2 in the constructor in JSWorker.cpp auto* pair = jsCast(deserialized); @@ -644,14 +644,14 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionPostMessage, } Vector> ports; - ExceptionOr> serialized = SerializedScriptValue::create(*globalObject, value, WTFMove(transferList), ports, SerializationForStorage::No, SerializationContext::WorkerPostMessage); + ExceptionOr> serialized = SerializedScriptValue::create(*globalObject, value, WTF::move(transferList), ports, SerializationForStorage::No, SerializationContext::WorkerPostMessage); if (serialized.hasException()) { WebCore::propagateException(*globalObject, scope, serialized.releaseException()); RELEASE_AND_RETURN(scope, {}); } scope.assertNoException(); - ExceptionOr> disentangledPorts = MessagePort::disentanglePorts(WTFMove(ports)); + ExceptionOr> disentangledPorts = MessagePort::disentanglePorts(WTF::move(ports)); if (disentangledPorts.hasException()) { WebCore::propagateException(*globalObject, scope, serialized.releaseException()); RELEASE_AND_RETURN(scope, {}); @@ -663,8 +663,8 @@ JSC_DEFINE_HOST_FUNCTION(jsFunctionPostMessage, ScriptExecutionContext::postTaskTo(context->identifier(), [message = messageWithMessagePorts, protectedThis = Ref { *worker }, ports](ScriptExecutionContext& context) mutable { Zig::GlobalObject* globalObject = jsCast(context.jsGlobalObject()); - auto ports = MessagePort::entanglePorts(context, WTFMove(message.transferredPorts)); - auto event = MessageEvent::create(*globalObject, message.message.releaseNonNull(), nullptr, WTFMove(ports)); + auto ports = MessagePort::entanglePorts(context, WTF::move(message.transferredPorts)); + auto event = MessageEvent::create(*globalObject, message.message.releaseNonNull(), nullptr, WTF::move(ports)); protectedThis->dispatchEvent(event.event); }); diff --git a/src/bun.js/bindings/webcore/WritableStream.cpp b/src/bun.js/bindings/webcore/WritableStream.cpp index 97d56b4761..d0c06376a9 100644 --- a/src/bun.js/bindings/webcore/WritableStream.cpp +++ b/src/bun.js/bindings/webcore/WritableStream.cpp @@ -55,16 +55,16 @@ ExceptionOr> WritableStream::create(JSC::JSGlobalObject& glo ExceptionOr> WritableStream::create(JSDOMGlobalObject& globalObject, Ref&& sink) { - return create(globalObject, toJSNewlyCreated(&globalObject, &globalObject, WTFMove(sink)), JSC::jsUndefined()); + return create(globalObject, toJSNewlyCreated(&globalObject, &globalObject, WTF::move(sink)), JSC::jsUndefined()); } Ref WritableStream::create(Ref&& internalWritableStream) { - return adoptRef(*new WritableStream(WTFMove(internalWritableStream))); + return adoptRef(*new WritableStream(WTF::move(internalWritableStream))); } WritableStream::WritableStream(Ref&& internalWritableStream) - : m_internalWritableStream(WTFMove(internalWritableStream)) + : m_internalWritableStream(WTF::move(internalWritableStream)) { } diff --git a/src/bun.js/bindings/webcore/WritableStreamSink.h b/src/bun.js/bindings/webcore/WritableStreamSink.h index b15e34d91e..2b20494fff 100644 --- a/src/bun.js/bindings/webcore/WritableStreamSink.h +++ b/src/bun.js/bindings/webcore/WritableStreamSink.h @@ -47,7 +47,7 @@ public: class SimpleWritableStreamSink : public WritableStreamSink { public: using WriteCallback = Function(ScriptExecutionContext&, JSC::JSValue)>; - static Ref create(WriteCallback&& writeCallback) { return adoptRef(*new SimpleWritableStreamSink(WTFMove(writeCallback))); } + static Ref create(WriteCallback&& writeCallback) { return adoptRef(*new SimpleWritableStreamSink(WTF::move(writeCallback))); } private: explicit SimpleWritableStreamSink(WriteCallback&&); @@ -60,7 +60,7 @@ private: }; inline SimpleWritableStreamSink::SimpleWritableStreamSink(WriteCallback&& writeCallback) - : m_writeCallback(WTFMove(writeCallback)) + : m_writeCallback(WTF::move(writeCallback)) { } diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithm.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithm.cpp index 318a8e15be..0fd57c8e61 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithm.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithm.cpp @@ -96,9 +96,9 @@ template static void dispatchAlgorithmOperation(WorkQueue& workQueue, ScriptExecutionContext& context, ResultCallbackType&& callback, CryptoAlgorithm::ExceptionCallback&& exceptionCallback, OperationType&& operation) { workQueue.dispatch(context.globalObject(), - [operation = WTFMove(operation), callback = WTFMove(callback), exceptionCallback = WTFMove(exceptionCallback), contextIdentifier = context.identifier()]() mutable { + [operation = WTF::move(operation), callback = WTF::move(callback), exceptionCallback = WTF::move(exceptionCallback), contextIdentifier = context.identifier()]() mutable { auto result = operation(); - ScriptExecutionContext::postTaskTo(contextIdentifier, [result = crossThreadCopy(WTFMove(result)), callback = WTFMove(callback), exceptionCallback = WTFMove(exceptionCallback)](auto& context) mutable { + ScriptExecutionContext::postTaskTo(contextIdentifier, [result = crossThreadCopy(WTF::move(result)), callback = WTF::move(callback), exceptionCallback = WTF::move(exceptionCallback)](auto& context) mutable { if (result.hasException()) { exceptionCallback(result.releaseException().code(), ""_s); return; @@ -110,12 +110,12 @@ static void dispatchAlgorithmOperation(WorkQueue& workQueue, ScriptExecutionCont void CryptoAlgorithm::dispatchOperationInWorkQueue(WorkQueue& workQueue, ScriptExecutionContext& context, VectorCallback&& callback, ExceptionCallback&& exceptionCallback, Function>()>&& operation) { - dispatchAlgorithmOperation(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), WTFMove(operation)); + dispatchAlgorithmOperation(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), WTF::move(operation)); } void CryptoAlgorithm::dispatchOperationInWorkQueue(WorkQueue& workQueue, ScriptExecutionContext& context, BoolCallback&& callback, ExceptionCallback&& exceptionCallback, Function()>&& operation) { - dispatchAlgorithmOperation(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), WTFMove(operation)); + dispatchAlgorithmOperation(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), WTF::move(operation)); } } diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CBC.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CBC.cpp index 585ed77c2f..7611b719a3 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CBC.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CBC.cpp @@ -67,8 +67,8 @@ void CryptoAlgorithmAES_CBC::encrypt(const CryptoAlgorithmParameters& parameters return; } - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [parameters = crossThreadCopy(aesParameters), key = WTFMove(key), plainText = WTFMove(plainText)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [parameters = crossThreadCopy(aesParameters), key = WTF::move(key), plainText = WTF::move(plainText)] { return platformEncrypt(parameters, downcast(key.get()), plainText); }); } @@ -83,8 +83,8 @@ void CryptoAlgorithmAES_CBC::decrypt(const CryptoAlgorithmParameters& parameters return; } - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [parameters = crossThreadCopy(aesParameters), key = WTFMove(key), cipherText = WTFMove(cipherText)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [parameters = crossThreadCopy(aesParameters), key = WTF::move(key), cipherText = WTF::move(cipherText)] { return platformDecrypt(parameters, downcast(key.get()), cipherText); }); } @@ -104,7 +104,7 @@ void CryptoAlgorithmAES_CBC::generateKey(const CryptoAlgorithmParameters& parame return; } - callback(WTFMove(result)); + callback(WTF::move(result)); } void CryptoAlgorithmAES_CBC::importKey(CryptoKeyFormat format, KeyData&& data, const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback) @@ -119,7 +119,7 @@ void CryptoAlgorithmAES_CBC::importKey(CryptoKeyFormat format, KeyData&& data, c RefPtr result; switch (format) { case CryptoKeyFormat::Raw: - result = CryptoKeyAES::importRaw(parameters.identifier, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyAES::importRaw(parameters.identifier, WTF::move(std::get>(data)), extractable, usages); break; case CryptoKeyFormat::Jwk: { auto checkAlgCallback = [](size_t length, const String& alg) -> bool { @@ -133,7 +133,7 @@ void CryptoAlgorithmAES_CBC::importKey(CryptoKeyFormat format, KeyData&& data, c } return false; }; - result = CryptoKeyAES::importJwk(parameters.identifier, WTFMove(std::get(data)), extractable, usages, WTFMove(checkAlgCallback)); + result = CryptoKeyAES::importJwk(parameters.identifier, WTF::move(std::get(data)), extractable, usages, WTF::move(checkAlgCallback)); break; } default: @@ -178,7 +178,7 @@ void CryptoAlgorithmAES_CBC::exportKey(CryptoKeyFormat format, Ref&& default: ASSERT_NOT_REACHED(); } - result = WTFMove(jwk); + result = WTF::move(jwk); break; } default: @@ -186,7 +186,7 @@ void CryptoAlgorithmAES_CBC::exportKey(CryptoKeyFormat format, Ref&& return; } - callback(format, WTFMove(result)); + callback(format, WTF::move(result)); } ExceptionOr CryptoAlgorithmAES_CBC::getKeyLength(const CryptoAlgorithmParameters& parameters) diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CBCOpenSSL.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CBCOpenSSL.cpp index b6dd15c01c..793b97da88 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CBCOpenSSL.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CBCOpenSSL.cpp @@ -122,7 +122,7 @@ ExceptionOr> CryptoAlgorithmAES_CBC::platformEncrypt(const Crypt auto output = cryptEncrypt(key.key(), parameters.ivVector(), Vector(plainText)); if (!output) return Exception { OperationError }; - return WTFMove(*output); + return WTF::move(*output); } ExceptionOr> CryptoAlgorithmAES_CBC::platformDecrypt(const CryptoAlgorithmAesCbcCfbParams& parameters, const CryptoKeyAES& key, const Vector& cipherText, Padding) @@ -130,7 +130,7 @@ ExceptionOr> CryptoAlgorithmAES_CBC::platformDecrypt(const Crypt auto output = cryptDecrypt(key.key(), parameters.ivVector(), cipherText); if (!output) return Exception { OperationError }; - return WTFMove(*output); + return WTF::move(*output); } } // namespace WebCore diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CFB.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CFB.cpp index 34b7afe92b..7d18189bce 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CFB.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CFB.cpp @@ -67,8 +67,8 @@ void CryptoAlgorithmAES_CFB::encrypt(const CryptoAlgorithmParameters& parameters return; } - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [parameters = crossThreadCopy(aesParameters), key = WTFMove(key), plainText = WTFMove(plainText)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [parameters = crossThreadCopy(aesParameters), key = WTF::move(key), plainText = WTF::move(plainText)] { return platformEncrypt(parameters, downcast(key.get()), plainText); }); } @@ -83,8 +83,8 @@ void CryptoAlgorithmAES_CFB::decrypt(const CryptoAlgorithmParameters& parameters return; } - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [parameters = crossThreadCopy(aesParameters), key = WTFMove(key), cipherText = WTFMove(cipherText)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [parameters = crossThreadCopy(aesParameters), key = WTF::move(key), cipherText = WTF::move(cipherText)] { return platformDecrypt(parameters, downcast(key.get()), cipherText); }); } @@ -104,7 +104,7 @@ void CryptoAlgorithmAES_CFB::generateKey(const CryptoAlgorithmParameters& parame return; } - callback(WTFMove(result)); + callback(WTF::move(result)); } void CryptoAlgorithmAES_CFB::importKey(CryptoKeyFormat format, KeyData&& data, const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback) @@ -119,7 +119,7 @@ void CryptoAlgorithmAES_CFB::importKey(CryptoKeyFormat format, KeyData&& data, c RefPtr result; switch (format) { case CryptoKeyFormat::Raw: - result = CryptoKeyAES::importRaw(parameters.identifier, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyAES::importRaw(parameters.identifier, WTF::move(std::get>(data)), extractable, usages); break; case CryptoKeyFormat::Jwk: { auto checkAlgCallback = [](size_t length, const String& alg) -> bool { @@ -133,7 +133,7 @@ void CryptoAlgorithmAES_CFB::importKey(CryptoKeyFormat format, KeyData&& data, c } return false; }; - result = CryptoKeyAES::importJwk(parameters.identifier, WTFMove(std::get(data)), extractable, usages, WTFMove(checkAlgCallback)); + result = CryptoKeyAES::importJwk(parameters.identifier, WTF::move(std::get(data)), extractable, usages, WTF::move(checkAlgCallback)); break; } default: @@ -178,7 +178,7 @@ void CryptoAlgorithmAES_CFB::exportKey(CryptoKeyFormat format, Ref&& default: ASSERT_NOT_REACHED(); } - result = WTFMove(jwk); + result = WTF::move(jwk); break; } default: @@ -186,7 +186,7 @@ void CryptoAlgorithmAES_CFB::exportKey(CryptoKeyFormat format, Ref&& return; } - callback(format, WTFMove(result)); + callback(format, WTF::move(result)); } ExceptionOr CryptoAlgorithmAES_CFB::getKeyLength(const CryptoAlgorithmParameters& parameters) diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CFBOpenSSL.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CFBOpenSSL.cpp index 4de16b439c..3cab769697 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CFBOpenSSL.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CFBOpenSSL.cpp @@ -89,7 +89,7 @@ ExceptionOr> CryptoAlgorithmAES_CFB::platformEncrypt(const Crypt auto output = cryptEncrypt(key.key(), parameters.ivVector(), Vector(plainText)); if (!output) return Exception { OperationError }; - return WTFMove(*output); + return WTF::move(*output); } ExceptionOr> CryptoAlgorithmAES_CFB::platformDecrypt(const CryptoAlgorithmAesCbcCfbParams& parameters, const CryptoKeyAES& key, const Vector& cipherText) @@ -97,7 +97,7 @@ ExceptionOr> CryptoAlgorithmAES_CFB::platformDecrypt(const Crypt auto output = cryptDecrypt(key.key(), parameters.ivVector(), cipherText); if (!output) return Exception { OperationError }; - return WTFMove(*output); + return WTF::move(*output); } } // namespace WebCore diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CTR.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CTR.cpp index 8902fb3c24..5e3d440ad7 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CTR.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CTR.cpp @@ -78,8 +78,8 @@ void CryptoAlgorithmAES_CTR::encrypt(const CryptoAlgorithmParameters& parameters return; } - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [parameters = crossThreadCopy(aesParameters), key = WTFMove(key), plainText = WTFMove(plainText)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [parameters = crossThreadCopy(aesParameters), key = WTF::move(key), plainText = WTF::move(plainText)] { return platformEncrypt(parameters, downcast(key.get()), plainText); }); } @@ -92,8 +92,8 @@ void CryptoAlgorithmAES_CTR::decrypt(const CryptoAlgorithmParameters& parameters return; } - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [parameters = crossThreadCopy(aesParameters), key = WTFMove(key), cipherText = WTFMove(cipherText)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [parameters = crossThreadCopy(aesParameters), key = WTF::move(key), cipherText = WTF::move(cipherText)] { return platformDecrypt(parameters, downcast(key.get()), cipherText); }); } @@ -113,7 +113,7 @@ void CryptoAlgorithmAES_CTR::generateKey(const CryptoAlgorithmParameters& parame return; } - callback(WTFMove(result)); + callback(WTF::move(result)); } void CryptoAlgorithmAES_CTR::importKey(CryptoKeyFormat format, KeyData&& data, const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback) @@ -128,7 +128,7 @@ void CryptoAlgorithmAES_CTR::importKey(CryptoKeyFormat format, KeyData&& data, c RefPtr result; switch (format) { case CryptoKeyFormat::Raw: - result = CryptoKeyAES::importRaw(parameters.identifier, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyAES::importRaw(parameters.identifier, WTF::move(std::get>(data)), extractable, usages); break; case CryptoKeyFormat::Jwk: { auto checkAlgCallback = [](size_t length, const String& alg) -> bool { @@ -142,7 +142,7 @@ void CryptoAlgorithmAES_CTR::importKey(CryptoKeyFormat format, KeyData&& data, c } return false; }; - result = CryptoKeyAES::importJwk(parameters.identifier, WTFMove(std::get(data)), extractable, usages, WTFMove(checkAlgCallback)); + result = CryptoKeyAES::importJwk(parameters.identifier, WTF::move(std::get(data)), extractable, usages, WTF::move(checkAlgCallback)); break; } default: @@ -187,7 +187,7 @@ void CryptoAlgorithmAES_CTR::exportKey(CryptoKeyFormat format, Ref&& default: ASSERT_NOT_REACHED(); } - result = WTFMove(jwk); + result = WTF::move(jwk); break; } default: @@ -195,7 +195,7 @@ void CryptoAlgorithmAES_CTR::exportKey(CryptoKeyFormat format, Ref&& return; } - callback(format, WTFMove(result)); + callback(format, WTF::move(result)); } ExceptionOr CryptoAlgorithmAES_CTR::getKeyLength(const CryptoAlgorithmParameters& parameters) diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CTROpenSSL.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CTROpenSSL.cpp index ead077e8f7..fbbebef8d3 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CTROpenSSL.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_CTROpenSSL.cpp @@ -129,7 +129,7 @@ ExceptionOr> CryptoAlgorithmAES_CTR::platformEncrypt(const Crypt auto output = crypt(1, key.key(), parameters.counterVector(), parameters.length, plainText); if (!output) return Exception { OperationError }; - return WTFMove(*output); + return WTF::move(*output); } ExceptionOr> CryptoAlgorithmAES_CTR::platformDecrypt(const CryptoAlgorithmAesCtrParams& parameters, const CryptoKeyAES& key, const Vector& cipherText) @@ -137,7 +137,7 @@ ExceptionOr> CryptoAlgorithmAES_CTR::platformDecrypt(const Crypt auto output = crypt(0, key.key(), parameters.counterVector(), parameters.length, cipherText); if (!output) return Exception { OperationError }; - return WTFMove(*output); + return WTF::move(*output); } } // namespace WebCore diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_GCM.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_GCM.cpp index af4b982fa7..0340d3bedf 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_GCM.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_GCM.cpp @@ -98,8 +98,8 @@ void CryptoAlgorithmAES_GCM::encrypt(const CryptoAlgorithmParameters& parameters return; } - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [parameters = crossThreadCopy(aesParameters), key = WTFMove(key), plainText = WTFMove(plainText)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [parameters = crossThreadCopy(aesParameters), key = WTF::move(key), plainText = WTF::move(plainText)] { return platformEncrypt(parameters, downcast(key.get()), plainText); }); } @@ -131,8 +131,8 @@ void CryptoAlgorithmAES_GCM::decrypt(const CryptoAlgorithmParameters& parameters } #endif - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [parameters = crossThreadCopy(aesParameters), key = WTFMove(key), cipherText = WTFMove(cipherText)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [parameters = crossThreadCopy(aesParameters), key = WTF::move(key), cipherText = WTF::move(cipherText)] { return platformDecrypt(parameters, downcast(key.get()), cipherText); }); } @@ -152,7 +152,7 @@ void CryptoAlgorithmAES_GCM::generateKey(const CryptoAlgorithmParameters& parame return; } - callback(WTFMove(result)); + callback(WTF::move(result)); } void CryptoAlgorithmAES_GCM::importKey(CryptoKeyFormat format, KeyData&& data, const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback) @@ -167,7 +167,7 @@ void CryptoAlgorithmAES_GCM::importKey(CryptoKeyFormat format, KeyData&& data, c RefPtr result; switch (format) { case CryptoKeyFormat::Raw: - result = CryptoKeyAES::importRaw(parameters.identifier, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyAES::importRaw(parameters.identifier, WTF::move(std::get>(data)), extractable, usages); break; case CryptoKeyFormat::Jwk: { auto checkAlgCallback = [](size_t length, const String& alg) -> bool { @@ -181,7 +181,7 @@ void CryptoAlgorithmAES_GCM::importKey(CryptoKeyFormat format, KeyData&& data, c } return false; }; - result = CryptoKeyAES::importJwk(parameters.identifier, WTFMove(std::get(data)), extractable, usages, WTFMove(checkAlgCallback)); + result = CryptoKeyAES::importJwk(parameters.identifier, WTF::move(std::get(data)), extractable, usages, WTF::move(checkAlgCallback)); break; } default: @@ -226,7 +226,7 @@ void CryptoAlgorithmAES_GCM::exportKey(CryptoKeyFormat format, Ref&& default: ASSERT_NOT_REACHED(); } - result = WTFMove(jwk); + result = WTF::move(jwk); break; } default: @@ -234,7 +234,7 @@ void CryptoAlgorithmAES_GCM::exportKey(CryptoKeyFormat format, Ref&& return; } - callback(format, WTFMove(result)); + callback(format, WTF::move(result)); } ExceptionOr CryptoAlgorithmAES_GCM::getKeyLength(const CryptoAlgorithmParameters& parameters) diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_GCMOpenSSL.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_GCMOpenSSL.cpp index a077f38fa3..f65f45e505 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_GCMOpenSSL.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_GCMOpenSSL.cpp @@ -171,7 +171,7 @@ ExceptionOr> CryptoAlgorithmAES_GCM::platformEncrypt(const Crypt auto output = cryptEncrypt(key.key(), parameters.ivVector(), plainText, parameters.additionalDataVector(), parameters.tagLength.value_or(0) / 8); if (!output) return Exception { OperationError }; - return WTFMove(*output); + return WTF::move(*output); } ExceptionOr> CryptoAlgorithmAES_GCM::platformDecrypt(const CryptoAlgorithmAesGcmParams& parameters, const CryptoKeyAES& key, const Vector& cipherText) @@ -179,7 +179,7 @@ ExceptionOr> CryptoAlgorithmAES_GCM::platformDecrypt(const Crypt auto output = cryptDecrypt(key.key(), parameters.ivVector(), cipherText, parameters.additionalDataVector(), parameters.tagLength.value_or(0) / 8); if (!output) return Exception { OperationError }; - return WTFMove(*output); + return WTF::move(*output); } } // namespace WebCore diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_KW.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_KW.cpp index c748c89254..ffb2a14ad0 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_KW.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_KW.cpp @@ -68,7 +68,7 @@ void CryptoAlgorithmAES_KW::generateKey(const CryptoAlgorithmParameters& paramet return; } - callback(WTFMove(result)); + callback(WTF::move(result)); } void CryptoAlgorithmAES_KW::importKey(CryptoKeyFormat format, KeyData&& data, const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback) @@ -83,10 +83,10 @@ void CryptoAlgorithmAES_KW::importKey(CryptoKeyFormat format, KeyData&& data, co RefPtr result; switch (format) { case CryptoKeyFormat::Raw: - result = CryptoKeyAES::importRaw(parameters.identifier, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyAES::importRaw(parameters.identifier, WTF::move(std::get>(data)), extractable, usages); break; case CryptoKeyFormat::Jwk: { - result = CryptoKeyAES::importJwk(parameters.identifier, WTFMove(std::get(data)), extractable, usages, [](size_t length, const String& alg) -> bool { + result = CryptoKeyAES::importJwk(parameters.identifier, WTF::move(std::get(data)), extractable, usages, [](size_t length, const String& alg) -> bool { switch (length) { case CryptoKeyAES::s_length128: return alg.isNull() || alg == ALG128; @@ -141,7 +141,7 @@ void CryptoAlgorithmAES_KW::exportKey(CryptoKeyFormat format, Ref&& k default: ASSERT_NOT_REACHED(); } - result = WTFMove(jwk); + result = WTF::move(jwk); break; } default: @@ -149,7 +149,7 @@ void CryptoAlgorithmAES_KW::exportKey(CryptoKeyFormat format, Ref&& k return; } - callback(format, WTFMove(result)); + callback(format, WTF::move(result)); } void CryptoAlgorithmAES_KW::wrapKey(Ref&& key, Vector&& data, VectorCallback&& callback, ExceptionCallback&& exceptionCallback) @@ -159,7 +159,7 @@ void CryptoAlgorithmAES_KW::wrapKey(Ref&& key, Vector&& data return; } - auto result = platformWrapKey(downcast(key.get()), WTFMove(data)); + auto result = platformWrapKey(downcast(key.get()), WTF::move(data)); if (result.hasException()) { exceptionCallback(result.releaseException().code(), ""_s); return; @@ -170,7 +170,7 @@ void CryptoAlgorithmAES_KW::wrapKey(Ref&& key, Vector&& data void CryptoAlgorithmAES_KW::unwrapKey(Ref&& key, Vector&& data, VectorCallback&& callback, ExceptionCallback&& exceptionCallback) { - auto result = platformUnwrapKey(downcast(key.get()), WTFMove(data)); + auto result = platformUnwrapKey(downcast(key.get()), WTF::move(data)); if (result.hasException()) { exceptionCallback(result.releaseException().code(), ""_s); return; diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_KWOpenSSL.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_KWOpenSSL.cpp index 4ff61e6516..0ac8358ee6 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_KWOpenSSL.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAES_KWOpenSSL.cpp @@ -70,7 +70,7 @@ ExceptionOr> CryptoAlgorithmAES_KW::platformWrapKey(const Crypto auto output = cryptWrapKey(key.key(), data); if (!output) return Exception { OperationError }; - return WTFMove(*output); + return WTF::move(*output); } ExceptionOr> CryptoAlgorithmAES_KW::platformUnwrapKey(const CryptoKeyAES& key, const Vector& data) @@ -78,7 +78,7 @@ ExceptionOr> CryptoAlgorithmAES_KW::platformUnwrapKey(const Cryp auto output = cryptUnwrapKey(key.key(), data); if (!output) return Exception { OperationError }; - return WTFMove(*output); + return WTF::move(*output); } } // namespace WebCore diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAesGcmParams.h b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAesGcmParams.h index 492cf764ed..99ac397548 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmAesGcmParams.h +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmAesGcmParams.h @@ -56,7 +56,7 @@ public: if (!m_additionalDataVector.isEmpty() || !additionalData) return m_additionalDataVector; - BufferSource additionalDataBuffer = WTFMove(*additionalData); + BufferSource additionalDataBuffer = WTF::move(*additionalData); additionalData = std::nullopt; if (!additionalDataBuffer.length()) return m_additionalDataVector; diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmECDH.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmECDH.cpp index acb047cc72..7432f8bbae 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmECDH.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmECDH.cpp @@ -63,7 +63,7 @@ void CryptoAlgorithmECDH::generateKey(const CryptoAlgorithmParameters& parameter auto pair = result.releaseReturnValue(); pair.publicKey->setUsagesBitmap(0); pair.privateKey->setUsagesBitmap(pair.privateKey->usagesBitmap() & (CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits)); - callback(WTFMove(pair)); + callback(WTF::move(pair)); } void CryptoAlgorithmECDH::deriveBits(const CryptoAlgorithmParameters& parameters, Ref&& baseKey, size_t length, VectorCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue) @@ -90,13 +90,13 @@ void CryptoAlgorithmECDH::deriveBits(const CryptoAlgorithmParameters& parameters return; } - auto unifiedCallback = [callback = WTFMove(callback), exceptionCallback = WTFMove(exceptionCallback)](std::optional>&& derivedKey, size_t length) mutable { + auto unifiedCallback = [callback = WTF::move(callback), exceptionCallback = WTF::move(exceptionCallback)](std::optional>&& derivedKey, size_t length) mutable { if (!derivedKey) { exceptionCallback(OperationError, ""_s); return; } if (!length) { - callback(WTFMove(*derivedKey)); + callback(WTF::move(*derivedKey)); return; } auto lengthInBytes = std::ceil(length / 8.); @@ -105,16 +105,16 @@ void CryptoAlgorithmECDH::deriveBits(const CryptoAlgorithmParameters& parameters return; } (*derivedKey).shrink(lengthInBytes); - callback(WTFMove(*derivedKey)); + callback(WTF::move(*derivedKey)); }; // This is a special case that can't use dispatchOperation() because it bundles // the result validation and callback dispatch into unifiedCallback. workQueue.dispatch(context.globalObject(), - [baseKey = WTFMove(baseKey), publicKey = ecParameters.publicKey, length, unifiedCallback = WTFMove(unifiedCallback), contextIdentifier = context.identifier()]() mutable { + [baseKey = WTF::move(baseKey), publicKey = ecParameters.publicKey, length, unifiedCallback = WTF::move(unifiedCallback), contextIdentifier = context.identifier()]() mutable { auto derivedKey = platformDeriveBits(downcast(baseKey.get()), downcast(*publicKey)); - ScriptExecutionContext::postTaskTo(contextIdentifier, [derivedKey = WTFMove(derivedKey), length, unifiedCallback = WTFMove(unifiedCallback)](auto&) mutable { - unifiedCallback(WTFMove(derivedKey), length); + ScriptExecutionContext::postTaskTo(contextIdentifier, [derivedKey = WTF::move(derivedKey), length, unifiedCallback = WTF::move(unifiedCallback)](auto&) mutable { + unifiedCallback(WTF::move(derivedKey), length); }); }); } @@ -126,7 +126,7 @@ void CryptoAlgorithmECDH::importKey(CryptoKeyFormat format, KeyData&& data, cons RefPtr result; switch (format) { case CryptoKeyFormat::Jwk: { - JsonWebKey key = WTFMove(std::get(data)); + JsonWebKey key = WTF::move(std::get(data)); bool isUsagesAllowed = false; if (!key.d.isNull()) { @@ -145,7 +145,7 @@ void CryptoAlgorithmECDH::importKey(CryptoKeyFormat format, KeyData&& data, cons return; } - result = CryptoKeyEC::importJwk(ecParameters.identifier, ecParameters.namedCurve, WTFMove(key), extractable, usages); + result = CryptoKeyEC::importJwk(ecParameters.identifier, ecParameters.namedCurve, WTF::move(key), extractable, usages); break; } case CryptoKeyFormat::Raw: @@ -153,21 +153,21 @@ void CryptoAlgorithmECDH::importKey(CryptoKeyFormat format, KeyData&& data, cons exceptionCallback(SyntaxError, ""_s); return; } - result = CryptoKeyEC::importRaw(ecParameters.identifier, ecParameters.namedCurve, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyEC::importRaw(ecParameters.identifier, ecParameters.namedCurve, WTF::move(std::get>(data)), extractable, usages); break; case CryptoKeyFormat::Spki: if (usages) { exceptionCallback(SyntaxError, ""_s); return; } - result = CryptoKeyEC::importSpki(ecParameters.identifier, ecParameters.namedCurve, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyEC::importSpki(ecParameters.identifier, ecParameters.namedCurve, WTF::move(std::get>(data)), extractable, usages); break; case CryptoKeyFormat::Pkcs8: if (usages && (usages ^ CryptoKeyUsageDeriveKey) && (usages ^ CryptoKeyUsageDeriveBits) && (usages ^ (CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits))) { exceptionCallback(SyntaxError, ""_s); return; } - result = CryptoKeyEC::importPkcs8(ecParameters.identifier, ecParameters.namedCurve, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyEC::importPkcs8(ecParameters.identifier, ecParameters.namedCurve, WTF::move(std::get>(data)), extractable, usages); break; } if (!result) { @@ -227,7 +227,7 @@ void CryptoAlgorithmECDH::exportKey(CryptoKeyFormat format, Ref&& key } } - callback(format, WTFMove(result)); + callback(format, WTF::move(result)); } } // namespace WebCore diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmECDSA.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmECDSA.cpp index 4744b65003..4fb66d6f30 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmECDSA.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmECDSA.cpp @@ -62,8 +62,8 @@ void CryptoAlgorithmECDSA::sign(const CryptoAlgorithmParameters& parameters, Ref return; } - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [parameters = crossThreadCopy(downcast(parameters)), key = WTFMove(key), data = WTFMove(data)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [parameters = crossThreadCopy(downcast(parameters)), key = WTF::move(key), data = WTF::move(data)] { return platformSign(parameters, downcast(key.get()), data); }); } @@ -75,8 +75,8 @@ void CryptoAlgorithmECDSA::verify(const CryptoAlgorithmParameters& parameters, R return; } - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [parameters = crossThreadCopy(downcast(parameters)), key = WTFMove(key), signature = WTFMove(signature), data = WTFMove(data)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [parameters = crossThreadCopy(downcast(parameters)), key = WTF::move(key), signature = WTF::move(signature), data = WTF::move(data)] { return platformVerify(parameters, downcast(key.get()), signature, data); }); } @@ -99,7 +99,7 @@ void CryptoAlgorithmECDSA::generateKey(const CryptoAlgorithmParameters& paramete auto pair = result.releaseReturnValue(); pair.publicKey->setUsagesBitmap(pair.publicKey->usagesBitmap() & CryptoKeyUsageVerify); pair.privateKey->setUsagesBitmap(pair.privateKey->usagesBitmap() & CryptoKeyUsageSign); - callback(WTFMove(pair)); + callback(WTF::move(pair)); } void CryptoAlgorithmECDSA::importKey(CryptoKeyFormat format, KeyData&& data, const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback) @@ -110,7 +110,7 @@ void CryptoAlgorithmECDSA::importKey(CryptoKeyFormat format, KeyData&& data, con RefPtr result; switch (format) { case CryptoKeyFormat::Jwk: { - JsonWebKey key = WTFMove(std::get(data)); + JsonWebKey key = WTF::move(std::get(data)); if (usages && ((!key.d.isNull() && (usages ^ CryptoKeyUsageSign)) || (key.d.isNull() && (usages ^ CryptoKeyUsageVerify)))) { exceptionCallback(SyntaxError, ""_s); @@ -133,7 +133,7 @@ void CryptoAlgorithmECDSA::importKey(CryptoKeyFormat format, KeyData&& data, con return; } - result = CryptoKeyEC::importJwk(ecParameters.identifier, ecParameters.namedCurve, WTFMove(key), extractable, usages); + result = CryptoKeyEC::importJwk(ecParameters.identifier, ecParameters.namedCurve, WTF::move(key), extractable, usages); break; } case CryptoKeyFormat::Raw: @@ -141,21 +141,21 @@ void CryptoAlgorithmECDSA::importKey(CryptoKeyFormat format, KeyData&& data, con exceptionCallback(SyntaxError, ""_s); return; } - result = CryptoKeyEC::importRaw(ecParameters.identifier, ecParameters.namedCurve, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyEC::importRaw(ecParameters.identifier, ecParameters.namedCurve, WTF::move(std::get>(data)), extractable, usages); break; case CryptoKeyFormat::Spki: if (usages && (usages ^ CryptoKeyUsageVerify)) { exceptionCallback(SyntaxError, ""_s); return; } - result = CryptoKeyEC::importSpki(ecParameters.identifier, ecParameters.namedCurve, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyEC::importSpki(ecParameters.identifier, ecParameters.namedCurve, WTF::move(std::get>(data)), extractable, usages); break; case CryptoKeyFormat::Pkcs8: if (usages && (usages ^ CryptoKeyUsageSign)) { exceptionCallback(SyntaxError, ""_s); return; } - result = CryptoKeyEC::importPkcs8(ecParameters.identifier, ecParameters.namedCurve, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyEC::importPkcs8(ecParameters.identifier, ecParameters.namedCurve, WTF::move(std::get>(data)), extractable, usages); break; } if (!result) { @@ -215,7 +215,7 @@ void CryptoAlgorithmECDSA::exportKey(CryptoKeyFormat format, Ref&& ke } } - callback(format, WTFMove(result)); + callback(format, WTF::move(result)); } } // namespace WebCore diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmEd25519.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmEd25519.cpp index 826730b818..c113cf7a8e 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmEd25519.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmEd25519.cpp @@ -84,7 +84,7 @@ void CryptoAlgorithmEd25519::generateKey(const CryptoAlgorithmParameters&, bool auto pair = result.releaseReturnValue(); pair.publicKey->setUsagesBitmap(pair.publicKey->usagesBitmap() & CryptoKeyUsageVerify); pair.privateKey->setUsagesBitmap(pair.privateKey->usagesBitmap() & CryptoKeyUsageSign); - callback(WTFMove(pair)); + callback(WTF::move(pair)); } void CryptoAlgorithmEd25519::sign(const CryptoAlgorithmParameters&, Ref&& key, Vector&& data, VectorCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue) @@ -93,8 +93,8 @@ void CryptoAlgorithmEd25519::sign(const CryptoAlgorithmParameters&, Ref(key.get()), data); }); } @@ -105,8 +105,8 @@ void CryptoAlgorithmEd25519::verify(const CryptoAlgorithmParameters&, Ref(key.get()), signature, data); }); } @@ -116,7 +116,7 @@ void CryptoAlgorithmEd25519::importKey(CryptoKeyFormat format, KeyData&& data, c RefPtr result; switch (format) { case CryptoKeyFormat::Jwk: { - JsonWebKey key = WTFMove(std::get(data)); + JsonWebKey key = WTF::move(std::get(data)); if (usages && ((!key.d.isNull() && (usages ^ CryptoKeyUsageSign)) || (key.d.isNull() && (usages ^ CryptoKeyUsageVerify)))) { exceptionCallback(SyntaxError, ""_s); return; @@ -125,7 +125,7 @@ void CryptoAlgorithmEd25519::importKey(CryptoKeyFormat format, KeyData&& data, c exceptionCallback(DataError, ""_s); return; } - result = CryptoKeyOKP::importJwk(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::Ed25519, WTFMove(key), extractable, usages); + result = CryptoKeyOKP::importJwk(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::Ed25519, WTF::move(key), extractable, usages); break; } case CryptoKeyFormat::Raw: @@ -133,21 +133,21 @@ void CryptoAlgorithmEd25519::importKey(CryptoKeyFormat format, KeyData&& data, c exceptionCallback(SyntaxError, ""_s); return; } - result = CryptoKeyOKP::importRaw(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::Ed25519, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyOKP::importRaw(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::Ed25519, WTF::move(std::get>(data)), extractable, usages); break; case CryptoKeyFormat::Spki: if (usages && (usages ^ CryptoKeyUsageVerify)) { exceptionCallback(SyntaxError, ""_s); return; } - result = CryptoKeyOKP::importSpki(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::Ed25519, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyOKP::importSpki(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::Ed25519, WTF::move(std::get>(data)), extractable, usages); break; case CryptoKeyFormat::Pkcs8: if (usages && (usages ^ CryptoKeyUsageSign)) { exceptionCallback(SyntaxError, ""_s); return; } - result = CryptoKeyOKP::importPkcs8(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::Ed25519, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyOKP::importPkcs8(CryptoAlgorithmIdentifier::Ed25519, CryptoKeyOKP::NamedCurve::Ed25519, WTF::move(std::get>(data)), extractable, usages); break; } if (!result) { @@ -203,7 +203,7 @@ void CryptoAlgorithmEd25519::exportKey(CryptoKeyFormat format, Ref&& break; } } - callback(format, WTFMove(result)); + callback(format, WTF::move(result)); } } // namespace WebCore diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmHKDF.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmHKDF.cpp index a8aafe83e0..bf4bab881e 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmHKDF.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmHKDF.cpp @@ -52,8 +52,8 @@ void CryptoAlgorithmHKDF::deriveBits(const CryptoAlgorithmParameters& parameters return; } - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [parameters = crossThreadCopy(downcast(parameters)), baseKey = WTFMove(baseKey), length] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [parameters = crossThreadCopy(downcast(parameters)), baseKey = WTF::move(baseKey), length] { return platformDeriveBits(parameters, downcast(baseKey.get()), length); }); } @@ -73,7 +73,7 @@ void CryptoAlgorithmHKDF::importKey(CryptoKeyFormat format, KeyData&& data, cons return; } - callback(CryptoKeyRaw::create(parameters.identifier, WTFMove(std::get>(data)), usages)); + callback(CryptoKeyRaw::create(parameters.identifier, WTF::move(std::get>(data)), usages)); } ExceptionOr CryptoAlgorithmHKDF::getKeyLength(const CryptoAlgorithmParameters&) diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmHMAC.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmHMAC.cpp index d5226cc6b6..f0c036ac8c 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmHMAC.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmHMAC.cpp @@ -59,16 +59,16 @@ CryptoAlgorithmIdentifier CryptoAlgorithmHMAC::identifier() const void CryptoAlgorithmHMAC::sign(const CryptoAlgorithmParameters&, Ref&& key, Vector&& data, VectorCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue) { - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [key = WTFMove(key), data = WTFMove(data)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [key = WTF::move(key), data = WTF::move(data)] { return platformSign(downcast(key.get()), data); }); } void CryptoAlgorithmHMAC::verify(const CryptoAlgorithmParameters&, Ref&& key, Vector&& signature, Vector&& data, BoolCallback&& callback, ExceptionCallback&& exceptionCallback, ScriptExecutionContext& context, WorkQueue& workQueue) { - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [key = WTFMove(key), signature = WTFMove(signature), data = WTFMove(data)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [key = WTF::move(key), signature = WTF::move(signature), data = WTF::move(data)] { return platformVerify(downcast(key.get()), signature, data); }); } @@ -93,7 +93,7 @@ void CryptoAlgorithmHMAC::generateKey(const CryptoAlgorithmParameters& parameter return; } - callback(WTFMove(result)); + callback(WTF::move(result)); } void CryptoAlgorithmHMAC::importKey(CryptoKeyFormat format, KeyData&& data, const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback) @@ -110,7 +110,7 @@ void CryptoAlgorithmHMAC::importKey(CryptoKeyFormat format, KeyData&& data, cons RefPtr result; switch (format) { case CryptoKeyFormat::Raw: - result = CryptoKeyHMAC::importRaw(hmacParameters.length.value_or(0), hmacParameters.hashIdentifier, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyHMAC::importRaw(hmacParameters.length.value_or(0), hmacParameters.hashIdentifier, WTF::move(std::get>(data)), extractable, usages); break; case CryptoKeyFormat::Jwk: { auto checkAlgCallback = [](CryptoAlgorithmIdentifier hash, const String& alg) -> bool { @@ -130,7 +130,7 @@ void CryptoAlgorithmHMAC::importKey(CryptoKeyFormat format, KeyData&& data, cons } return false; }; - result = CryptoKeyHMAC::importJwk(hmacParameters.length.value_or(0), hmacParameters.hashIdentifier, WTFMove(std::get(data)), extractable, usages, WTFMove(checkAlgCallback)); + result = CryptoKeyHMAC::importJwk(hmacParameters.length.value_or(0), hmacParameters.hashIdentifier, WTF::move(std::get(data)), extractable, usages, WTF::move(checkAlgCallback)); break; } default: @@ -181,7 +181,7 @@ void CryptoAlgorithmHMAC::exportKey(CryptoKeyFormat format, Ref&& key default: ASSERT_NOT_REACHED(); } - result = WTFMove(jwk); + result = WTF::move(jwk); break; } default: @@ -189,7 +189,7 @@ void CryptoAlgorithmHMAC::exportKey(CryptoKeyFormat format, Ref&& key return; } - callback(format, WTFMove(result)); + callback(format, WTF::move(result)); } ExceptionOr CryptoAlgorithmHMAC::getKeyLength(const CryptoAlgorithmParameters& parameters) diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmHMACOpenSSL.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmHMACOpenSSL.cpp index 01d42f82fb..3f2b816092 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmHMACOpenSSL.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmHMACOpenSSL.cpp @@ -69,7 +69,7 @@ ExceptionOr> CryptoAlgorithmHMAC::platformSignWithAlgorithm(cons auto result = calculateSignature(algorithm, key.key(), data.begin(), data.size()); if (!result) return Exception { OperationError }; - return WTFMove(*result); + return WTF::move(*result); } ExceptionOr> CryptoAlgorithmHMAC::platformSign(const CryptoKeyHMAC& key, const Vector& data) @@ -81,7 +81,7 @@ ExceptionOr> CryptoAlgorithmHMAC::platformSign(const CryptoKeyHM auto result = calculateSignature(algorithm, key.key(), data.begin(), data.size()); if (!result) return Exception { OperationError }; - return WTFMove(*result); + return WTF::move(*result); } ExceptionOr CryptoAlgorithmHMAC::platformVerifyWithAlgorithm(const CryptoKeyHMAC& key, CryptoAlgorithmIdentifier algorithmIdentifier, const Vector& signature, const Vector& data) diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmPBKDF2.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmPBKDF2.cpp index 52d9736695..c72a7827ec 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmPBKDF2.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmPBKDF2.cpp @@ -52,8 +52,8 @@ void CryptoAlgorithmPBKDF2::deriveBits(const CryptoAlgorithmParameters& paramete return; } - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [parameters = crossThreadCopy(downcast(parameters)), baseKey = WTFMove(baseKey), length] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [parameters = crossThreadCopy(downcast(parameters)), baseKey = WTF::move(baseKey), length] { return platformDeriveBits(parameters, downcast(baseKey.get()), length); }); } @@ -73,7 +73,7 @@ void CryptoAlgorithmPBKDF2::importKey(CryptoKeyFormat format, KeyData&& data, co return; } - callback(CryptoKeyRaw::create(parameters.identifier, WTFMove(std::get>(data)), usages)); + callback(CryptoKeyRaw::create(parameters.identifier, WTF::move(std::get>(data)), usages)); } ExceptionOr CryptoAlgorithmPBKDF2::getKeyLength(const CryptoAlgorithmParameters&) diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp index 691ad5f4e2..50685c399c 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmRSAES_PKCS1_v1_5.cpp @@ -54,8 +54,8 @@ void CryptoAlgorithmRSAES_PKCS1_v1_5::encrypt(const CryptoAlgorithmParameters&, return; } - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [key = WTFMove(key), plainText = WTFMove(plainText)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [key = WTF::move(key), plainText = WTF::move(plainText)] { return platformEncrypt(downcast(key.get()), plainText); }); } @@ -67,8 +67,8 @@ void CryptoAlgorithmRSAES_PKCS1_v1_5::decrypt(const CryptoAlgorithmParameters&, return; } - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [key = WTFMove(key), cipherText = WTFMove(cipherText)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [key = WTF::move(key), cipherText = WTF::move(cipherText)] { return platformDecrypt(downcast(key.get()), cipherText); }); } @@ -82,16 +82,16 @@ void CryptoAlgorithmRSAES_PKCS1_v1_5::generateKey(const CryptoAlgorithmParameter return; } - auto keyPairCallback = [capturedCallback = WTFMove(callback)](CryptoKeyPair&& pair) { + auto keyPairCallback = [capturedCallback = WTF::move(callback)](CryptoKeyPair&& pair) { pair.publicKey->setUsagesBitmap(pair.publicKey->usagesBitmap() & CryptoKeyUsageEncrypt); pair.privateKey->setUsagesBitmap(pair.privateKey->usagesBitmap() & CryptoKeyUsageDecrypt); - capturedCallback(WTFMove(pair)); + capturedCallback(WTF::move(pair)); }; - auto failureCallback = [capturedCallback = WTFMove(exceptionCallback)]() { + auto failureCallback = [capturedCallback = WTF::move(exceptionCallback)]() { capturedCallback(OperationError, ""_s); }; // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect. - CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5, CryptoAlgorithmIdentifier::SHA_1, false, rsaParameters.modulusLength, rsaParameters.publicExponentVector(), extractable, usages, WTFMove(keyPairCallback), WTFMove(failureCallback), &context); + CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSAES_PKCS1_v1_5, CryptoAlgorithmIdentifier::SHA_1, false, rsaParameters.modulusLength, rsaParameters.publicExponentVector(), extractable, usages, WTF::move(keyPairCallback), WTF::move(failureCallback), &context); } void CryptoAlgorithmRSAES_PKCS1_v1_5::importKey(CryptoKeyFormat format, KeyData&& data, const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback) @@ -99,7 +99,7 @@ void CryptoAlgorithmRSAES_PKCS1_v1_5::importKey(CryptoKeyFormat format, KeyData& RefPtr result; switch (format) { case CryptoKeyFormat::Jwk: { - JsonWebKey key = WTFMove(std::get(data)); + JsonWebKey key = WTF::move(std::get(data)); if (usages && ((!key.d.isNull() && (usages ^ CryptoKeyUsageDecrypt)) || (key.d.isNull() && (usages ^ CryptoKeyUsageEncrypt)))) { exceptionCallback(SyntaxError, ""_s); return; @@ -112,7 +112,7 @@ void CryptoAlgorithmRSAES_PKCS1_v1_5::importKey(CryptoKeyFormat format, KeyData& exceptionCallback(DataError, ""_s); return; } - result = CryptoKeyRSA::importJwk(parameters.identifier, std::nullopt, WTFMove(key), extractable, usages); + result = CryptoKeyRSA::importJwk(parameters.identifier, std::nullopt, WTF::move(key), extractable, usages); break; } case CryptoKeyFormat::Spki: { @@ -120,7 +120,7 @@ void CryptoAlgorithmRSAES_PKCS1_v1_5::importKey(CryptoKeyFormat format, KeyData& exceptionCallback(SyntaxError, ""_s); return; } - result = CryptoKeyRSA::importSpki(parameters.identifier, std::nullopt, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyRSA::importSpki(parameters.identifier, std::nullopt, WTF::move(std::get>(data)), extractable, usages); break; } case CryptoKeyFormat::Pkcs8: { @@ -128,7 +128,7 @@ void CryptoAlgorithmRSAES_PKCS1_v1_5::importKey(CryptoKeyFormat format, KeyData& exceptionCallback(SyntaxError, ""_s); return; } - result = CryptoKeyRSA::importPkcs8(parameters.identifier, std::nullopt, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyRSA::importPkcs8(parameters.identifier, std::nullopt, WTF::move(std::get>(data)), extractable, usages); break; } default: @@ -157,7 +157,7 @@ void CryptoAlgorithmRSAES_PKCS1_v1_5::exportKey(CryptoKeyFormat format, Ref(key.get()), data); }); } @@ -74,8 +74,8 @@ void CryptoAlgorithmRSASSA_PKCS1_v1_5::verify(const CryptoAlgorithmParameters&, return; } - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [key = WTFMove(key), signature = WTFMove(signature), data = WTFMove(data)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [key = WTF::move(key), signature = WTF::move(signature), data = WTF::move(data)] { return platformVerify(downcast(key.get()), signature, data); }); } @@ -89,15 +89,15 @@ void CryptoAlgorithmRSASSA_PKCS1_v1_5::generateKey(const CryptoAlgorithmParamete return; } - auto keyPairCallback = [capturedCallback = WTFMove(callback)](CryptoKeyPair&& pair) { + auto keyPairCallback = [capturedCallback = WTF::move(callback)](CryptoKeyPair&& pair) { pair.publicKey->setUsagesBitmap(pair.publicKey->usagesBitmap() & CryptoKeyUsageVerify); pair.privateKey->setUsagesBitmap(pair.privateKey->usagesBitmap() & CryptoKeyUsageSign); - capturedCallback(WTFMove(pair)); + capturedCallback(WTF::move(pair)); }; - auto failureCallback = [capturedCallback = WTFMove(exceptionCallback)]() { + auto failureCallback = [capturedCallback = WTF::move(exceptionCallback)]() { capturedCallback(OperationError, ""_s); }; - CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5, rsaParameters.hashIdentifier, true, rsaParameters.modulusLength, rsaParameters.publicExponentVector(), extractable, usages, WTFMove(keyPairCallback), WTFMove(failureCallback), &context); + CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSASSA_PKCS1_v1_5, rsaParameters.hashIdentifier, true, rsaParameters.modulusLength, rsaParameters.publicExponentVector(), extractable, usages, WTF::move(keyPairCallback), WTF::move(failureCallback), &context); } void CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey(CryptoKeyFormat format, KeyData&& data, const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback) @@ -109,7 +109,7 @@ void CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey(CryptoKeyFormat format, KeyData RefPtr result; switch (format) { case CryptoKeyFormat::Jwk: { - JsonWebKey key = WTFMove(std::get(data)); + JsonWebKey key = WTF::move(std::get(data)); if (usages && ((!key.d.isNull() && (usages ^ CryptoKeyUsageSign)) || (key.d.isNull() && (usages ^ CryptoKeyUsageVerify)))) { exceptionCallback(SyntaxError, ""_s); @@ -145,7 +145,7 @@ void CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey(CryptoKeyFormat format, KeyData return; } - result = CryptoKeyRSA::importJwk(rsaParameters.identifier, rsaParameters.hashIdentifier, WTFMove(key), extractable, usages); + result = CryptoKeyRSA::importJwk(rsaParameters.identifier, rsaParameters.hashIdentifier, WTF::move(key), extractable, usages); break; } case CryptoKeyFormat::Spki: { @@ -154,7 +154,7 @@ void CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey(CryptoKeyFormat format, KeyData return; } // FIXME: - result = CryptoKeyRSA::importSpki(rsaParameters.identifier, rsaParameters.hashIdentifier, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyRSA::importSpki(rsaParameters.identifier, rsaParameters.hashIdentifier, WTF::move(std::get>(data)), extractable, usages); break; } case CryptoKeyFormat::Pkcs8: { @@ -163,7 +163,7 @@ void CryptoAlgorithmRSASSA_PKCS1_v1_5::importKey(CryptoKeyFormat format, KeyData return; } // FIXME: - result = CryptoKeyRSA::importPkcs8(parameters.identifier, rsaParameters.hashIdentifier, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyRSA::importPkcs8(parameters.identifier, rsaParameters.hashIdentifier, WTF::move(std::get>(data)), extractable, usages); break; } default: @@ -211,7 +211,7 @@ void CryptoAlgorithmRSASSA_PKCS1_v1_5::exportKey(CryptoKeyFormat format, Ref(parameters)), key = WTFMove(key), plainText = WTFMove(plainText)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [parameters = crossThreadCopy(downcast(parameters)), key = WTF::move(key), plainText = WTF::move(plainText)] { return platformEncrypt(parameters, downcast(key.get()), plainText); }); } @@ -76,8 +76,8 @@ void CryptoAlgorithmRSA_OAEP::decrypt(const CryptoAlgorithmParameters& parameter return; } - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [parameters = crossThreadCopy(downcast(parameters)), key = WTFMove(key), cipherText = WTFMove(cipherText)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [parameters = crossThreadCopy(downcast(parameters)), key = WTF::move(key), cipherText = WTF::move(cipherText)] { return platformDecrypt(parameters, downcast(key.get()), cipherText); }); } @@ -91,15 +91,15 @@ void CryptoAlgorithmRSA_OAEP::generateKey(const CryptoAlgorithmParameters& param return; } - auto keyPairCallback = [capturedCallback = WTFMove(callback)](CryptoKeyPair&& pair) { + auto keyPairCallback = [capturedCallback = WTF::move(callback)](CryptoKeyPair&& pair) { pair.publicKey->setUsagesBitmap(pair.publicKey->usagesBitmap() & (CryptoKeyUsageEncrypt | CryptoKeyUsageWrapKey)); pair.privateKey->setUsagesBitmap(pair.privateKey->usagesBitmap() & (CryptoKeyUsageDecrypt | CryptoKeyUsageUnwrapKey)); - capturedCallback(WTFMove(pair)); + capturedCallback(WTF::move(pair)); }; - auto failureCallback = [capturedCallback = WTFMove(exceptionCallback)]() { + auto failureCallback = [capturedCallback = WTF::move(exceptionCallback)]() { capturedCallback(OperationError, ""_s); }; - CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSA_OAEP, rsaParameters.hashIdentifier, true, rsaParameters.modulusLength, rsaParameters.publicExponentVector(), extractable, usages, WTFMove(keyPairCallback), WTFMove(failureCallback), &context); + CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSA_OAEP, rsaParameters.hashIdentifier, true, rsaParameters.modulusLength, rsaParameters.publicExponentVector(), extractable, usages, WTF::move(keyPairCallback), WTF::move(failureCallback), &context); } void CryptoAlgorithmRSA_OAEP::importKey(CryptoKeyFormat format, KeyData&& data, const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback) @@ -111,7 +111,7 @@ void CryptoAlgorithmRSA_OAEP::importKey(CryptoKeyFormat format, KeyData&& data, RefPtr result; switch (format) { case CryptoKeyFormat::Jwk: { - JsonWebKey key = WTFMove(std::get(data)); + JsonWebKey key = WTF::move(std::get(data)); bool isUsagesAllowed = false; if (!key.d.isNull()) { @@ -159,7 +159,7 @@ void CryptoAlgorithmRSA_OAEP::importKey(CryptoKeyFormat format, KeyData&& data, return; } - result = CryptoKeyRSA::importJwk(rsaParameters.identifier, rsaParameters.hashIdentifier, WTFMove(key), extractable, usages); + result = CryptoKeyRSA::importJwk(rsaParameters.identifier, rsaParameters.hashIdentifier, WTF::move(key), extractable, usages); break; } case CryptoKeyFormat::Spki: { @@ -168,7 +168,7 @@ void CryptoAlgorithmRSA_OAEP::importKey(CryptoKeyFormat format, KeyData&& data, return; } // FIXME: - result = CryptoKeyRSA::importSpki(rsaParameters.identifier, rsaParameters.hashIdentifier, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyRSA::importSpki(rsaParameters.identifier, rsaParameters.hashIdentifier, WTF::move(std::get>(data)), extractable, usages); break; } case CryptoKeyFormat::Pkcs8: { @@ -177,7 +177,7 @@ void CryptoAlgorithmRSA_OAEP::importKey(CryptoKeyFormat format, KeyData&& data, return; } // FIXME: - result = CryptoKeyRSA::importPkcs8(parameters.identifier, rsaParameters.hashIdentifier, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyRSA::importPkcs8(parameters.identifier, rsaParameters.hashIdentifier, WTF::move(std::get>(data)), extractable, usages); break; } default: @@ -225,7 +225,7 @@ void CryptoAlgorithmRSA_OAEP::exportKey(CryptoKeyFormat format, Ref&& default: ASSERT_NOT_REACHED(); } - result = WTFMove(jwk); + result = WTF::move(jwk); break; } case CryptoKeyFormat::Spki: { @@ -253,7 +253,7 @@ void CryptoAlgorithmRSA_OAEP::exportKey(CryptoKeyFormat format, Ref&& return; } - callback(format, WTFMove(result)); + callback(format, WTF::move(result)); } } diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmRSA_PSS.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmRSA_PSS.cpp index 11a851ff4a..d6e585d683 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmRSA_PSS.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmRSA_PSS.cpp @@ -63,8 +63,8 @@ void CryptoAlgorithmRSA_PSS::sign(const CryptoAlgorithmParameters& parameters, R return; } - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [parameters = crossThreadCopy(downcast(parameters)), key = WTFMove(key), data = WTFMove(data)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [parameters = crossThreadCopy(downcast(parameters)), key = WTF::move(key), data = WTF::move(data)] { return platformSign(parameters, downcast(key.get()), data); }); } @@ -76,8 +76,8 @@ void CryptoAlgorithmRSA_PSS::verify(const CryptoAlgorithmParameters& parameters, return; } - dispatchOperationInWorkQueue(workQueue, context, WTFMove(callback), WTFMove(exceptionCallback), - [parameters = crossThreadCopy(downcast(parameters)), key = WTFMove(key), signature = WTFMove(signature), data = WTFMove(data)] { + dispatchOperationInWorkQueue(workQueue, context, WTF::move(callback), WTF::move(exceptionCallback), + [parameters = crossThreadCopy(downcast(parameters)), key = WTF::move(key), signature = WTF::move(signature), data = WTF::move(data)] { return platformVerify(parameters, downcast(key.get()), signature, data); }); } @@ -91,15 +91,15 @@ void CryptoAlgorithmRSA_PSS::generateKey(const CryptoAlgorithmParameters& parame return; } - auto keyPairCallback = [capturedCallback = WTFMove(callback)](CryptoKeyPair&& pair) { + auto keyPairCallback = [capturedCallback = WTF::move(callback)](CryptoKeyPair&& pair) { pair.publicKey->setUsagesBitmap(pair.publicKey->usagesBitmap() & CryptoKeyUsageVerify); pair.privateKey->setUsagesBitmap(pair.privateKey->usagesBitmap() & CryptoKeyUsageSign); - capturedCallback(WTFMove(pair)); + capturedCallback(WTF::move(pair)); }; - auto failureCallback = [capturedCallback = WTFMove(exceptionCallback)]() { + auto failureCallback = [capturedCallback = WTF::move(exceptionCallback)]() { capturedCallback(OperationError, ""_s); }; - CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSA_PSS, rsaParameters.hashIdentifier, true, rsaParameters.modulusLength, rsaParameters.publicExponentVector(), extractable, usages, WTFMove(keyPairCallback), WTFMove(failureCallback), &context); + CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier::RSA_PSS, rsaParameters.hashIdentifier, true, rsaParameters.modulusLength, rsaParameters.publicExponentVector(), extractable, usages, WTF::move(keyPairCallback), WTF::move(failureCallback), &context); } void CryptoAlgorithmRSA_PSS::importKey(CryptoKeyFormat format, KeyData&& data, const CryptoAlgorithmParameters& parameters, bool extractable, CryptoKeyUsageBitmap usages, KeyCallback&& callback, ExceptionCallback&& exceptionCallback) @@ -111,7 +111,7 @@ void CryptoAlgorithmRSA_PSS::importKey(CryptoKeyFormat format, KeyData&& data, c RefPtr result; switch (format) { case CryptoKeyFormat::Jwk: { - JsonWebKey key = WTFMove(std::get(data)); + JsonWebKey key = WTF::move(std::get(data)); if (usages && ((!key.d.isNull() && (usages ^ CryptoKeyUsageSign)) || (key.d.isNull() && (usages ^ CryptoKeyUsageVerify)))) { exceptionCallback(SyntaxError, ""_s); @@ -147,7 +147,7 @@ void CryptoAlgorithmRSA_PSS::importKey(CryptoKeyFormat format, KeyData&& data, c return; } - result = CryptoKeyRSA::importJwk(rsaParameters.identifier, rsaParameters.hashIdentifier, WTFMove(key), extractable, usages); + result = CryptoKeyRSA::importJwk(rsaParameters.identifier, rsaParameters.hashIdentifier, WTF::move(key), extractable, usages); break; } case CryptoKeyFormat::Spki: { @@ -156,7 +156,7 @@ void CryptoAlgorithmRSA_PSS::importKey(CryptoKeyFormat format, KeyData&& data, c return; } // FIXME: - result = CryptoKeyRSA::importSpki(rsaParameters.identifier, rsaParameters.hashIdentifier, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyRSA::importSpki(rsaParameters.identifier, rsaParameters.hashIdentifier, WTF::move(std::get>(data)), extractable, usages); break; } case CryptoKeyFormat::Pkcs8: { @@ -165,7 +165,7 @@ void CryptoAlgorithmRSA_PSS::importKey(CryptoKeyFormat format, KeyData&& data, c return; } // FIXME: - result = CryptoKeyRSA::importPkcs8(parameters.identifier, rsaParameters.hashIdentifier, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyRSA::importPkcs8(parameters.identifier, rsaParameters.hashIdentifier, WTF::move(std::get>(data)), extractable, usages); break; } default: @@ -213,7 +213,7 @@ void CryptoAlgorithmRSA_PSS::exportKey(CryptoKeyFormat format, Ref&& default: ASSERT_NOT_REACHED(); } - result = WTFMove(jwk); + result = WTF::move(jwk); break; } case CryptoKeyFormat::Spki: { @@ -239,7 +239,7 @@ void CryptoAlgorithmRSA_PSS::exportKey(CryptoKeyFormat format, Ref&& return; } - callback(format, WTFMove(result)); + callback(format, WTF::move(result)); } } diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmRsaOaepParams.h b/src/bun.js/bindings/webcrypto/CryptoAlgorithmRsaOaepParams.h index 4b58f7bb67..40874a066f 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmRsaOaepParams.h +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmRsaOaepParams.h @@ -46,7 +46,7 @@ public: if (!m_labelVector.isEmpty() || !label) return m_labelVector; - BufferSource labelBuffer = WTFMove(*label); + BufferSource labelBuffer = WTF::move(*label); label = std::nullopt; if (!labelBuffer.length()) return m_labelVector; diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA1.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA1.cpp index 1332ddafef..16a2400f16 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA1.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA1.cpp @@ -52,19 +52,19 @@ void CryptoAlgorithmSHA1::digest(Vector&& message, VectorCallback&& cal } if (message.size() < 64) { - auto moved = WTFMove(message); + auto moved = WTF::move(message); digest->addBytes(moved.begin(), moved.size()); auto result = digest->computeHash(); - ScriptExecutionContext::postTaskTo(context.identifier(), [callback = WTFMove(callback), result = WTFMove(result)](auto&) { + ScriptExecutionContext::postTaskTo(context.identifier(), [callback = WTF::move(callback), result = WTF::move(result)](auto&) { callback(result); }); return; } - workQueue.dispatch(context.globalObject(), [digest = WTFMove(digest), message = WTFMove(message), callback = WTFMove(callback), contextIdentifier = context.identifier()]() mutable { + workQueue.dispatch(context.globalObject(), [digest = WTF::move(digest), message = WTF::move(message), callback = WTF::move(callback), contextIdentifier = context.identifier()]() mutable { digest->addBytes(message.begin(), message.size()); auto result = digest->computeHash(); - ScriptExecutionContext::postTaskTo(contextIdentifier, [callback = WTFMove(callback), result = WTFMove(result)](auto&) { + ScriptExecutionContext::postTaskTo(contextIdentifier, [callback = WTF::move(callback), result = WTF::move(result)](auto&) { callback(result); }); }); diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA224.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA224.cpp index ae5afb8913..d764c4b5b9 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA224.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA224.cpp @@ -52,19 +52,19 @@ void CryptoAlgorithmSHA224::digest(Vector&& message, VectorCallback&& c } if (message.size() < 64) { - auto moved = WTFMove(message); + auto moved = WTF::move(message); digest->addBytes(moved.begin(), moved.size()); auto result = digest->computeHash(); - ScriptExecutionContext::postTaskTo(context.identifier(), [callback = WTFMove(callback), result = WTFMove(result)](auto&) { + ScriptExecutionContext::postTaskTo(context.identifier(), [callback = WTF::move(callback), result = WTF::move(result)](auto&) { callback(result); }); return; } - workQueue.dispatch(context.globalObject(), [digest = WTFMove(digest), message = WTFMove(message), callback = WTFMove(callback), contextIdentifier = context.identifier()]() mutable { + workQueue.dispatch(context.globalObject(), [digest = WTF::move(digest), message = WTF::move(message), callback = WTF::move(callback), contextIdentifier = context.identifier()]() mutable { digest->addBytes(message.begin(), message.size()); auto result = digest->computeHash(); - ScriptExecutionContext::postTaskTo(contextIdentifier, [callback = WTFMove(callback), result = WTFMove(result)](auto&) { + ScriptExecutionContext::postTaskTo(contextIdentifier, [callback = WTF::move(callback), result = WTF::move(result)](auto&) { callback(result); }); }); diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA256.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA256.cpp index f9bde62144..63e78ef42f 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA256.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA256.cpp @@ -52,19 +52,19 @@ void CryptoAlgorithmSHA256::digest(Vector&& message, VectorCallback&& c } if (message.size() < 64) { - auto moved = WTFMove(message); + auto moved = WTF::move(message); digest->addBytes(moved.begin(), moved.size()); auto result = digest->computeHash(); - ScriptExecutionContext::postTaskTo(context.identifier(), [callback = WTFMove(callback), result = WTFMove(result)](auto&) { + ScriptExecutionContext::postTaskTo(context.identifier(), [callback = WTF::move(callback), result = WTF::move(result)](auto&) { callback(result); }); return; } - workQueue.dispatch(context.globalObject(), [digest = WTFMove(digest), message = WTFMove(message), callback = WTFMove(callback), contextIdentifier = context.identifier()]() mutable { + workQueue.dispatch(context.globalObject(), [digest = WTF::move(digest), message = WTF::move(message), callback = WTF::move(callback), contextIdentifier = context.identifier()]() mutable { digest->addBytes(message.begin(), message.size()); auto result = digest->computeHash(); - ScriptExecutionContext::postTaskTo(contextIdentifier, [callback = WTFMove(callback), result = WTFMove(result)](auto&) { + ScriptExecutionContext::postTaskTo(contextIdentifier, [callback = WTF::move(callback), result = WTF::move(result)](auto&) { callback(result); }); }); diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA384.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA384.cpp index cfd3b6a030..880b178f17 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA384.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA384.cpp @@ -52,19 +52,19 @@ void CryptoAlgorithmSHA384::digest(Vector&& message, VectorCallback&& c } if (message.size() < 64) { - auto moved = WTFMove(message); + auto moved = WTF::move(message); digest->addBytes(moved.begin(), moved.size()); auto result = digest->computeHash(); - ScriptExecutionContext::postTaskTo(context.identifier(), [callback = WTFMove(callback), result = WTFMove(result)](auto&) { + ScriptExecutionContext::postTaskTo(context.identifier(), [callback = WTF::move(callback), result = WTF::move(result)](auto&) { callback(result); }); return; } - workQueue.dispatch(context.globalObject(), [digest = WTFMove(digest), message = WTFMove(message), callback = WTFMove(callback), contextIdentifier = context.identifier()]() mutable { + workQueue.dispatch(context.globalObject(), [digest = WTF::move(digest), message = WTF::move(message), callback = WTF::move(callback), contextIdentifier = context.identifier()]() mutable { digest->addBytes(message.begin(), message.size()); auto result = digest->computeHash(); - ScriptExecutionContext::postTaskTo(contextIdentifier, [callback = WTFMove(callback), result = WTFMove(result)](auto&) { + ScriptExecutionContext::postTaskTo(contextIdentifier, [callback = WTF::move(callback), result = WTF::move(result)](auto&) { callback(result); }); }); diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA512.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA512.cpp index 0d0b231cbc..0adba58b4b 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA512.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmSHA512.cpp @@ -52,19 +52,19 @@ void CryptoAlgorithmSHA512::digest(Vector&& message, VectorCallback&& c } if (message.size() < 64) { - auto moved = WTFMove(message); + auto moved = WTF::move(message); digest->addBytes(moved.begin(), moved.size()); auto result = digest->computeHash(); - ScriptExecutionContext::postTaskTo(context.identifier(), [callback = WTFMove(callback), result = WTFMove(result)](auto&) { + ScriptExecutionContext::postTaskTo(context.identifier(), [callback = WTF::move(callback), result = WTF::move(result)](auto&) { callback(result); }); return; } - workQueue.dispatch(context.globalObject(), [digest = WTFMove(digest), message = WTFMove(message), callback = WTFMove(callback), contextIdentifier = context.identifier()]() mutable { + workQueue.dispatch(context.globalObject(), [digest = WTF::move(digest), message = WTF::move(message), callback = WTF::move(callback), contextIdentifier = context.identifier()]() mutable { digest->addBytes(message.begin(), message.size()); auto result = digest->computeHash(); - ScriptExecutionContext::postTaskTo(contextIdentifier, [callback = WTFMove(callback), result = WTFMove(result)](auto&) { + ScriptExecutionContext::postTaskTo(contextIdentifier, [callback = WTF::move(callback), result = WTF::move(result)](auto&) { callback(result); }); }); diff --git a/src/bun.js/bindings/webcrypto/CryptoAlgorithmX25519.cpp b/src/bun.js/bindings/webcrypto/CryptoAlgorithmX25519.cpp index e954bdeb6d..a4fd7862d3 100644 --- a/src/bun.js/bindings/webcrypto/CryptoAlgorithmX25519.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoAlgorithmX25519.cpp @@ -56,7 +56,7 @@ void CryptoAlgorithmX25519::generateKey(const CryptoAlgorithmParameters&, bool e auto pair = result.releaseReturnValue(); pair.publicKey->setUsagesBitmap(0); pair.privateKey->setUsagesBitmap(pair.privateKey->usagesBitmap() & (CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits)); - callback(WTFMove(pair)); + callback(WTF::move(pair)); } #if !PLATFORM(COCOA) && !USE(GCRYPT) @@ -97,13 +97,13 @@ void CryptoAlgorithmX25519::deriveBits(const CryptoAlgorithmParameters& paramete return; } - auto unifiedCallback = [callback = WTFMove(callback), exceptionCallback = WTFMove(exceptionCallback)](std::optional>&& derivedKey, std::optional length) mutable { + auto unifiedCallback = [callback = WTF::move(callback), exceptionCallback = WTF::move(exceptionCallback)](std::optional>&& derivedKey, std::optional length) mutable { if (!derivedKey) { exceptionCallback(ExceptionCode::OperationError, ""_s); return; } if (!length) { - callback(WTFMove(*derivedKey)); + callback(WTF::move(*derivedKey)); return; } #if !HAVE(X25519_ZERO_CHECKS) @@ -121,16 +121,16 @@ void CryptoAlgorithmX25519::deriveBits(const CryptoAlgorithmParameters& paramete return; } (*derivedKey).shrink(lengthInBytes); - callback(WTFMove(*derivedKey)); + callback(WTF::move(*derivedKey)); }; // This is a special case that can't use dispatchOperation() because it bundles // the result validation and callback dispatch into unifiedCallback. workQueue.dispatch( context.globalObject(), - [baseKey = WTFMove(baseKey), publicKey = ecParameters.publicKey, length, unifiedCallback = WTFMove(unifiedCallback), contextIdentifier = context.identifier()]() mutable { + [baseKey = WTF::move(baseKey), publicKey = ecParameters.publicKey, length, unifiedCallback = WTF::move(unifiedCallback), contextIdentifier = context.identifier()]() mutable { auto derivedKey = platformDeriveBits(downcast(baseKey.get()), downcast(*publicKey)); - ScriptExecutionContext::postTaskTo(contextIdentifier, [derivedKey = WTFMove(derivedKey), length, unifiedCallback = WTFMove(unifiedCallback)](auto&) mutable { - unifiedCallback(WTFMove(derivedKey), length); + ScriptExecutionContext::postTaskTo(contextIdentifier, [derivedKey = WTF::move(derivedKey), length, unifiedCallback = WTF::move(unifiedCallback)](auto&) mutable { + unifiedCallback(WTF::move(derivedKey), length); }); }); } @@ -140,7 +140,7 @@ void CryptoAlgorithmX25519::importKey(CryptoKeyFormat format, KeyData&& data, co RefPtr result; switch (format) { case CryptoKeyFormat::Jwk: { - JsonWebKey key = WTFMove(std::get(data)); + JsonWebKey key = WTF::move(std::get(data)); bool isUsagesAllowed = false; if (!key.d.isNull()) { @@ -159,7 +159,7 @@ void CryptoAlgorithmX25519::importKey(CryptoKeyFormat format, KeyData&& data, co return; } - result = CryptoKeyOKP::importJwk(CryptoAlgorithmIdentifier::X25519, CryptoKeyOKP::NamedCurve::X25519, WTFMove(key), extractable, usages); + result = CryptoKeyOKP::importJwk(CryptoAlgorithmIdentifier::X25519, CryptoKeyOKP::NamedCurve::X25519, WTF::move(key), extractable, usages); break; } case CryptoKeyFormat::Raw: @@ -167,21 +167,21 @@ void CryptoAlgorithmX25519::importKey(CryptoKeyFormat format, KeyData&& data, co exceptionCallback(ExceptionCode::SyntaxError, ""_s); return; } - result = CryptoKeyOKP::importRaw(CryptoAlgorithmIdentifier::X25519, CryptoKeyOKP::NamedCurve::X25519, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyOKP::importRaw(CryptoAlgorithmIdentifier::X25519, CryptoKeyOKP::NamedCurve::X25519, WTF::move(std::get>(data)), extractable, usages); break; case CryptoKeyFormat::Spki: if (usages) { exceptionCallback(ExceptionCode::SyntaxError, ""_s); return; } - result = CryptoKeyOKP::importSpki(CryptoAlgorithmIdentifier::X25519, CryptoKeyOKP::NamedCurve::X25519, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyOKP::importSpki(CryptoAlgorithmIdentifier::X25519, CryptoKeyOKP::NamedCurve::X25519, WTF::move(std::get>(data)), extractable, usages); break; case CryptoKeyFormat::Pkcs8: if (usages && (usages ^ CryptoKeyUsageDeriveKey) && (usages ^ CryptoKeyUsageDeriveBits) && (usages ^ (CryptoKeyUsageDeriveKey | CryptoKeyUsageDeriveBits))) { exceptionCallback(ExceptionCode::SyntaxError, ""_s); return; } - result = CryptoKeyOKP::importPkcs8(CryptoAlgorithmIdentifier::X25519, CryptoKeyOKP::NamedCurve::X25519, WTFMove(std::get>(data)), extractable, usages); + result = CryptoKeyOKP::importPkcs8(CryptoAlgorithmIdentifier::X25519, CryptoKeyOKP::NamedCurve::X25519, WTF::move(std::get>(data)), extractable, usages); break; } if (!result) { @@ -241,7 +241,7 @@ void CryptoAlgorithmX25519::exportKey(CryptoKeyFormat format, Ref&& k } } - callback(format, WTFMove(result)); + callback(format, WTF::move(result)); } } // namespace WebCore diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyAES.cpp b/src/bun.js/bindings/webcrypto/CryptoKeyAES.cpp index 12a84ebef2..fccffe6219 100644 --- a/src/bun.js/bindings/webcrypto/CryptoKeyAES.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoKeyAES.cpp @@ -52,7 +52,7 @@ CryptoKeyAES::CryptoKeyAES(CryptoAlgorithmIdentifier algorithm, const Vector&& key, bool extractable, CryptoKeyUsageBitmap usage) : CryptoKey(algorithm, CryptoKeyType::Secret, extractable, usage) - , m_key(WTFMove(key)) + , m_key(WTF::move(key)) { ASSERT(isValidAESAlgorithm(algorithm)); } @@ -79,7 +79,7 @@ RefPtr CryptoKeyAES::importRaw(CryptoAlgorithmIdentifier algorithm { if (!lengthIsValid(keyData.size() * 8)) return nullptr; - return adoptRef(new CryptoKeyAES(algorithm, WTFMove(keyData), extractable, usages)); + return adoptRef(new CryptoKeyAES(algorithm, WTF::move(keyData), extractable, usages)); } RefPtr CryptoKeyAES::importJwk(CryptoAlgorithmIdentifier algorithm, JsonWebKey&& keyData, bool extractable, CryptoKeyUsageBitmap usages, CheckAlgCallback&& callback) @@ -100,7 +100,7 @@ RefPtr CryptoKeyAES::importJwk(CryptoAlgorithmIdentifier algorithm if (keyData.ext && !keyData.ext.value() && extractable) return nullptr; - return adoptRef(new CryptoKeyAES(algorithm, WTFMove(*octetSequence), extractable, usages)); + return adoptRef(new CryptoKeyAES(algorithm, WTF::move(*octetSequence), extractable, usages)); } JsonWebKey CryptoKeyAES::exportJwk() const diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyEC.cpp b/src/bun.js/bindings/webcrypto/CryptoKeyEC.cpp index 596e23d8d9..8a48467947 100644 --- a/src/bun.js/bindings/webcrypto/CryptoKeyEC.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoKeyEC.cpp @@ -52,7 +52,7 @@ static std::optional toNamedCurve(const String& curve) CryptoKeyEC::CryptoKeyEC(CryptoAlgorithmIdentifier identifier, NamedCurve curve, CryptoKeyType type, PlatformECKeyContainer&& platformKey, bool extractable, CryptoKeyUsageBitmap usages) : CryptoKey(identifier, type, extractable, usages) - , m_platformKey(WTFMove(platformKey)) + , m_platformKey(WTF::move(platformKey)) , m_curve(curve) { // Only CryptoKeyEC objects for supported curves should be created. @@ -69,7 +69,7 @@ ExceptionOr CryptoKeyEC::generatePair(CryptoAlgorithmIdentifier i if (!result) return Exception { OperationError }; - return WTFMove(*result); + return WTF::move(*result); } RefPtr CryptoKeyEC::importRaw(CryptoAlgorithmIdentifier identifier, const String& curve, Vector&& keyData, bool extractable, CryptoKeyUsageBitmap usages) @@ -78,7 +78,7 @@ RefPtr CryptoKeyEC::importRaw(CryptoAlgorithmIdentifier identifier, if (!namedCurve || !platformSupportedCurve(*namedCurve)) return nullptr; - return platformImportRaw(identifier, *namedCurve, WTFMove(keyData), extractable, usages); + return platformImportRaw(identifier, *namedCurve, WTF::move(keyData), extractable, usages); } RefPtr CryptoKeyEC::importJwk(CryptoAlgorithmIdentifier identifier, const String& curve, JsonWebKey&& keyData, bool extractable, CryptoKeyUsageBitmap usages) @@ -106,14 +106,14 @@ RefPtr CryptoKeyEC::importJwk(CryptoAlgorithmIdentifier identifier, return nullptr; if (keyData.d.isNull()) { // import public key - return platformImportJWKPublic(identifier, *namedCurve, WTFMove(*x), WTFMove(*y), extractable, usages); + return platformImportJWKPublic(identifier, *namedCurve, WTF::move(*x), WTF::move(*y), extractable, usages); } auto d = base64URLDecode(keyData.d); if (!d) return nullptr; // import private key - return platformImportJWKPrivate(identifier, *namedCurve, WTFMove(*x), WTFMove(*y), WTFMove(*d), extractable, usages); + return platformImportJWKPrivate(identifier, *namedCurve, WTF::move(*x), WTF::move(*y), WTF::move(*d), extractable, usages); } RefPtr CryptoKeyEC::importSpki(CryptoAlgorithmIdentifier identifier, const String& curve, Vector&& keyData, bool extractable, CryptoKeyUsageBitmap usages) @@ -122,7 +122,7 @@ RefPtr CryptoKeyEC::importSpki(CryptoAlgorithmIdentifier identifier if (!namedCurve || !platformSupportedCurve(*namedCurve)) return nullptr; - return platformImportSpki(identifier, *namedCurve, WTFMove(keyData), extractable, usages); + return platformImportSpki(identifier, *namedCurve, WTF::move(keyData), extractable, usages); } RefPtr CryptoKeyEC::importPkcs8(CryptoAlgorithmIdentifier identifier, const String& curve, Vector&& keyData, bool extractable, CryptoKeyUsageBitmap usages) @@ -131,7 +131,7 @@ RefPtr CryptoKeyEC::importPkcs8(CryptoAlgorithmIdentifier identifie if (!namedCurve || !platformSupportedCurve(*namedCurve)) return nullptr; - return platformImportPkcs8(identifier, *namedCurve, WTFMove(keyData), extractable, usages); + return platformImportPkcs8(identifier, *namedCurve, WTF::move(keyData), extractable, usages); } ExceptionOr> CryptoKeyEC::exportRaw() const @@ -142,7 +142,7 @@ ExceptionOr> CryptoKeyEC::exportRaw() const auto&& result = platformExportRaw(); if (result.isEmpty()) return Exception { OperationError }; - return WTFMove(result); + return WTF::move(result); } ExceptionOr CryptoKeyEC::exportJwk() const @@ -175,7 +175,7 @@ ExceptionOr> CryptoKeyEC::exportSpki() const auto&& result = platformExportSpki(); if (result.isEmpty()) return Exception { OperationError }; - return WTFMove(result); + return WTF::move(result); } ExceptionOr> CryptoKeyEC::exportPkcs8() const @@ -186,7 +186,7 @@ ExceptionOr> CryptoKeyEC::exportPkcs8() const auto&& result = platformExportPkcs8(); if (result.isEmpty()) return Exception { OperationError }; - return WTFMove(result); + return WTF::move(result); } String CryptoKeyEC::namedCurveString() const diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyEC.h b/src/bun.js/bindings/webcrypto/CryptoKeyEC.h index 8e8f5eb351..f8fb270ae2 100644 --- a/src/bun.js/bindings/webcrypto/CryptoKeyEC.h +++ b/src/bun.js/bindings/webcrypto/CryptoKeyEC.h @@ -70,7 +70,7 @@ public: static Ref create(CryptoAlgorithmIdentifier identifier, NamedCurve curve, CryptoKeyType type, PlatformECKeyContainer&& platformKey, bool extractable, CryptoKeyUsageBitmap usages) { - return adoptRef(*new CryptoKeyEC(identifier, curve, type, WTFMove(platformKey), extractable, usages)); + return adoptRef(*new CryptoKeyEC(identifier, curve, type, WTF::move(platformKey), extractable, usages)); } virtual ~CryptoKeyEC() = default; diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyECOpenSSL.cpp b/src/bun.js/bindings/webcrypto/CryptoKeyECOpenSSL.cpp index 565d98264c..05a597f53f 100644 --- a/src/bun.js/bindings/webcrypto/CryptoKeyECOpenSSL.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoKeyECOpenSSL.cpp @@ -130,9 +130,9 @@ std::optional CryptoKeyEC::platformGeneratePair(CryptoAlgorithmId if (EVP_PKEY_set1_EC_KEY(publicPKey.get(), publicECKey.get()) <= 0) return std::nullopt; - auto publicKey = CryptoKeyEC::create(identifier, curve, CryptoKeyType::Public, WTFMove(publicPKey), true, usages); - auto privateKey = CryptoKeyEC::create(identifier, curve, CryptoKeyType::Private, WTFMove(privatePKey), extractable, usages); - return CryptoKeyPair { WTFMove(publicKey), WTFMove(privateKey) }; + auto publicKey = CryptoKeyEC::create(identifier, curve, CryptoKeyType::Public, WTF::move(publicPKey), true, usages); + auto privateKey = CryptoKeyEC::create(identifier, curve, CryptoKeyType::Private, WTF::move(privatePKey), extractable, usages); + return CryptoKeyPair { WTF::move(publicKey), WTF::move(privateKey) }; } RefPtr CryptoKeyEC::platformImportRaw(CryptoAlgorithmIdentifier identifier, NamedCurve curve, Vector&& keyData, bool extractable, CryptoKeyUsageBitmap usages) @@ -157,7 +157,7 @@ RefPtr CryptoKeyEC::platformImportRaw(CryptoAlgorithmIdentifier ide if (EVP_PKEY_set1_EC_KEY(pkey.get(), key.get()) <= 0) return nullptr; - return create(identifier, curve, CryptoKeyType::Public, WTFMove(pkey), extractable, usages); + return create(identifier, curve, CryptoKeyType::Public, WTF::move(pkey), extractable, usages); } RefPtr CryptoKeyEC::platformImportJWKPublic(CryptoAlgorithmIdentifier identifier, NamedCurve curve, Vector&& x, Vector&& y, bool extractable, CryptoKeyUsageBitmap usages) @@ -183,7 +183,7 @@ RefPtr CryptoKeyEC::platformImportJWKPublic(CryptoAlgorithmIdentifi if (EVP_PKEY_set1_EC_KEY(pkey.get(), key.get()) <= 0) return nullptr; - return create(identifier, curve, CryptoKeyType::Public, WTFMove(pkey), extractable, usages); + return create(identifier, curve, CryptoKeyType::Public, WTF::move(pkey), extractable, usages); } RefPtr CryptoKeyEC::platformImportJWKPrivate(CryptoAlgorithmIdentifier identifier, NamedCurve curve, Vector&& x, Vector&& y, Vector&& d, bool extractable, CryptoKeyUsageBitmap usages) @@ -212,7 +212,7 @@ RefPtr CryptoKeyEC::platformImportJWKPrivate(CryptoAlgorithmIdentif if (EVP_PKEY_set1_EC_KEY(pkey.get(), key.get()) <= 0) return nullptr; - return create(identifier, curve, CryptoKeyType::Private, WTFMove(pkey), extractable, usages); + return create(identifier, curve, CryptoKeyType::Private, WTF::move(pkey), extractable, usages); } static const ASN1_OBJECT* ecPublicKeyIdentifier() @@ -342,7 +342,7 @@ RefPtr CryptoKeyEC::platformImportSpki(CryptoAlgorithmIdentifier id if (EVP_PKEY_set1_EC_KEY(pkey.get(), key.get()) <= 0) return nullptr; - return adoptRef(new CryptoKeyEC(identifier, curve, CryptoKeyType::Public, WTFMove(pkey), extractable, usages)); + return adoptRef(new CryptoKeyEC(identifier, curve, CryptoKeyType::Public, WTF::move(pkey), extractable, usages)); } RefPtr CryptoKeyEC::platformImportPkcs8(CryptoAlgorithmIdentifier identifier, NamedCurve curve, Vector&& keyData, bool extractable, CryptoKeyUsageBitmap usages) @@ -373,7 +373,7 @@ RefPtr CryptoKeyEC::platformImportPkcs8(CryptoAlgorithmIdentifier i EC_KEY_set_asn1_flag(ecKey, OPENSSL_EC_NAMED_CURVE); - return adoptRef(new CryptoKeyEC(identifier, curve, CryptoKeyType::Private, WTFMove(pkey), extractable, usages)); + return adoptRef(new CryptoKeyEC(identifier, curve, CryptoKeyType::Private, WTF::move(pkey), extractable, usages)); } Vector CryptoKeyEC::platformExportRaw() const diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyHMAC.cpp b/src/bun.js/bindings/webcrypto/CryptoKeyHMAC.cpp index 2ffd83a00b..5bde29b77e 100644 --- a/src/bun.js/bindings/webcrypto/CryptoKeyHMAC.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoKeyHMAC.cpp @@ -64,7 +64,7 @@ CryptoKeyHMAC::CryptoKeyHMAC(const Vector& key, CryptoAlgorithmIdentifi CryptoKeyHMAC::CryptoKeyHMAC(Vector&& key, CryptoAlgorithmIdentifier hash, bool extractable, CryptoKeyUsageBitmap usage) : CryptoKey(CryptoAlgorithmIdentifier::HMAC, CryptoKeyType::Secret, extractable, usage) , m_hash(hash) - , m_key(WTFMove(key)) + , m_key(WTF::move(key)) { } @@ -102,7 +102,7 @@ RefPtr CryptoKeyHMAC::importRaw(size_t lengthBits, CryptoAlgorith if (lengthBits && lengthBits != length) return nullptr; - return adoptRef(new CryptoKeyHMAC(WTFMove(keyData), hash, extractable, usages)); + return adoptRef(new CryptoKeyHMAC(WTF::move(keyData), hash, extractable, usages)); } RefPtr CryptoKeyHMAC::importJwk(size_t lengthBits, CryptoAlgorithmIdentifier hash, JsonWebKey&& keyData, bool extractable, CryptoKeyUsageBitmap usages, CheckAlgCallback&& callback) @@ -123,7 +123,7 @@ RefPtr CryptoKeyHMAC::importJwk(size_t lengthBits, CryptoAlgorith if (keyData.ext && !keyData.ext.value() && extractable) return nullptr; - return CryptoKeyHMAC::importRaw(lengthBits, hash, WTFMove(*octetSequence), extractable, usages); + return CryptoKeyHMAC::importRaw(lengthBits, hash, WTF::move(*octetSequence), extractable, usages); } JsonWebKey CryptoKeyHMAC::exportJwk() const diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyOKP.cpp b/src/bun.js/bindings/webcrypto/CryptoKeyOKP.cpp index 5534416fe2..1f5b17a3dc 100644 --- a/src/bun.js/bindings/webcrypto/CryptoKeyOKP.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoKeyOKP.cpp @@ -78,17 +78,17 @@ RefPtr CryptoKeyOKP::create(CryptoAlgorithmIdentifier identifier, // Import format only consists of 32 bytes of private key // Internal format is private key + public key suffix if (platformKey.size() == bytesExpectedExternal) { - auto&& privateKey = ed25519PrivateFromSeed(WTFMove(platformKey)); + auto&& privateKey = ed25519PrivateFromSeed(WTF::move(platformKey)); if (privateKey.size() == 0) return nullptr; - return adoptRef(*new CryptoKeyOKP(identifier, curve, type, WTFMove(privateKey), extractable, usages)); + return adoptRef(*new CryptoKeyOKP(identifier, curve, type, WTF::move(privateKey), extractable, usages)); } return nullptr; } - return adoptRef(*new CryptoKeyOKP(identifier, curve, type, WTFMove(platformKey), extractable, usages)); + return adoptRef(*new CryptoKeyOKP(identifier, curve, type, WTF::move(platformKey), extractable, usages)); } CryptoKeyOKP::CryptoKeyOKP(CryptoAlgorithmIdentifier identifier, NamedCurve curve, CryptoKeyType type, KeyMaterial&& data, bool extractable, CryptoKeyUsageBitmap usages) @@ -108,7 +108,7 @@ ExceptionOr CryptoKeyOKP::generatePair(CryptoAlgorithmIdentifier if (!result) return Exception { OperationError }; - return WTFMove(*result); + return WTF::move(*result); } RefPtr CryptoKeyOKP::importRaw(CryptoAlgorithmIdentifier identifier, NamedCurve namedCurve, Vector&& keyData, bool extractable, CryptoKeyUsageBitmap usages) @@ -116,7 +116,7 @@ RefPtr CryptoKeyOKP::importRaw(CryptoAlgorithmIdentifier identifie if (!isPlatformSupportedCurve(namedCurve)) return nullptr; - return create(identifier, namedCurve, usages & CryptoKeyUsageSign ? CryptoKeyType::Private : CryptoKeyType::Public, WTFMove(keyData), extractable, usages); + return create(identifier, namedCurve, usages & CryptoKeyUsageSign ? CryptoKeyType::Private : CryptoKeyType::Public, WTF::move(keyData), extractable, usages); } RefPtr CryptoKeyOKP::importJwkInternal(CryptoAlgorithmIdentifier identifier, NamedCurve namedCurve, JsonWebKey&& keyData, bool extractable, CryptoKeyUsageBitmap usages, bool onlyPublic) @@ -157,7 +157,7 @@ RefPtr CryptoKeyOKP::importJwkInternal(CryptoAlgorithmIdentifier i auto d = base64URLDecode(keyData.d); if (!d) return nullptr; - return create(identifier, namedCurve, CryptoKeyType::Private, WTFMove(*d), extractable, usages); + return create(identifier, namedCurve, CryptoKeyType::Private, WTF::move(*d), extractable, usages); } } @@ -167,16 +167,16 @@ RefPtr CryptoKeyOKP::importJwkInternal(CryptoAlgorithmIdentifier i auto x = base64URLDecode(keyData.x); if (!x) return nullptr; - return create(identifier, namedCurve, CryptoKeyType::Public, WTFMove(*x), extractable, usages); + return create(identifier, namedCurve, CryptoKeyType::Public, WTF::move(*x), extractable, usages); } RefPtr CryptoKeyOKP::importPublicJwk(CryptoAlgorithmIdentifier identifier, NamedCurve namedCurve, JsonWebKey&& keyData, bool extractable, CryptoKeyUsageBitmap usages) { - return importJwkInternal(identifier, namedCurve, WTFMove(keyData), extractable, usages, true); + return importJwkInternal(identifier, namedCurve, WTF::move(keyData), extractable, usages, true); } RefPtr CryptoKeyOKP::importJwk(CryptoAlgorithmIdentifier identifier, NamedCurve namedCurve, JsonWebKey&& keyData, bool extractable, CryptoKeyUsageBitmap usages) { - return importJwkInternal(identifier, namedCurve, WTFMove(keyData), extractable, usages, false); + return importJwkInternal(identifier, namedCurve, WTF::move(keyData), extractable, usages, false); } ExceptionOr> CryptoKeyOKP::exportRaw() const @@ -187,7 +187,7 @@ ExceptionOr> CryptoKeyOKP::exportRaw() const auto&& result = platformExportRaw(); if (result.isEmpty()) return Exception { OperationError }; - return WTFMove(result); + return WTF::move(result); } ExceptionOr CryptoKeyOKP::exportJwk() const diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyOKPOpenSSL.cpp b/src/bun.js/bindings/webcrypto/CryptoKeyOKPOpenSSL.cpp index 480a42ac96..de29f6f753 100644 --- a/src/bun.js/bindings/webcrypto/CryptoKeyOKPOpenSSL.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoKeyOKPOpenSSL.cpp @@ -56,11 +56,11 @@ std::optional CryptoKeyOKP::platformGeneratePair(CryptoAlgorithmI } bool isPublicKeyExtractable = true; - auto publicKey = CryptoKeyOKP::create(identifier, namedCurve, CryptoKeyType::Public, WTFMove(public_key), isPublicKeyExtractable, usages); + auto publicKey = CryptoKeyOKP::create(identifier, namedCurve, CryptoKeyType::Public, WTF::move(public_key), isPublicKeyExtractable, usages); ASSERT(publicKey); auto privateKey = CryptoKeyOKP::create(identifier, namedCurve, CryptoKeyType::Private, Vector(std::span { private_key.begin(), isEd25519 ? (unsigned int)ED25519_PRIVATE_KEY_LEN : (unsigned int)X25519_PRIVATE_KEY_LEN }), extractable, usages); ASSERT(privateKey); - return CryptoKeyPair { WTFMove(publicKey), WTFMove(privateKey) }; + return CryptoKeyPair { WTF::move(publicKey), WTF::move(privateKey) }; } // Per https://www.ietf.org/rfc/rfc5280.txt @@ -179,7 +179,7 @@ ExceptionOr> CryptoKeyOKP::exportSpki() const ASSERT(result.size() == totalSize); - return WTFMove(result); + return WTF::move(result); } // Per https://www.ietf.org/rfc/rfc5280.txt @@ -288,7 +288,7 @@ ExceptionOr> CryptoKeyOKP::exportPkcs8() const ASSERT(result.size() == totalSize); - return WTFMove(result); + return WTF::move(result); } String CryptoKeyOKP::generateJwkD() const diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyRSA.cpp b/src/bun.js/bindings/webcrypto/CryptoKeyRSA.cpp index 7e2fc56194..9f69d617e9 100644 --- a/src/bun.js/bindings/webcrypto/CryptoKeyRSA.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoKeyRSA.cpp @@ -57,7 +57,7 @@ RefPtr CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm return nullptr; if (keyData.d.isNull()) { // import public key - auto publicKeyComponents = CryptoKeyRSAComponents::createPublic(WTFMove(*modulus), WTFMove(*exponent)); + auto publicKeyComponents = CryptoKeyRSAComponents::createPublic(WTF::move(*modulus), WTF::move(*exponent)); // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is std::nullopt. return CryptoKeyRSA::create(algorithm, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, *publicKeyComponents, extractable, usages); } @@ -67,7 +67,7 @@ RefPtr CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm if (!privateExponent) return nullptr; if (keyData.p.isNull() && keyData.q.isNull() && keyData.dp.isNull() && keyData.dp.isNull() && keyData.qi.isNull()) { - auto privateKeyComponents = CryptoKeyRSAComponents::createPrivate(WTFMove(*modulus), WTFMove(*exponent), WTFMove(*privateExponent)); + auto privateKeyComponents = CryptoKeyRSAComponents::createPrivate(WTF::move(*modulus), WTF::move(*exponent), WTF::move(*privateExponent)); // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is std::nullopt. return CryptoKeyRSA::create(algorithm, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages); } @@ -92,16 +92,16 @@ RefPtr CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm return nullptr; CryptoKeyRSAComponents::PrimeInfo firstPrimeInfo; - firstPrimeInfo.primeFactor = WTFMove(*firstPrimeFactor); - firstPrimeInfo.factorCRTExponent = WTFMove(*firstFactorCRTExponent); + firstPrimeInfo.primeFactor = WTF::move(*firstPrimeFactor); + firstPrimeInfo.factorCRTExponent = WTF::move(*firstFactorCRTExponent); CryptoKeyRSAComponents::PrimeInfo secondPrimeInfo; - secondPrimeInfo.primeFactor = WTFMove(*secondPrimeFactor); - secondPrimeInfo.factorCRTExponent = WTFMove(*secondFactorCRTExponent); - secondPrimeInfo.factorCRTCoefficient = WTFMove(*secondFactorCRTCoefficient); + secondPrimeInfo.primeFactor = WTF::move(*secondPrimeFactor); + secondPrimeInfo.factorCRTExponent = WTF::move(*secondFactorCRTExponent); + secondPrimeInfo.factorCRTCoefficient = WTF::move(*secondFactorCRTCoefficient); if (!keyData.oth) { - auto privateKeyComponents = CryptoKeyRSAComponents::createPrivateWithAdditionalData(WTFMove(*modulus), WTFMove(*exponent), WTFMove(*privateExponent), WTFMove(firstPrimeInfo), WTFMove(secondPrimeInfo), {}); + auto privateKeyComponents = CryptoKeyRSAComponents::createPrivateWithAdditionalData(WTF::move(*modulus), WTF::move(*exponent), WTF::move(*privateExponent), WTF::move(firstPrimeInfo), WTF::move(secondPrimeInfo), {}); // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is std::nullopt. return CryptoKeyRSA::create(algorithm, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages); } @@ -119,14 +119,14 @@ RefPtr CryptoKeyRSA::importJwk(CryptoAlgorithmIdentifier algorithm return nullptr; CryptoKeyRSAComponents::PrimeInfo info; - info.primeFactor = WTFMove(*primeFactor); - info.factorCRTExponent = WTFMove(*factorCRTExponent); - info.factorCRTCoefficient = WTFMove(*factorCRTCoefficient); + info.primeFactor = WTF::move(*primeFactor); + info.factorCRTExponent = WTF::move(*factorCRTExponent); + info.factorCRTCoefficient = WTF::move(*factorCRTCoefficient); - otherPrimeInfos.append(WTFMove(info)); + otherPrimeInfos.append(WTF::move(info)); } - auto privateKeyComponents = CryptoKeyRSAComponents::createPrivateWithAdditionalData(WTFMove(*modulus), WTFMove(*exponent), WTFMove(*privateExponent), WTFMove(firstPrimeInfo), WTFMove(secondPrimeInfo), WTFMove(otherPrimeInfos)); + auto privateKeyComponents = CryptoKeyRSAComponents::createPrivateWithAdditionalData(WTF::move(*modulus), WTF::move(*exponent), WTF::move(*privateExponent), WTF::move(firstPrimeInfo), WTF::move(secondPrimeInfo), WTF::move(otherPrimeInfos)); // Notice: CryptoAlgorithmIdentifier::SHA_1 is just a placeholder. It should not have any effect if hash is std::nullopt. return CryptoKeyRSA::create(algorithm, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, *privateKeyComponents, extractable, usages); } @@ -168,9 +168,9 @@ JsonWebKey CryptoKeyRSA::exportJwk() const otherInfo.r = Bun::base64URLEncodeToString(info.primeFactor); otherInfo.d = Bun::base64URLEncodeToString(info.factorCRTExponent); otherInfo.t = Bun::base64URLEncodeToString(info.factorCRTCoefficient); - oth.append(WTFMove(otherInfo)); + oth.append(WTF::move(otherInfo)); } - result.oth = WTFMove(oth); + result.oth = WTF::move(oth); return result; } diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyRSA.h b/src/bun.js/bindings/webcrypto/CryptoKeyRSA.h index 70f9cf648a..9c26536cd3 100644 --- a/src/bun.js/bindings/webcrypto/CryptoKeyRSA.h +++ b/src/bun.js/bindings/webcrypto/CryptoKeyRSA.h @@ -69,7 +69,7 @@ class CryptoKeyRSA final : public CryptoKey { public: static Ref create(CryptoAlgorithmIdentifier identifier, CryptoAlgorithmIdentifier hash, bool hasHash, CryptoKeyType type, PlatformRSAKeyContainer&& platformKey, bool extractable, CryptoKeyUsageBitmap usage) { - return adoptRef(*new CryptoKeyRSA(identifier, hash, hasHash, type, WTFMove(platformKey), extractable, usage)); + return adoptRef(*new CryptoKeyRSA(identifier, hash, hasHash, type, WTF::move(platformKey), extractable, usage)); } static RefPtr create(CryptoAlgorithmIdentifier, CryptoAlgorithmIdentifier hash, bool hasHash, const CryptoKeyRSAComponents&, bool extractable, CryptoKeyUsageBitmap); virtual ~CryptoKeyRSA() = default; diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyRSAComponents.cpp b/src/bun.js/bindings/webcrypto/CryptoKeyRSAComponents.cpp index f9b6052cd7..ffd0cf5f76 100644 --- a/src/bun.js/bindings/webcrypto/CryptoKeyRSAComponents.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoKeyRSAComponents.cpp @@ -39,8 +39,8 @@ CryptoKeyRSAComponents::CryptoKeyRSAComponents(const Vector& modulus, c CryptoKeyRSAComponents::CryptoKeyRSAComponents(Vector&& modulus, Vector&& exponent) : m_type(Type::Public) - , m_modulus(WTFMove(modulus)) - , m_exponent(WTFMove(exponent)) + , m_modulus(WTF::move(modulus)) + , m_exponent(WTF::move(exponent)) { } @@ -55,9 +55,9 @@ CryptoKeyRSAComponents::CryptoKeyRSAComponents(const Vector& modulus, c CryptoKeyRSAComponents::CryptoKeyRSAComponents(Vector&& modulus, Vector&& exponent, Vector&& privateExponent) : m_type(Type::Private) - , m_modulus(WTFMove(modulus)) - , m_exponent(WTFMove(exponent)) - , m_privateExponent(WTFMove(privateExponent)) + , m_modulus(WTF::move(modulus)) + , m_exponent(WTF::move(exponent)) + , m_privateExponent(WTF::move(privateExponent)) , m_hasAdditionalPrivateKeyParameters(false) { } @@ -76,13 +76,13 @@ CryptoKeyRSAComponents::CryptoKeyRSAComponents(const Vector& modulus, c CryptoKeyRSAComponents::CryptoKeyRSAComponents(Vector&& modulus, Vector&& exponent, Vector&& privateExponent, PrimeInfo&& firstPrimeInfo, PrimeInfo&& secondPrimeInfo, Vector&& otherPrimeInfos) : m_type(Type::Private) - , m_modulus(WTFMove(modulus)) - , m_exponent(WTFMove(exponent)) - , m_privateExponent(WTFMove(privateExponent)) + , m_modulus(WTF::move(modulus)) + , m_exponent(WTF::move(exponent)) + , m_privateExponent(WTF::move(privateExponent)) , m_hasAdditionalPrivateKeyParameters(true) - , m_firstPrimeInfo(WTFMove(firstPrimeInfo)) - , m_secondPrimeInfo(WTFMove(secondPrimeInfo)) - , m_otherPrimeInfos(WTFMove(otherPrimeInfos)) + , m_firstPrimeInfo(WTF::move(firstPrimeInfo)) + , m_secondPrimeInfo(WTF::move(secondPrimeInfo)) + , m_otherPrimeInfos(WTF::move(otherPrimeInfos)) { } diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyRSAComponents.h b/src/bun.js/bindings/webcrypto/CryptoKeyRSAComponents.h index 26ed55c4e7..c8805cf28e 100644 --- a/src/bun.js/bindings/webcrypto/CryptoKeyRSAComponents.h +++ b/src/bun.js/bindings/webcrypto/CryptoKeyRSAComponents.h @@ -50,7 +50,7 @@ public: } static std::unique_ptr createPublic(Vector&& modulus, Vector&& exponent) { - return std::unique_ptr(new CryptoKeyRSAComponents(WTFMove(modulus), WTFMove(exponent))); + return std::unique_ptr(new CryptoKeyRSAComponents(WTF::move(modulus), WTF::move(exponent))); } static std::unique_ptr createPrivate(const Vector& modulus, const Vector& exponent, const Vector& privateExponent) @@ -59,7 +59,7 @@ public: } static std::unique_ptr createPrivate(Vector&& modulus, Vector&& exponent, Vector&& privateExponent) { - return std::unique_ptr(new CryptoKeyRSAComponents(WTFMove(modulus), WTFMove(exponent), WTFMove(privateExponent))); + return std::unique_ptr(new CryptoKeyRSAComponents(WTF::move(modulus), WTF::move(exponent), WTF::move(privateExponent))); } static std::unique_ptr createPrivateWithAdditionalData(const Vector& modulus, const Vector& exponent, const Vector& privateExponent, const PrimeInfo& firstPrimeInfo, const PrimeInfo& secondPrimeInfo, const Vector& otherPrimeInfos) @@ -68,7 +68,7 @@ public: } static std::unique_ptr createPrivateWithAdditionalData(Vector&& modulus, Vector&& exponent, Vector&& privateExponent, PrimeInfo&& firstPrimeInfo, PrimeInfo&& secondPrimeInfo, Vector&& otherPrimeInfos) { - return std::unique_ptr(new CryptoKeyRSAComponents(WTFMove(modulus), WTFMove(exponent), WTFMove(privateExponent), WTFMove(firstPrimeInfo), WTFMove(secondPrimeInfo), WTFMove(otherPrimeInfos))); + return std::unique_ptr(new CryptoKeyRSAComponents(WTF::move(modulus), WTF::move(exponent), WTF::move(privateExponent), WTF::move(firstPrimeInfo), WTF::move(secondPrimeInfo), WTF::move(otherPrimeInfos))); } virtual ~CryptoKeyRSAComponents(); diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyRSAOpenSSL.cpp b/src/bun.js/bindings/webcrypto/CryptoKeyRSAOpenSSL.cpp index b52f7dc959..7693921410 100644 --- a/src/bun.js/bindings/webcrypto/CryptoKeyRSAOpenSSL.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoKeyRSAOpenSSL.cpp @@ -143,12 +143,12 @@ RefPtr CryptoKeyRSA::create(CryptoAlgorithmIdentifier identifier, if (EVP_PKEY_set1_RSA(pkey.get(), rsa.get()) != 1) return nullptr; - return adoptRef(new CryptoKeyRSA(identifier, hash, hasHash, keyType, WTFMove(pkey), extractable, usages)); + return adoptRef(new CryptoKeyRSA(identifier, hash, hasHash, keyType, WTF::move(pkey), extractable, usages)); } CryptoKeyRSA::CryptoKeyRSA(CryptoAlgorithmIdentifier identifier, CryptoAlgorithmIdentifier hash, bool hasHash, CryptoKeyType type, PlatformRSAKeyContainer&& platformKey, bool extractable, CryptoKeyUsageBitmap usages) : CryptoKey(identifier, type, extractable, usages) - , m_platformKey(WTFMove(platformKey)) + , m_platformKey(WTF::move(platformKey)) , m_restrictedToSpecificHash(hasHash) , m_hash(hash) { @@ -223,9 +223,9 @@ void CryptoKeyRSA::generatePair(CryptoAlgorithmIdentifier algorithm, CryptoAlgor return; } - auto publicKey = CryptoKeyRSA::create(algorithm, hash, hasHash, CryptoKeyType::Public, WTFMove(publicPKey), true, usages); - auto privateKey = CryptoKeyRSA::create(algorithm, hash, hasHash, CryptoKeyType::Private, WTFMove(privatePKey), extractable, usages); - callback(CryptoKeyPair { WTFMove(publicKey), WTFMove(privateKey) }); + auto publicKey = CryptoKeyRSA::create(algorithm, hash, hasHash, CryptoKeyType::Public, WTF::move(publicPKey), true, usages); + auto privateKey = CryptoKeyRSA::create(algorithm, hash, hasHash, CryptoKeyType::Private, WTF::move(privatePKey), extractable, usages); + callback(CryptoKeyPair { WTF::move(publicKey), WTF::move(privateKey) }); } RefPtr CryptoKeyRSA::importSpki(CryptoAlgorithmIdentifier identifier, std::optional hash, Vector&& keyData, bool extractable, CryptoKeyUsageBitmap usages) @@ -238,7 +238,7 @@ RefPtr CryptoKeyRSA::importSpki(CryptoAlgorithmIdentifier identifi if (!pkey || EVP_PKEY_id(pkey.get()) != EVP_PKEY_RSA) return nullptr; - return adoptRef(new CryptoKeyRSA(identifier, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, CryptoKeyType::Public, WTFMove(pkey), extractable, usages)); + return adoptRef(new CryptoKeyRSA(identifier, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, CryptoKeyType::Public, WTF::move(pkey), extractable, usages)); } RefPtr CryptoKeyRSA::importPkcs8(CryptoAlgorithmIdentifier identifier, std::optional hash, Vector&& keyData, bool extractable, CryptoKeyUsageBitmap usages) @@ -255,7 +255,7 @@ RefPtr CryptoKeyRSA::importPkcs8(CryptoAlgorithmIdentifier identif if (!pkey || EVP_PKEY_id(pkey.get()) != EVP_PKEY_RSA) return nullptr; - return adoptRef(new CryptoKeyRSA(identifier, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, CryptoKeyType::Private, WTFMove(pkey), extractable, usages)); + return adoptRef(new CryptoKeyRSA(identifier, hash.value_or(CryptoAlgorithmIdentifier::SHA_1), !!hash, CryptoKeyType::Private, WTF::move(pkey), extractable, usages)); } ExceptionOr> CryptoKeyRSA::exportSpki() const @@ -395,7 +395,7 @@ std::unique_ptr CryptoKeyRSA::exportData() const return CryptoKeyRSAComponents::createPrivateWithAdditionalData( convertToBytes(n), convertToBytes(e), convertToBytes(d), - WTFMove(firstPrimeInfo), WTFMove(secondPrimeInfo), Vector {}); + WTF::move(firstPrimeInfo), WTF::move(secondPrimeInfo), Vector {}); } default: ASSERT_NOT_REACHED(); diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyRaw.cpp b/src/bun.js/bindings/webcrypto/CryptoKeyRaw.cpp index c75684189d..405b69942f 100644 --- a/src/bun.js/bindings/webcrypto/CryptoKeyRaw.cpp +++ b/src/bun.js/bindings/webcrypto/CryptoKeyRaw.cpp @@ -34,7 +34,7 @@ namespace WebCore { CryptoKeyRaw::CryptoKeyRaw(CryptoAlgorithmIdentifier identifier, Vector&& keyData, CryptoKeyUsageBitmap usages) : CryptoKey(identifier, CryptoKeyType::Secret, false, usages) - , m_key(WTFMove(keyData)) + , m_key(WTF::move(keyData)) { } diff --git a/src/bun.js/bindings/webcrypto/CryptoKeyRaw.h b/src/bun.js/bindings/webcrypto/CryptoKeyRaw.h index df5b6b831b..bd9d90b4e5 100644 --- a/src/bun.js/bindings/webcrypto/CryptoKeyRaw.h +++ b/src/bun.js/bindings/webcrypto/CryptoKeyRaw.h @@ -35,7 +35,7 @@ class CryptoKeyRaw final : public CryptoKey { public: static Ref create(CryptoAlgorithmIdentifier identifier, Vector&& keyData, CryptoKeyUsageBitmap usages) { - return adoptRef(*new CryptoKeyRaw(identifier, WTFMove(keyData), usages)); + return adoptRef(*new CryptoKeyRaw(identifier, WTF::move(keyData), usages)); } const Vector& key() const { return m_key; } diff --git a/src/bun.js/bindings/webcrypto/JSCryptoKey.cpp b/src/bun.js/bindings/webcrypto/JSCryptoKey.cpp index 200081ab58..92acf8acf3 100644 --- a/src/bun.js/bindings/webcrypto/JSCryptoKey.cpp +++ b/src/bun.js/bindings/webcrypto/JSCryptoKey.cpp @@ -87,11 +87,11 @@ template<> JSString* convertEnumerationToJS(JSGlobalObject& lexicalGlobalObject, template<> std::optional parseEnumeration(JSGlobalObject& lexicalGlobalObject, JSValue value) { auto stringValue = value.toWTFString(&lexicalGlobalObject); - static constexpr std::pair mappings[] = { + static constexpr std::array, 3> mappings { { { "private"_s, CryptoKey::Type::Private }, { "public"_s, CryptoKey::Type::Public }, { "secret"_s, CryptoKey::Type::Secret }, - }; + } }; static constexpr SortedArrayMap enumerationMapping { mappings }; if (auto* enumerationValue = enumerationMapping.tryGet(stringValue); enumerationValue) [[likely]] return *enumerationValue; @@ -184,7 +184,7 @@ void JSCryptoKeyPrototype::finishCreation(VM& vm) const ClassInfo JSCryptoKey::s_info = { "CryptoKey"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSCryptoKey) }; JSCryptoKey::JSCryptoKey(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -338,7 +338,7 @@ void JSCryptoKeyOwner::finalize(JSC::Handle handle, void* context) JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObject, Ref&& impl) { - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, CryptoKey& impl) diff --git a/src/bun.js/bindings/webcrypto/JSCryptoKey.h b/src/bun.js/bindings/webcrypto/JSCryptoKey.h index 2dcf45538f..5a04c06827 100644 --- a/src/bun.js/bindings/webcrypto/JSCryptoKey.h +++ b/src/bun.js/bindings/webcrypto/JSCryptoKey.h @@ -34,7 +34,7 @@ public: using Base = JSDOMWrapper; static JSCryptoKey* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSCryptoKey* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSCryptoKey(structure, *globalObject, WTFMove(impl)); + JSCryptoKey* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSCryptoKey(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcrypto/JSCryptoKeyUsage.cpp b/src/bun.js/bindings/webcrypto/JSCryptoKeyUsage.cpp index 53fc4ff733..f27a254b18 100644 --- a/src/bun.js/bindings/webcrypto/JSCryptoKeyUsage.cpp +++ b/src/bun.js/bindings/webcrypto/JSCryptoKeyUsage.cpp @@ -64,7 +64,7 @@ template<> JSString* convertEnumerationToJS(JSGlobalObject& lexicalGlobalObject, template<> std::optional parseEnumeration(JSGlobalObject& lexicalGlobalObject, JSValue value) { auto stringValue = value.toWTFString(&lexicalGlobalObject); - static constexpr std::pair mappings[] = { + static constexpr std::array, 8> mappings { { { "decrypt"_s, CryptoKeyUsage::Decrypt }, { "deriveBits"_s, CryptoKeyUsage::DeriveBits }, { "deriveKey"_s, CryptoKeyUsage::DeriveKey }, @@ -73,7 +73,7 @@ template<> std::optional parseEnumeration(JSGlob { "unwrapKey"_s, CryptoKeyUsage::UnwrapKey }, { "verify"_s, CryptoKeyUsage::Verify }, { "wrapKey"_s, CryptoKeyUsage::WrapKey }, - }; + } }; static constexpr SortedArrayMap enumerationMapping { mappings }; if (auto* enumerationValue = enumerationMapping.tryGet(stringValue); enumerationValue) [[likely]] return *enumerationValue; diff --git a/src/bun.js/bindings/webcrypto/JSSubtleCrypto.cpp b/src/bun.js/bindings/webcrypto/JSSubtleCrypto.cpp index 549de84fcd..bceabcda93 100644 --- a/src/bun.js/bindings/webcrypto/JSSubtleCrypto.cpp +++ b/src/bun.js/bindings/webcrypto/JSSubtleCrypto.cpp @@ -96,12 +96,12 @@ template<> JSString* convertEnumerationToJS(JSGlobalObject& lexicalGlobalObject, template<> std::optional parseEnumeration(JSGlobalObject& lexicalGlobalObject, JSValue value) { auto stringValue = value.toWTFString(&lexicalGlobalObject); - static constexpr std::pair mappings[] = { + static constexpr std::array, 4> mappings { { { "jwk"_s, SubtleCrypto::KeyFormat::Jwk }, { "pkcs8"_s, SubtleCrypto::KeyFormat::Pkcs8 }, { "raw"_s, SubtleCrypto::KeyFormat::Raw }, { "spki"_s, SubtleCrypto::KeyFormat::Spki }, - }; + } }; static constexpr SortedArrayMap enumerationMapping { mappings }; if (auto* enumerationValue = enumerationMapping.tryGet(stringValue); enumerationValue) [[likely]] return *enumerationValue; @@ -213,7 +213,7 @@ void JSSubtleCryptoPrototype::finishCreation(VM& vm) const ClassInfo JSSubtleCrypto::s_info = { "SubtleCrypto"_s, &Base::s_info, nullptr, nullptr, CREATE_METHOD_TABLE(JSSubtleCrypto) }; JSSubtleCrypto::JSSubtleCrypto(Structure* structure, JSDOMGlobalObject& globalObject, Ref&& impl) - : JSDOMWrapper(structure, globalObject, WTFMove(impl)) + : JSDOMWrapper(structure, globalObject, WTF::move(impl)) { } @@ -276,7 +276,7 @@ static inline JSC::EncodedJSValue jsSubtleCryptoPrototypeFunction_encryptBody(JS EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto data = convert>(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.encrypt(*jsCast(lexicalGlobalObject), WTFMove(algorithm), *key, WTFMove(data), WTFMove(promise)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.encrypt(*jsCast(lexicalGlobalObject), WTF::move(algorithm), *key, WTF::move(data), WTF::move(promise)); }))); } JSC_DEFINE_HOST_FUNCTION(jsSubtleCryptoPrototypeFunction_encrypt, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -302,7 +302,7 @@ static inline JSC::EncodedJSValue jsSubtleCryptoPrototypeFunction_decryptBody(JS EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto data = convert>(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.decrypt(*jsCast(lexicalGlobalObject), WTFMove(algorithm), *key, WTFMove(data), WTFMove(promise)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.decrypt(*jsCast(lexicalGlobalObject), WTF::move(algorithm), *key, WTF::move(data), WTF::move(promise)); }))); } JSC_DEFINE_HOST_FUNCTION(jsSubtleCryptoPrototypeFunction_decrypt, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -328,7 +328,7 @@ static inline JSC::EncodedJSValue jsSubtleCryptoPrototypeFunction_signBody(JSC:: EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto data = convert>(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.sign(*jsCast(lexicalGlobalObject), WTFMove(algorithm), *key, WTFMove(data), WTFMove(promise)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.sign(*jsCast(lexicalGlobalObject), WTF::move(algorithm), *key, WTF::move(data), WTF::move(promise)); }))); } JSC_DEFINE_HOST_FUNCTION(jsSubtleCryptoPrototypeFunction_sign, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -357,7 +357,7 @@ static inline JSC::EncodedJSValue jsSubtleCryptoPrototypeFunction_verifyBody(JSC EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto data = convert>(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.verify(*jsCast(lexicalGlobalObject), WTFMove(algorithm), *key, WTFMove(signature), WTFMove(data), WTFMove(promise)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.verify(*jsCast(lexicalGlobalObject), WTF::move(algorithm), *key, WTF::move(signature), WTF::move(data), WTF::move(promise)); }))); } JSC_DEFINE_HOST_FUNCTION(jsSubtleCryptoPrototypeFunction_verify, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -383,7 +383,7 @@ static inline JSC::EncodedJSValue jsSubtleCryptoPrototypeFunction_digestBody(JSC throwScope.clearException(); return Bun::ERR::INVALID_ARG_TYPE(throwScope, lexicalGlobalObject, "data"_s, "ArrayBuffer, Buffer, TypedArray, or DataView"_s, argument1.value()); } - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.digest(*jsCast(lexicalGlobalObject), WTFMove(algorithm), WTFMove(data), WTFMove(promise)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.digest(*jsCast(lexicalGlobalObject), WTF::move(algorithm), WTF::move(data), WTF::move(promise)); }))); } JSC_DEFINE_HOST_FUNCTION(jsSubtleCryptoPrototypeFunction_digest, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -409,7 +409,7 @@ static inline JSC::EncodedJSValue jsSubtleCryptoPrototypeFunction_generateKeyBod EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto keyUsages = convert>>(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.generateKey(*jsCast(lexicalGlobalObject), WTFMove(algorithm), WTFMove(extractable), WTFMove(keyUsages), WTFMove(promise)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.generateKey(*jsCast(lexicalGlobalObject), WTF::move(algorithm), WTF::move(extractable), WTF::move(keyUsages), WTF::move(promise)); }))); } JSC_DEFINE_HOST_FUNCTION(jsSubtleCryptoPrototypeFunction_generateKey, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -441,7 +441,7 @@ static inline JSC::EncodedJSValue jsSubtleCryptoPrototypeFunction_deriveKeyBody( EnsureStillAliveScope argument4 = callFrame->uncheckedArgument(4); auto keyUsages = convert>>(*lexicalGlobalObject, argument4.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.deriveKey(*jsCast(lexicalGlobalObject), WTFMove(algorithm), *baseKey, WTFMove(derivedKeyType), WTFMove(extractable), WTFMove(keyUsages), WTFMove(promise)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.deriveKey(*jsCast(lexicalGlobalObject), WTF::move(algorithm), *baseKey, WTF::move(derivedKeyType), WTF::move(extractable), WTF::move(keyUsages), WTF::move(promise)); }))); } JSC_DEFINE_HOST_FUNCTION(jsSubtleCryptoPrototypeFunction_deriveKey, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -467,7 +467,7 @@ static inline JSC::EncodedJSValue jsSubtleCryptoPrototypeFunction_deriveBitsBody EnsureStillAliveScope argument2 = callFrame->uncheckedArgument(2); auto length = convert(*lexicalGlobalObject, argument2.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.deriveBits(*jsCast(lexicalGlobalObject), WTFMove(algorithm), *baseKey, WTFMove(length), WTFMove(promise)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.deriveBits(*jsCast(lexicalGlobalObject), WTF::move(algorithm), *baseKey, WTF::move(length), WTF::move(promise)); }))); } JSC_DEFINE_HOST_FUNCTION(jsSubtleCryptoPrototypeFunction_deriveBits, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -499,7 +499,7 @@ static inline JSC::EncodedJSValue jsSubtleCryptoPrototypeFunction_importKeyBody( EnsureStillAliveScope argument4 = callFrame->uncheckedArgument(4); auto keyUsages = convert>>(*lexicalGlobalObject, argument4.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.importKey(*jsCast(lexicalGlobalObject), WTFMove(format), WTFMove(keyData), WTFMove(algorithm), WTFMove(extractable), WTFMove(keyUsages), WTFMove(promise)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.importKey(*jsCast(lexicalGlobalObject), WTF::move(format), WTF::move(keyData), WTF::move(algorithm), WTF::move(extractable), WTF::move(keyUsages), WTF::move(promise)); }))); } JSC_DEFINE_HOST_FUNCTION(jsSubtleCryptoPrototypeFunction_importKey, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -523,7 +523,7 @@ static inline JSC::EncodedJSValue jsSubtleCryptoPrototypeFunction_exportKeyBody( auto key = convert>(*lexicalGlobalObject, argument1.value(), [](JSC::JSGlobalObject& lexicalGlobalObject, JSC::ThrowScope& scope) { throwArgumentTypeError(lexicalGlobalObject, scope, 1, "key"_s, "SubtleCrypto"_s, "exportKey"_s, "CryptoKey"_s); }); RETURN_IF_EXCEPTION(throwScope, {}); RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { - return impl.exportKey(WTFMove(format), *key, WTFMove(promise)); + return impl.exportKey(WTF::move(format), *key, WTF::move(promise)); }))); } @@ -553,7 +553,7 @@ static inline JSC::EncodedJSValue jsSubtleCryptoPrototypeFunction_wrapKeyBody(JS EnsureStillAliveScope argument3 = callFrame->uncheckedArgument(3); auto wrapAlgorithm = convert>(*lexicalGlobalObject, argument3.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.wrapKey(*jsCast(lexicalGlobalObject), WTFMove(format), *key, *wrappingKey, WTFMove(wrapAlgorithm), WTFMove(promise)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.wrapKey(*jsCast(lexicalGlobalObject), WTF::move(format), *key, *wrappingKey, WTF::move(wrapAlgorithm), WTF::move(promise)); }))); } JSC_DEFINE_HOST_FUNCTION(jsSubtleCryptoPrototypeFunction_wrapKey, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -591,7 +591,7 @@ static inline JSC::EncodedJSValue jsSubtleCryptoPrototypeFunction_unwrapKeyBody( EnsureStillAliveScope argument6 = callFrame->uncheckedArgument(6); auto keyUsages = convert>>(*lexicalGlobalObject, argument6.value()); RETURN_IF_EXCEPTION(throwScope, {}); - RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.unwrapKey(*jsCast(lexicalGlobalObject), WTFMove(format), WTFMove(wrappedKey), *unwrappingKey, WTFMove(unwrapAlgorithm), WTFMove(unwrappedKeyAlgorithm), WTFMove(extractable), WTFMove(keyUsages), WTFMove(promise)); }))); + RELEASE_AND_RETURN(throwScope, JSValue::encode(toJS>>(*lexicalGlobalObject, *castedThis->globalObject(), throwScope, [&]() -> decltype(auto) { return impl.unwrapKey(*jsCast(lexicalGlobalObject), WTF::move(format), WTF::move(wrappedKey), *unwrappingKey, WTF::move(unwrapAlgorithm), WTF::move(unwrappedKeyAlgorithm), WTF::move(extractable), WTF::move(keyUsages), WTF::move(promise)); }))); } JSC_DEFINE_HOST_FUNCTION(jsSubtleCryptoPrototypeFunction_unwrapKey, (JSGlobalObject * lexicalGlobalObject, CallFrame* callFrame)) @@ -668,7 +668,7 @@ JSC::JSValue toJSNewlyCreated(JSC::JSGlobalObject*, JSDOMGlobalObject* globalObj // RELEASE_ASSERT(actualVTablePointer == expectedVTablePointer); #endif } - return createWrapper(globalObject, WTFMove(impl)); + return createWrapper(globalObject, WTF::move(impl)); } JSC::JSValue toJS(JSC::JSGlobalObject* lexicalGlobalObject, JSDOMGlobalObject* globalObject, SubtleCrypto& impl) diff --git a/src/bun.js/bindings/webcrypto/JSSubtleCrypto.h b/src/bun.js/bindings/webcrypto/JSSubtleCrypto.h index b3a26c8727..f03e52944e 100644 --- a/src/bun.js/bindings/webcrypto/JSSubtleCrypto.h +++ b/src/bun.js/bindings/webcrypto/JSSubtleCrypto.h @@ -34,7 +34,7 @@ public: using Base = JSDOMWrapper; static JSSubtleCrypto* create(JSC::Structure* structure, JSDOMGlobalObject* globalObject, Ref&& impl) { - JSSubtleCrypto* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSSubtleCrypto(structure, *globalObject, WTFMove(impl)); + JSSubtleCrypto* ptr = new (NotNull, JSC::allocateCell(globalObject->vm())) JSSubtleCrypto(structure, *globalObject, WTF::move(impl)); ptr->finishCreation(globalObject->vm()); return ptr; } diff --git a/src/bun.js/bindings/webcrypto/PhonyWorkQueue.cpp b/src/bun.js/bindings/webcrypto/PhonyWorkQueue.cpp index 325ce6ad02..f465658ecd 100644 --- a/src/bun.js/bindings/webcrypto/PhonyWorkQueue.cpp +++ b/src/bun.js/bindings/webcrypto/PhonyWorkQueue.cpp @@ -15,7 +15,7 @@ extern "C" void ConcurrentCppTask__createAndRun(EventLoopTaskNoContext* task); void PhonyWorkQueue::dispatch(JSC::JSGlobalObject* globalObject, WTF::Function&& function) { - ConcurrentCppTask__createAndRun(new EventLoopTaskNoContext(globalObject, WTFMove(function))); + ConcurrentCppTask__createAndRun(new EventLoopTaskNoContext(globalObject, WTF::move(function))); } } // namespace Bun diff --git a/src/bun.js/bindings/webcrypto/SubtleCrypto.cpp b/src/bun.js/bindings/webcrypto/SubtleCrypto.cpp index 4a233ea064..4ef2591c31 100644 --- a/src/bun.js/bindings/webcrypto/SubtleCrypto.cpp +++ b/src/bun.js/bindings/webcrypto/SubtleCrypto.cpp @@ -611,14 +611,14 @@ void SubtleCrypto::encrypt(JSC::JSGlobalObject& state, AlgorithmIdentifier&& alg { addAuthenticatedEncryptionWarningIfNecessary(key.algorithmIdentifier()); - auto paramsOrException = normalizeCryptoAlgorithmParameters(state, WTFMove(algorithmIdentifier), Operations::Encrypt); + auto paramsOrException = normalizeCryptoAlgorithmParameters(state, WTF::move(algorithmIdentifier), Operations::Encrypt); if (paramsOrException.hasException()) { promise->reject(paramsOrException.releaseException()); return; } auto params = paramsOrException.releaseReturnValue(); - auto data = copyToVector(WTFMove(dataBufferSource)); + auto data = copyToVector(WTF::move(dataBufferSource)); if (params->identifier != key.algorithmIdentifier()) { promise->reject(InvalidAccessError, "CryptoKey doesn't match AlgorithmIdentifier"_s); @@ -633,7 +633,7 @@ void SubtleCrypto::encrypt(JSC::JSGlobalObject& state, AlgorithmIdentifier&& alg auto algorithm = CryptoAlgorithmRegistry::singleton().create(key.algorithmIdentifier()); auto index = promise.ptr(); - m_pendingPromises.add(index, WTFMove(promise)); + m_pendingPromises.add(index, WTF::move(promise)); WeakPtr weakThis { *this }; auto callback = [index, weakThis](const Vector& cipherText) mutable { if (auto promise = getPromise(index, weakThis)) @@ -644,7 +644,7 @@ void SubtleCrypto::encrypt(JSC::JSGlobalObject& state, AlgorithmIdentifier&& alg rejectWithException(promise.releaseNonNull(), ec, msg); }; - algorithm->encrypt(*params, key, WTFMove(data), WTFMove(callback), WTFMove(exceptionCallback), *scriptExecutionContext(), m_workQueue); + algorithm->encrypt(*params, key, WTF::move(data), WTF::move(callback), WTF::move(exceptionCallback), *scriptExecutionContext(), m_workQueue); } void SubtleCrypto::decrypt(JSC::JSGlobalObject& state, AlgorithmIdentifier&& algorithmIdentifier, CryptoKey& key, BufferSource&& dataBufferSource, Ref&& promise) @@ -654,14 +654,14 @@ void SubtleCrypto::decrypt(JSC::JSGlobalObject& state, AlgorithmIdentifier&& alg addAuthenticatedEncryptionWarningIfNecessary(key.algorithmIdentifier()); - auto paramsOrException = normalizeCryptoAlgorithmParameters(state, WTFMove(algorithmIdentifier), Operations::Decrypt); + auto paramsOrException = normalizeCryptoAlgorithmParameters(state, WTF::move(algorithmIdentifier), Operations::Decrypt); if (paramsOrException.hasException()) { promise->reject(paramsOrException.releaseException()); return; } auto params = paramsOrException.releaseReturnValue(); - auto data = copyToVector(WTFMove(dataBufferSource)); + auto data = copyToVector(WTF::move(dataBufferSource)); if (params->identifier != key.algorithmIdentifier()) { promise->reject(InvalidAccessError, "CryptoKey doesn't match AlgorithmIdentifier"_s); @@ -676,7 +676,7 @@ void SubtleCrypto::decrypt(JSC::JSGlobalObject& state, AlgorithmIdentifier&& alg auto algorithm = CryptoAlgorithmRegistry::singleton().create(key.algorithmIdentifier()); auto index = promise.ptr(); - m_pendingPromises.add(index, WTFMove(promise)); + m_pendingPromises.add(index, WTF::move(promise)); WeakPtr weakThis { *this }; auto callback = [index, weakThis](const Vector& plainText) mutable { if (auto promise = getPromise(index, weakThis)) @@ -687,19 +687,19 @@ void SubtleCrypto::decrypt(JSC::JSGlobalObject& state, AlgorithmIdentifier&& alg rejectWithException(promise.releaseNonNull(), ec, msg); }; - algorithm->decrypt(*params, key, WTFMove(data), WTFMove(callback), WTFMove(exceptionCallback), *scriptExecutionContext(), m_workQueue); + algorithm->decrypt(*params, key, WTF::move(data), WTF::move(callback), WTF::move(exceptionCallback), *scriptExecutionContext(), m_workQueue); } void SubtleCrypto::sign(JSC::JSGlobalObject& state, AlgorithmIdentifier&& algorithmIdentifier, CryptoKey& key, BufferSource&& dataBufferSource, Ref&& promise) { - auto paramsOrException = normalizeCryptoAlgorithmParameters(state, WTFMove(algorithmIdentifier), Operations::Sign); + auto paramsOrException = normalizeCryptoAlgorithmParameters(state, WTF::move(algorithmIdentifier), Operations::Sign); if (paramsOrException.hasException()) { promise->reject(paramsOrException.releaseException()); return; } auto params = paramsOrException.releaseReturnValue(); - auto data = copyToVector(WTFMove(dataBufferSource)); + auto data = copyToVector(WTF::move(dataBufferSource)); if (params->identifier != key.algorithmIdentifier()) { promise->reject(InvalidAccessError, "CryptoKey doesn't match AlgorithmIdentifier"_s); @@ -714,7 +714,7 @@ void SubtleCrypto::sign(JSC::JSGlobalObject& state, AlgorithmIdentifier&& algori auto algorithm = CryptoAlgorithmRegistry::singleton().create(key.algorithmIdentifier()); auto index = promise.ptr(); - m_pendingPromises.add(index, WTFMove(promise)); + m_pendingPromises.add(index, WTF::move(promise)); WeakPtr weakThis { *this }; auto callback = [index, weakThis](const Vector& signature) mutable { if (auto promise = getPromise(index, weakThis)) @@ -725,20 +725,20 @@ void SubtleCrypto::sign(JSC::JSGlobalObject& state, AlgorithmIdentifier&& algori rejectWithException(promise.releaseNonNull(), ec, msg); }; - algorithm->sign(*params, key, WTFMove(data), WTFMove(callback), WTFMove(exceptionCallback), *scriptExecutionContext(), m_workQueue); + algorithm->sign(*params, key, WTF::move(data), WTF::move(callback), WTF::move(exceptionCallback), *scriptExecutionContext(), m_workQueue); } void SubtleCrypto::verify(JSC::JSGlobalObject& state, AlgorithmIdentifier&& algorithmIdentifier, CryptoKey& key, BufferSource&& signatureBufferSource, BufferSource&& dataBufferSource, Ref&& promise) { - auto paramsOrException = normalizeCryptoAlgorithmParameters(state, WTFMove(algorithmIdentifier), Operations::Verify); + auto paramsOrException = normalizeCryptoAlgorithmParameters(state, WTF::move(algorithmIdentifier), Operations::Verify); if (paramsOrException.hasException()) { promise->reject(paramsOrException.releaseException()); return; } auto params = paramsOrException.releaseReturnValue(); - auto signature = copyToVector(WTFMove(signatureBufferSource)); - auto data = copyToVector(WTFMove(dataBufferSource)); + auto signature = copyToVector(WTF::move(signatureBufferSource)); + auto data = copyToVector(WTF::move(dataBufferSource)); if (params->identifier != key.algorithmIdentifier()) { promise->reject(InvalidAccessError, "CryptoKey doesn't match AlgorithmIdentifier"_s); @@ -753,7 +753,7 @@ void SubtleCrypto::verify(JSC::JSGlobalObject& state, AlgorithmIdentifier&& algo auto algorithm = CryptoAlgorithmRegistry::singleton().create(key.algorithmIdentifier()); auto index = promise.ptr(); - m_pendingPromises.add(index, WTFMove(promise)); + m_pendingPromises.add(index, WTF::move(promise)); WeakPtr weakThis { *this }; auto callback = [index, weakThis](bool result) mutable { if (auto promise = getPromise(index, weakThis)) @@ -764,26 +764,26 @@ void SubtleCrypto::verify(JSC::JSGlobalObject& state, AlgorithmIdentifier&& algo rejectWithException(promise.releaseNonNull(), ec, msg); }; - algorithm->verify(*params, key, WTFMove(signature), WTFMove(data), WTFMove(callback), WTFMove(exceptionCallback), *scriptExecutionContext(), m_workQueue); + algorithm->verify(*params, key, WTF::move(signature), WTF::move(data), WTF::move(callback), WTF::move(exceptionCallback), *scriptExecutionContext(), m_workQueue); } void SubtleCrypto::digest(JSC::JSGlobalObject& state, AlgorithmIdentifier&& algorithmIdentifier, BufferSource&& dataBufferSource, Ref&& promise) { auto& vm = state.vm(); auto scope = DECLARE_THROW_SCOPE(vm); - auto paramsOrException = normalizeCryptoAlgorithmParameters(state, WTFMove(algorithmIdentifier), Operations::Digest); + auto paramsOrException = normalizeCryptoAlgorithmParameters(state, WTF::move(algorithmIdentifier), Operations::Digest); if (paramsOrException.hasException()) { promise->reject(paramsOrException.releaseException().code(), "Unrecognized algorithm name"_s); return; } auto params = paramsOrException.releaseReturnValue(); - auto data = copyToVector(WTFMove(dataBufferSource)); + auto data = copyToVector(WTF::move(dataBufferSource)); auto algorithm = CryptoAlgorithmRegistry::singleton().create(params->identifier); auto index = promise.ptr(); - m_pendingPromises.add(index, WTFMove(promise)); + m_pendingPromises.add(index, WTF::move(promise)); WeakPtr weakThis { *this }; auto callback = [index, weakThis](const Vector& digest) mutable { if (auto promise = getPromise(index, weakThis)) @@ -794,14 +794,14 @@ void SubtleCrypto::digest(JSC::JSGlobalObject& state, AlgorithmIdentifier&& algo rejectWithException(promise.releaseNonNull(), ec, msg); }; - algorithm->digest(WTFMove(data), WTFMove(callback), WTFMove(exceptionCallback), *scriptExecutionContext(), m_workQueue); + algorithm->digest(WTF::move(data), WTF::move(callback), WTF::move(exceptionCallback), *scriptExecutionContext(), m_workQueue); } void SubtleCrypto::generateKey(JSC::JSGlobalObject& state, AlgorithmIdentifier&& algorithmIdentifier, bool extractable, Vector&& keyUsages, Ref&& promise) { auto& vm = state.vm(); auto scope = DECLARE_THROW_SCOPE(vm); - auto paramsOrException = normalizeCryptoAlgorithmParameters(state, WTFMove(algorithmIdentifier), Operations::GenerateKey); + auto paramsOrException = normalizeCryptoAlgorithmParameters(state, WTF::move(algorithmIdentifier), Operations::GenerateKey); if (paramsOrException.hasException()) { promise->reject(paramsOrException.releaseException()); return; @@ -813,7 +813,7 @@ void SubtleCrypto::generateKey(JSC::JSGlobalObject& state, AlgorithmIdentifier&& auto algorithm = CryptoAlgorithmRegistry::singleton().create(params->identifier); auto index = promise.ptr(); - m_pendingPromises.add(index, WTFMove(promise)); + m_pendingPromises.add(index, WTF::move(promise)); WeakPtr weakThis { *this }; auto callback = [index, weakThis](KeyOrKeyPair&& keyOrKeyPair) mutable { if (auto promise = getPromise(index, weakThis)) { @@ -844,12 +844,12 @@ void SubtleCrypto::generateKey(JSC::JSGlobalObject& state, AlgorithmIdentifier&& // The 26 January 2017 version of the specification suggests we should perform the following task asynchronously // regardless what kind of keys it produces: https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-generateKey // That's simply not efficient for AES, HMAC and EC keys. Therefore, we perform it as an async task only for RSA keys. - RELEASE_AND_RETURN(scope, algorithm->generateKey(*params, extractable, keyUsagesBitmap, WTFMove(callback), WTFMove(exceptionCallback), *scriptExecutionContext())); + RELEASE_AND_RETURN(scope, algorithm->generateKey(*params, extractable, keyUsagesBitmap, WTF::move(callback), WTF::move(exceptionCallback), *scriptExecutionContext())); } void SubtleCrypto::deriveKey(JSC::JSGlobalObject& state, AlgorithmIdentifier&& algorithmIdentifier, CryptoKey& baseKey, AlgorithmIdentifier&& derivedKeyType, bool extractable, Vector&& keyUsages, Ref&& promise) { - auto paramsOrException = normalizeCryptoAlgorithmParameters(state, WTFMove(algorithmIdentifier), Operations::DeriveBits); + auto paramsOrException = normalizeCryptoAlgorithmParameters(state, WTF::move(algorithmIdentifier), Operations::DeriveBits); if (paramsOrException.hasException()) { promise->reject(paramsOrException.releaseException()); return; @@ -895,9 +895,9 @@ void SubtleCrypto::deriveKey(JSC::JSGlobalObject& state, AlgorithmIdentifier&& a auto algorithm = CryptoAlgorithmRegistry::singleton().create(params->identifier); auto index = promise.ptr(); - m_pendingPromises.add(index, WTFMove(promise)); + m_pendingPromises.add(index, WTF::move(promise)); WeakPtr weakThis { *this }; - auto callback = [index, weakThis, importAlgorithm = WTFMove(importAlgorithm), importParams = crossThreadCopyImportParams(*importParams), extractable, keyUsagesBitmap](const Vector& derivedKey) mutable { + auto callback = [index, weakThis, importAlgorithm = WTF::move(importAlgorithm), importParams = crossThreadCopyImportParams(*importParams), extractable, keyUsagesBitmap](const Vector& derivedKey) mutable { // FIXME: https://bugs.webkit.org/show_bug.cgi?id=169395 KeyData data = derivedKey; auto callback = [index, weakThis](CryptoKey& key) mutable { @@ -914,19 +914,19 @@ void SubtleCrypto::deriveKey(JSC::JSGlobalObject& state, AlgorithmIdentifier&& a rejectWithException(promise.releaseNonNull(), ec, msg); }; - importAlgorithm->importKey(SubtleCrypto::KeyFormat::Raw, WTFMove(data), *importParams, extractable, keyUsagesBitmap, WTFMove(callback), WTFMove(exceptionCallback)); + importAlgorithm->importKey(SubtleCrypto::KeyFormat::Raw, WTF::move(data), *importParams, extractable, keyUsagesBitmap, WTF::move(callback), WTF::move(exceptionCallback)); }; auto exceptionCallback = [index, weakThis](ExceptionCode ec, const String& msg) mutable { if (auto promise = getPromise(index, weakThis)) rejectWithException(promise.releaseNonNull(), ec, msg); }; - algorithm->deriveBits(*params, baseKey, length, WTFMove(callback), WTFMove(exceptionCallback), *scriptExecutionContext(), m_workQueue); + algorithm->deriveBits(*params, baseKey, length, WTF::move(callback), WTF::move(exceptionCallback), *scriptExecutionContext(), m_workQueue); } void SubtleCrypto::deriveBits(JSC::JSGlobalObject& state, AlgorithmIdentifier&& algorithmIdentifier, CryptoKey& baseKey, unsigned length, Ref&& promise) { - auto paramsOrException = normalizeCryptoAlgorithmParameters(state, WTFMove(algorithmIdentifier), Operations::DeriveBits); + auto paramsOrException = normalizeCryptoAlgorithmParameters(state, WTF::move(algorithmIdentifier), Operations::DeriveBits); if (paramsOrException.hasException()) { promise->reject(paramsOrException.releaseException()); return; @@ -946,7 +946,7 @@ void SubtleCrypto::deriveBits(JSC::JSGlobalObject& state, AlgorithmIdentifier&& auto algorithm = CryptoAlgorithmRegistry::singleton().create(params->identifier); auto index = promise.ptr(); - m_pendingPromises.add(index, WTFMove(promise)); + m_pendingPromises.add(index, WTF::move(promise)); WeakPtr weakThis { *this }; auto callback = [index, weakThis](const Vector& derivedKey) mutable { if (auto promise = getPromise(index, weakThis)) @@ -957,21 +957,21 @@ void SubtleCrypto::deriveBits(JSC::JSGlobalObject& state, AlgorithmIdentifier&& rejectWithException(promise.releaseNonNull(), ec, msg); }; - algorithm->deriveBits(*params, baseKey, length, WTFMove(callback), WTFMove(exceptionCallback), *scriptExecutionContext(), m_workQueue); + algorithm->deriveBits(*params, baseKey, length, WTF::move(callback), WTF::move(exceptionCallback), *scriptExecutionContext(), m_workQueue); } void SubtleCrypto::importKey(JSC::JSGlobalObject& state, KeyFormat format, KeyDataVariant&& keyDataVariant, AlgorithmIdentifier&& algorithmIdentifier, bool extractable, Vector&& keyUsages, Ref&& promise) { auto& vm = state.vm(); auto scope = DECLARE_THROW_SCOPE(vm); - auto paramsOrException = normalizeCryptoAlgorithmParameters(state, WTFMove(algorithmIdentifier), Operations::ImportKey); + auto paramsOrException = normalizeCryptoAlgorithmParameters(state, WTF::move(algorithmIdentifier), Operations::ImportKey); if (paramsOrException.hasException()) { promise->reject(paramsOrException.releaseException()); return; } auto params = paramsOrException.releaseReturnValue(); - auto keyDataOrNull = toKeyData(format, WTFMove(keyDataVariant), promise); + auto keyDataOrNull = toKeyData(format, WTF::move(keyDataVariant), promise); if (!keyDataOrNull) { // When toKeyData, it means the promise has been rejected, and we should return. return; @@ -983,7 +983,7 @@ void SubtleCrypto::importKey(JSC::JSGlobalObject& state, KeyFormat format, KeyDa auto algorithm = CryptoAlgorithmRegistry::singleton().create(params->identifier); auto index = promise.ptr(); - m_pendingPromises.add(index, WTFMove(promise)); + m_pendingPromises.add(index, WTF::move(promise)); WeakPtr weakThis { *this }; auto callback = [index, weakThis](CryptoKey& key) mutable { if (auto promise = getPromise(index, weakThis)) { @@ -1002,7 +1002,7 @@ void SubtleCrypto::importKey(JSC::JSGlobalObject& state, KeyFormat format, KeyDa // The 11 December 2014 version of the specification suggests we should perform the following task asynchronously: // https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-importKey // It is not beneficial for less time consuming operations. Therefore, we perform it synchronously. - RELEASE_AND_RETURN(scope, algorithm->importKey(format, WTFMove(keyData), *params, extractable, keyUsagesBitmap, WTFMove(callback), WTFMove(exceptionCallback))); + RELEASE_AND_RETURN(scope, algorithm->importKey(format, WTF::move(keyData), *params, extractable, keyUsagesBitmap, WTF::move(callback), WTF::move(exceptionCallback))); } void SubtleCrypto::exportKey(KeyFormat format, CryptoKey& key, Ref&& promise) @@ -1020,7 +1020,7 @@ void SubtleCrypto::exportKey(KeyFormat format, CryptoKey& key, Refresolve>(WTFMove(std::get(key))); + promise->resolve>(WTF::move(std::get(key))); return; } ASSERT_NOT_REACHED(); @@ -1047,7 +1047,7 @@ void SubtleCrypto::exportKey(KeyFormat format, CryptoKey& key, RefexportKey(format, key, WTFMove(callback), WTFMove(exceptionCallback)); + algorithm->exportKey(format, key, WTF::move(callback), WTF::move(exceptionCallback)); } void SubtleCrypto::wrapKey(JSC::JSGlobalObject& state, KeyFormat format, CryptoKey& key, CryptoKey& wrappingKey, AlgorithmIdentifier&& wrapAlgorithmIdentifier, Ref&& promise) @@ -1094,9 +1094,9 @@ void SubtleCrypto::wrapKey(JSC::JSGlobalObject& state, KeyFormat format, CryptoK auto context = scriptExecutionContext(); auto index = promise.ptr(); - m_pendingPromises.add(index, WTFMove(promise)); + m_pendingPromises.add(index, WTF::move(promise)); WeakPtr weakThis { *this }; - auto callback = [index, weakThis, wrapAlgorithm, wrappingKey = Ref { wrappingKey }, wrapParams = WTFMove(wrapParams), isEncryption, context, workQueue = m_workQueue](SubtleCrypto::KeyFormat format, KeyData&& key) mutable { + auto callback = [index, weakThis, wrapAlgorithm, wrappingKey = Ref { wrappingKey }, wrapParams = WTF::move(wrapParams), isEncryption, context, workQueue = m_workQueue](SubtleCrypto::KeyFormat format, KeyData&& key) mutable { if (weakThis) { if (auto promise = weakThis->m_pendingPromises.get(index)) { Vector bytes; @@ -1108,7 +1108,7 @@ void SubtleCrypto::wrapKey(JSC::JSGlobalObject& state, KeyFormat format, CryptoK break; case SubtleCrypto::KeyFormat::Jwk: { // FIXME: Converting to JS just to JSON-Stringify seems inefficient. We should find a way to go directly from the struct to JSON. - auto jwk = toJS>(*(promise->globalObject()), *(promise->globalObject()), WTFMove(std::get(key))); + auto jwk = toJS>(*(promise->globalObject()), *(promise->globalObject()), WTF::move(std::get(key))); String jwkString = JSONStringify(promise->globalObject(), jwk, 0); CString jwkUTF8String = jwkString.utf8(StrictConversion); bytes.append(jwkUTF8String.span()); @@ -1128,11 +1128,11 @@ void SubtleCrypto::wrapKey(JSC::JSGlobalObject& state, KeyFormat format, CryptoK // The 11 December 2014 version of the specification suggests we should perform the following task asynchronously: // https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-wrapKey // It is not beneficial for less time consuming operations. Therefore, we perform it synchronously. - wrapAlgorithm->wrapKey(wrappingKey.get(), WTFMove(bytes), WTFMove(callback), WTFMove(exceptionCallback)); + wrapAlgorithm->wrapKey(wrappingKey.get(), WTF::move(bytes), WTF::move(callback), WTF::move(exceptionCallback)); return; } // The following operation should be performed asynchronously. - wrapAlgorithm->encrypt(*wrapParams, WTFMove(wrappingKey), WTFMove(bytes), WTFMove(callback), WTFMove(exceptionCallback), *context, workQueue); + wrapAlgorithm->encrypt(*wrapParams, WTF::move(wrappingKey), WTF::move(bytes), WTF::move(callback), WTF::move(exceptionCallback), *context, workQueue); } } }; @@ -1142,12 +1142,12 @@ void SubtleCrypto::wrapKey(JSC::JSGlobalObject& state, KeyFormat format, CryptoK }; // The following operation should be performed synchronously. - exportAlgorithm->exportKey(format, key, WTFMove(callback), WTFMove(exceptionCallback)); + exportAlgorithm->exportKey(format, key, WTF::move(callback), WTF::move(exceptionCallback)); } void SubtleCrypto::unwrapKey(JSC::JSGlobalObject& state, KeyFormat format, BufferSource&& wrappedKeyBufferSource, CryptoKey& unwrappingKey, AlgorithmIdentifier&& unwrapAlgorithmIdentifier, AlgorithmIdentifier&& unwrappedKeyAlgorithmIdentifier, bool extractable, Vector&& keyUsages, Ref&& promise) { - auto wrappedKey = copyToVector(WTFMove(wrappedKeyBufferSource)); + auto wrappedKey = copyToVector(WTF::move(wrappedKeyBufferSource)); bool isDecryption = false; @@ -1195,7 +1195,7 @@ void SubtleCrypto::unwrapKey(JSC::JSGlobalObject& state, KeyFormat format, Buffe } auto index = promise.ptr(); - m_pendingPromises.add(index, WTFMove(promise)); + m_pendingPromises.add(index, WTF::move(promise)); WeakPtr weakThis { *this }; auto callback = [index, weakThis, format, importAlgorithm, unwrappedKeyAlgorithm = crossThreadCopyImportParams(*unwrappedKeyAlgorithm), extractable, keyUsagesBitmap](const Vector& bytes) mutable { if (weakThis) { @@ -1243,7 +1243,7 @@ void SubtleCrypto::unwrapKey(JSC::JSGlobalObject& state, KeyFormat format, Buffe }; // The following operation should be performed synchronously. - importAlgorithm->importKey(format, WTFMove(keyData), *unwrappedKeyAlgorithm, extractable, keyUsagesBitmap, WTFMove(callback), WTFMove(exceptionCallback)); + importAlgorithm->importKey(format, WTF::move(keyData), *unwrappedKeyAlgorithm, extractable, keyUsagesBitmap, WTF::move(callback), WTF::move(exceptionCallback)); } } }; @@ -1256,11 +1256,11 @@ void SubtleCrypto::unwrapKey(JSC::JSGlobalObject& state, KeyFormat format, Buffe // The 11 December 2014 version of the specification suggests we should perform the following task asynchronously: // https://www.w3.org/TR/WebCryptoAPI/#SubtleCrypto-method-unwrapKey // It is not beneficial for less time consuming operations. Therefore, we perform it synchronously. - unwrapAlgorithm->unwrapKey(unwrappingKey, WTFMove(wrappedKey), WTFMove(callback), WTFMove(exceptionCallback)); + unwrapAlgorithm->unwrapKey(unwrappingKey, WTF::move(wrappedKey), WTF::move(callback), WTF::move(exceptionCallback)); return; } - unwrapAlgorithm->decrypt(*unwrapParams, unwrappingKey, WTFMove(wrappedKey), WTFMove(callback), WTFMove(exceptionCallback), *scriptExecutionContext(), m_workQueue); + unwrapAlgorithm->decrypt(*unwrapParams, unwrappingKey, WTF::move(wrappedKey), WTF::move(callback), WTF::move(exceptionCallback), *scriptExecutionContext(), m_workQueue); } } diff --git a/src/bun.js/modules/BunJSCModule.h b/src/bun.js/modules/BunJSCModule.h index 5fa2aca13d..a9d4e8b194 100644 --- a/src/bun.js/modules/BunJSCModule.h +++ b/src/bun.js/modules/BunJSCModule.h @@ -751,7 +751,7 @@ JSC_DEFINE_HOST_FUNCTION(functionGenerateHeapSnapshotForDebugging, } scope.releaseAssertNoException(); - return JSValue::encode(JSONParse(globalObject, WTFMove(jsonString))); + return JSValue::encode(JSONParse(globalObject, WTF::move(jsonString))); } JSC_DEFINE_HOST_FUNCTION(functionSerialize, @@ -782,7 +782,7 @@ JSC_DEFINE_HOST_FUNCTION(functionSerialize, Vector> transferList; Vector> dummyPorts; - ExceptionOr> serialized = SerializedScriptValue::create(*globalObject, value, WTFMove(transferList), dummyPorts, SerializationForStorage::Yes); + ExceptionOr> serialized = SerializedScriptValue::create(*globalObject, value, WTF::move(transferList), dummyPorts, SerializationForStorage::Yes); EXCEPTION_ASSERT(serialized.hasException() == !!throwScope.exception()); if (serialized.hasException()) { WebCore::propagateException(*globalObject, throwScope, serialized.releaseException()); @@ -795,16 +795,16 @@ JSC_DEFINE_HOST_FUNCTION(functionSerialize, if (asNodeBuffer) { size_t byteLength = arrayBuffer->byteLength(); auto* subclassStructure = globalObject->JSBufferSubclassStructure(); - JSC::JSUint8Array* uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, WTFMove(arrayBuffer), 0, byteLength); + JSC::JSUint8Array* uint8Array = JSC::JSUint8Array::create(lexicalGlobalObject, subclassStructure, WTF::move(arrayBuffer), 0, byteLength); RETURN_IF_EXCEPTION(throwScope, {}); return JSValue::encode(uint8Array); } if (arrayBuffer->isShared()) { - return JSValue::encode(JSArrayBuffer::create(vm, globalObject->arrayBufferStructureWithSharingMode(), WTFMove(arrayBuffer))); + return JSValue::encode(JSArrayBuffer::create(vm, globalObject->arrayBufferStructureWithSharingMode(), WTF::move(arrayBuffer))); } - return JSValue::encode(JSArrayBuffer::create(vm, globalObject->arrayBufferStructure(), WTFMove(arrayBuffer))); + return JSValue::encode(JSArrayBuffer::create(vm, globalObject->arrayBufferStructure(), WTF::move(arrayBuffer))); } JSC_DEFINE_HOST_FUNCTION(functionDeserialize, (JSGlobalObject * globalObject, CallFrame* callFrame)) { diff --git a/src/codegen/bindgen.ts b/src/codegen/bindgen.ts index 0ab0708612..386823736f 100644 --- a/src/codegen/bindgen.ts +++ b/src/codegen/bindgen.ts @@ -754,11 +754,13 @@ function emitConvertEnumFunction(w: CodeWriter, type: TypeImpl) { w.line(); w.line(`template<> std::optional<${name}> parseEnumerationFromString<${name}>(const String& stringValue)`); w.line(`{`); - w.line(` static constexpr std::pair mappings[] = {`); + w.line( + ` static constexpr std::array, ${type.data.length}> mappings { {`, + ); for (const value of type.data) { w.line(` { ${str(value)}_s, ${name}::${pascal(value)} },`); } - w.line(` };`); + w.line(` } };`); w.line(` static constexpr SortedArrayMap enumerationMapping { mappings };`); w.line(` if (auto* enumerationValue = enumerationMapping.tryGet(stringValue); enumerationValue) [[likely]]`); w.line(` return *enumerationValue;`); diff --git a/src/codegen/generate-classes.ts b/src/codegen/generate-classes.ts index ef054fe5b3..929585c976 100644 --- a/src/codegen/generate-classes.ts +++ b/src/codegen/generate-classes.ts @@ -1501,7 +1501,7 @@ function generateClassHeader(typeName, obj: ClassDefinition) { void* m_ctx { nullptr }; ${name}(JSC::VM& vm, JSC::Structure* structure, void* sinkPtr${obj.valuesArray ? ", WTF::FixedVector>&& jsvalueArray_" : ""}) - : Base(vm, structure)${obj.valuesArray ? ", jsvalueArray(WTFMove(jsvalueArray_))" : ""} + : Base(vm, structure)${obj.valuesArray ? ", jsvalueArray(WTF::move(jsvalueArray_))" : ""} { m_ctx = sinkPtr; ${weakInit.trim()} @@ -1521,7 +1521,7 @@ function generateClassHeader(typeName, obj: ClassDefinition) { ${ obj.valuesArray && obj.values && obj.values.length > 0 ? `${name}(JSC::VM& vm, JSC::Structure* structure, void* sinkPtr, WTF::FixedVector>&& jsvalueArray_${obj.values.map(v => `, JSC::JSValue ${v}`).join("")}) - : Base(vm, structure), jsvalueArray(WTFMove(jsvalueArray_))${obj.values.map(v => `\n , m_${v}(${v}, JSC::WriteBarrierEarlyInit)`).join("")} + : Base(vm, structure), jsvalueArray(WTF::move(jsvalueArray_))${obj.values.map(v => `\n , m_${v}(${v}, JSC::WriteBarrierEarlyInit)`).join("")} { m_ctx = sinkPtr; ${weakInit.trim()} @@ -1779,7 +1779,7 @@ ${name}* ${name}::create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::St ${ obj.valuesArray ? `${name}* ${name}::create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, void* ctx, WTF::FixedVector>&& jsvalueArray) { - ${name}* ptr = new (NotNull, JSC::allocateCell<${name}>(vm)) ${name}(vm, structure, ctx, WTFMove(jsvalueArray)); + ${name}* ptr = new (NotNull, JSC::allocateCell<${name}>(vm)) ${name}(vm, structure, ctx, WTF::move(jsvalueArray)); ptr->finishCreation(vm); return ptr; }` @@ -1799,7 +1799,7 @@ ${ ${ obj.valuesArray && obj.values && obj.values.length > 0 ? `${name}* ${name}::create(JSC::VM& vm, JSC::JSGlobalObject* globalObject, JSC::Structure* structure, void* ctx, WTF::FixedVector>&& jsvalueArray${obj.values.map(v => `, JSC::JSValue ${v}`).join("")}) { - ${name}* ptr = new (NotNull, JSC::allocateCell<${name}>(vm)) ${name}(vm, structure, ctx, WTFMove(jsvalueArray)${obj.values.map(v => `, ${v}`).join("")}); + ${name}* ptr = new (NotNull, JSC::allocateCell<${name}>(vm)) ${name}(vm, structure, ctx, WTF::move(jsvalueArray)${obj.values.map(v => `, ${v}`).join("")}); ptr->finishCreation(vm); return ptr; }` @@ -1915,7 +1915,7 @@ ${ for (size_t i = 0; i < args->size(); ++i) { jsvalueArray[i].setWithoutWriteBarrier(args->at(i)); } - ${className(typeName)}* instance = ${className(typeName)}::create(vm, globalObject, structure, ptr, WTFMove(jsvalueArray)); + ${className(typeName)}* instance = ${className(typeName)}::create(vm, globalObject, structure, ptr, WTF::move(jsvalueArray)); ${ obj.estimatedSize ? ` @@ -1956,7 +1956,7 @@ ${ for (size_t i = 0; i < args->size(); ++i) { jsvalueArray[i].setWithoutWriteBarrier(args->at(i)); } - ${className(typeName)}* instance = ${className(typeName)}::create(vm, globalObject, structure, ptr, WTFMove(jsvalueArray)${obj.values.map(v => `, JSC::JSValue::decode(${v})`).join("")}); + ${className(typeName)}* instance = ${className(typeName)}::create(vm, globalObject, structure, ptr, WTF::move(jsvalueArray)${obj.values.map(v => `, JSC::JSValue::decode(${v})`).join("")}); ${ obj.estimatedSize ? ` diff --git a/src/vm/SigintWatcher.h b/src/vm/SigintWatcher.h index dbdf33c1c4..6cb033fb49 100644 --- a/src/vm/SigintWatcher.h +++ b/src/vm/SigintWatcher.h @@ -54,7 +54,7 @@ public: GlobalObjectHolder(const GlobalObjectHolder&) = delete; GlobalObjectHolder(GlobalObjectHolder&& other) : m_globalObject(std::exchange(other.m_globalObject, nullptr)) - , m_receivers(WTFMove(other.m_receivers)) + , m_receivers(WTF::move(other.m_receivers)) { } @@ -62,7 +62,7 @@ public: GlobalObjectHolder& operator=(GlobalObjectHolder&& other) { m_globalObject = std::exchange(other.m_globalObject, nullptr); - m_receivers = WTFMove(other.m_receivers); + m_receivers = WTF::move(other.m_receivers); return *this; }