From d457ff89f67984bb3b1d48f1224a6e4377124b85 Mon Sep 17 00:00:00 2001 From: ValoChet Date: Thu, 15 Oct 2026 11:37:17 +0200 Subject: [PATCH] refactor: remove return value from v8 throw --- src/AppWrapper.h | 51 +++++++++++++++++++-------------------- src/HttpRequestWrapper.h | 8 +++--- src/HttpResponseWrapper.h | 20 +++++++-------- src/Utilities.h | 14 ++++------- src/WebSocketWrapper.h | 24 +++++++++--------- src/addon.cpp | 46 +++++++++++++++++------------------ 6 files changed, 79 insertions(+), 84 deletions(-) diff --git a/src/AppWrapper.h b/src/AppWrapper.h index e32414310..191044869 100644 --- a/src/AppWrapper.h +++ b/src/AppWrapper.h @@ -38,7 +38,7 @@ void uWS_App_ws(const FunctionCallbackInfo &args) { typename APP::template WebSocketBehavior behavior = {}; NativeString pattern(args.GetIsolate(), args[0]); - if (pattern.isInvalid(args)) { + if (pattern.isInvalid()) { return; } @@ -320,7 +320,7 @@ void uWS_App_get(F f, const FunctionCallbackInfo &args) { /* Pattern */ NativeString pattern(args.GetIsolate(), args[0]); - if (pattern.isInvalid(args)) { + if (pattern.isInvalid()) { return; } @@ -334,7 +334,7 @@ void uWS_App_get(F f, const FunctionCallbackInfo &args) { /* If the handler is String */ if (args[1]->IsArrayBuffer()) { NativeString constantString(args.GetIsolate(), args[1]); - if (constantString.isInvalid(args)) { + if (constantString.isInvalid()) { return; } @@ -456,7 +456,7 @@ void uWS_App_get(F f, const FunctionCallbackInfo &args) { /* Handler */ Callback checkedCallback(args.GetIsolate(), args[1]); - if (checkedCallback.isInvalid(args)) { + if (checkedCallback.isInvalid()) { return; } NoexceptPersistent cb = checkedCallback.getFunction(); @@ -522,7 +522,7 @@ void uWS_App_listen_unix(const FunctionCallbackInfo &args) { /* Path is last */ std::string path; NativeString h(isolate, args[args.Length() - 1]); - if (h.isInvalid(args)) { + if (h.isInvalid()) { return; } path = h.getString(); @@ -556,7 +556,7 @@ void uWS_App_listen(const FunctionCallbackInfo &args) { int firstNumber = 0; if (!args[0]->IsNumber()) { NativeString h(isolate, args[0]); - if (h.isInvalid(args)) { + if (h.isInvalid()) { return; } host = h.getString(); @@ -582,7 +582,7 @@ void uWS_App_filter(const FunctionCallbackInfo &args) { /* Handler */ Callback checkedCallback(args.GetIsolate(), args[0]); - if (checkedCallback.isInvalid(args)) { + if (checkedCallback.isInvalid()) { return; } NoexceptPersistent cb = checkedCallback.getFunction(); @@ -617,7 +617,7 @@ void uWS_App_domain(const FunctionCallbackInfo &args) { } NativeString serverName(isolate, args[0]); - if (serverName.isInvalid(args)) { + if (serverName.isInvalid()) { return; } @@ -638,12 +638,12 @@ void uWS_App_publish(const FunctionCallbackInfo &args) { } NativeString topic(isolate, args[0]); - if (topic.isInvalid(args)) { + if (topic.isInvalid()) { return; } NativeString message(isolate, args[1]); - if (message.isInvalid(args)) { + if (message.isInvalid()) { return; } @@ -664,7 +664,7 @@ void uWS_App_numSubscribers(const FunctionCallbackInfo &args) { } NativeString topic(isolate, args[0]); - if (topic.isInvalid(args)) { + if (topic.isInvalid()) { return; } @@ -680,7 +680,7 @@ std::pair readOptionsObject(const FunctionCallb if (args.Length() > index && !args[index]->IsUndefined() && !args[index]->IsNull()) { if (!args[index]->IsObject()) { - args.GetReturnValue().Set(isolate->ThrowException(v8::Exception::Error(String::NewFromUtf8(isolate, "Options must be an object.", NewStringType::kNormal).ToLocalChecked()))); + isolate->ThrowException(v8::Exception::Error(String::NewFromUtf8Literal(isolate, "Options must be an object."))); return {}; } @@ -688,7 +688,7 @@ std::pair readOptionsObject(const FunctionCallb /* Key file name */ NativeString keyFileNameValue(isolate, optionsObject->Get(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "key_file_name", NewStringType::kNormal).ToLocalChecked()).ToLocalChecked()); - if (keyFileNameValue.isInvalid(args)) { + if (keyFileNameValue.isInvalid()) { return {}; } if (keyFileNameValue.getString().length()) { @@ -698,7 +698,7 @@ std::pair readOptionsObject(const FunctionCallb /* Cert file name */ NativeString certFileNameValue(isolate, optionsObject->Get(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "cert_file_name", NewStringType::kNormal).ToLocalChecked()).ToLocalChecked()); - if (certFileNameValue.isInvalid(args)) { + if (certFileNameValue.isInvalid()) { return {}; } if (certFileNameValue.getString().length()) { @@ -708,7 +708,7 @@ std::pair readOptionsObject(const FunctionCallb /* Passphrase */ NativeString passphraseValue(isolate, optionsObject->Get(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "passphrase", NewStringType::kNormal).ToLocalChecked()).ToLocalChecked()); - if (passphraseValue.isInvalid(args)) { + if (passphraseValue.isInvalid()) { return {}; } if (passphraseValue.getString().length()) { @@ -718,7 +718,7 @@ std::pair readOptionsObject(const FunctionCallb /* DH params file name */ NativeString dhParamsFileNameValue(isolate, optionsObject->Get(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "dh_params_file_name", NewStringType::kNormal).ToLocalChecked()).ToLocalChecked()); - if (dhParamsFileNameValue.isInvalid(args)) { + if (dhParamsFileNameValue.isInvalid()) { return {}; } if (dhParamsFileNameValue.getString().length()) { @@ -728,7 +728,7 @@ std::pair readOptionsObject(const FunctionCallb /* CA file name */ NativeString caFileNameValue(isolate, optionsObject->Get(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "ca_file_name", NewStringType::kNormal).ToLocalChecked()).ToLocalChecked()); - if (caFileNameValue.isInvalid(args)) { + if (caFileNameValue.isInvalid()) { return {}; } if (caFileNameValue.getString().length()) { @@ -741,7 +741,7 @@ std::pair readOptionsObject(const FunctionCallb /* ssl_ciphers */ NativeString sslCiphersValue(isolate, optionsObject->Get(isolate->GetCurrentContext(), String::NewFromUtf8(isolate, "ssl_ciphers", NewStringType::kNormal).ToLocalChecked()).ToLocalChecked()); - if (sslCiphersValue.isInvalid(args)) { + if (sslCiphersValue.isInvalid()) { return {}; } if (sslCiphersValue.getString().length()) { @@ -762,7 +762,7 @@ void uWS_App_adoptSocket(const FunctionCallbackInfo &args) { int32_t fd = args[0]->Int32Value(isolate->GetCurrentContext()).ToChecked(); NativeString ip(isolate, args[1]); - if (ip.isInvalid(args)) { + if (ip.isInvalid()) { return; } @@ -841,7 +841,7 @@ void uWS_App_addServerName(const FunctionCallbackInfo &args) { Isolate *isolate = args.GetIsolate(); NativeString hostnamePatternValue(isolate, args[0]); - if (hostnamePatternValue.isInvalid(args)) { + if (hostnamePatternValue.isInvalid()) { return; } std::string hostnamePattern; @@ -865,7 +865,7 @@ void uWS_App_removeServerName(const FunctionCallbackInfo &args) { Isolate *isolate = args.GetIsolate(); NativeString hostnamePatternValue(isolate, args[0]); - if (hostnamePatternValue.isInvalid(args)) { + if (hostnamePatternValue.isInvalid()) { return; } std::string hostnamePattern; @@ -919,7 +919,7 @@ void uWS_App(const FunctionCallbackInfo &args) { /* Throw if we failed to construct the app */ if (app->constructorFailed()) { delete app; - args.GetReturnValue().Set(isolate->ThrowException(v8::Exception::Error(String::NewFromUtf8(isolate, "App construction failed", NewStringType::kNormal).ToLocalChecked()))); + isolate->ThrowException(v8::Exception::Error(String::NewFromUtf8Literal(isolate, "App construction failed"))); return; } @@ -949,8 +949,7 @@ void uWS_App(const FunctionCallbackInfo &args) { // 1. Ensure args[2] is an Object if (!args[2]->IsObject()) { - isolate->ThrowException(v8::Exception::TypeError( - v8::String::NewFromUtf8(isolate, "Cache options must be an object").ToLocalChecked())); + isolate->ThrowException(v8::Exception::TypeError(String::NewFromUtf8Literal(isolate, "Cache options must be an object"))); return; } @@ -980,13 +979,13 @@ void uWS_App(const FunctionCallbackInfo &args) { /* Pattern */ NativeString pattern(args.GetIsolate(), args[0]); - if (pattern.isInvalid(args)) { + if (pattern.isInvalid()) { return; } /* Handler */ Callback checkedCallback(args.GetIsolate(), args[1]); - if (checkedCallback.isInvalid(args)) { + if (checkedCallback.isInvalid()) { return; } NoexceptPersistent cb = checkedCallback.getFunction(); diff --git a/src/HttpRequestWrapper.h b/src/HttpRequestWrapper.h index 7470abcb0..b9c6a6615 100644 --- a/src/HttpRequestWrapper.h +++ b/src/HttpRequestWrapper.h @@ -31,7 +31,7 @@ struct HttpRequestWrapper { /* Thow on deleted request */ auto *req = (uWS::HttpRequest *) getInternalPointer(args.This());//->GetAlignedPointerFromInternalField(0); if (!req) { - args.GetReturnValue().Set(isolate->ThrowException(v8::Exception::Error(String::NewFromUtf8(isolate, "uWS.HttpRequest must not be accessed after await or route handler return. See documentation for uWS.HttpRequest and consult the user manual.", NewStringType::kNormal).ToLocalChecked()))); + isolate->ThrowException(v8::Exception::Error(String::NewFromUtf8Literal(isolate, "uWS.HttpRequest must not be accessed after await or route handler return. See documentation for uWS.HttpRequest and consult the user manual."))); } if constexpr (QUIC) { @@ -72,7 +72,7 @@ struct HttpRequestWrapper { parameter = req->getParameter(index); } else { NativeString data(args.GetIsolate(), args[0]); - if (data.isInvalid(args)) { + if (data.isInvalid()) { return; } parameter = req->getParameter(data.getString()); @@ -101,7 +101,7 @@ struct HttpRequestWrapper { auto *req = getHttpRequest(args); if (req) { NativeString data(args.GetIsolate(), args[0]); - if (data.isInvalid(args)) { + if (data.isInvalid()) { return; } @@ -159,7 +159,7 @@ struct HttpRequestWrapper { /* Do we have a key argument? */ if (args.Length() == 1) { NativeString keyString(isolate, args[0]); - if (keyString.isInvalid(args)) { + if (keyString.isInvalid()) { return; } diff --git a/src/HttpResponseWrapper.h b/src/HttpResponseWrapper.h index 86192280f..7dd6d7e1b 100644 --- a/src/HttpResponseWrapper.h +++ b/src/HttpResponseWrapper.h @@ -38,7 +38,7 @@ struct HttpResponseWrapper { Isolate *isolate = args.GetIsolate(); void *res = getInternalPointer(args.This());//->GetAlignedPointerFromInternalField(0); if (!res) { - args.GetReturnValue().Set(isolate->ThrowException(v8::Exception::Error(String::NewFromUtf8(isolate, "uWS.HttpResponse must not be accessed after uWS.HttpResponse.onAborted callback, or after a successful response. See documentation for uWS.HttpResponse and consult the user manual.", NewStringType::kNormal).ToLocalChecked()))); + isolate->ThrowException(v8::Exception::Error(String::NewFromUtf8Literal(isolate, "uWS.HttpResponse must not be accessed after uWS.HttpResponse.onAborted callback, or after a successful response. See documentation for uWS.HttpResponse and consult the user manual."))); } if constexpr (PROTOCOL == 2) { @@ -373,7 +373,7 @@ struct HttpResponseWrapper { auto *res = getHttpResponse(args); if (res) { NativeString data(args.GetIsolate(), args[0]); - if (data.isInvalid(args)) { + if (data.isInvalid()) { return; } @@ -413,7 +413,7 @@ struct HttpResponseWrapper { auto *res = getHttpResponse(args); if (res) { NativeString data(args.GetIsolate(), args[0]); - if (data.isInvalid(args)) { + if (data.isInvalid()) { return; } @@ -437,7 +437,7 @@ struct HttpResponseWrapper { auto *res = getHttpResponse(args); if (res) { NativeString data(args.GetIsolate(), args[0]); - if (data.isInvalid(args)) { + if (data.isInvalid()) { return; } @@ -467,7 +467,7 @@ struct HttpResponseWrapper { auto *res = getHttpResponse(args); if (res) { NativeString data(args.GetIsolate(), args[0]); - if (data.isInvalid(args)) { + if (data.isInvalid()) { return; } assumeCorked(); @@ -499,11 +499,11 @@ struct HttpResponseWrapper { // Optimization: writeHeader never calls JS or allocated on the GC // use zero copy string view in best case NativeString header(args.GetIsolate(), args[0]); - if (header.isInvalid(args)) { + if (header.isInvalid()) { return; } NativeString value(args.GetIsolate(), args[1]); - if (value.isInvalid(args)) { + if (value.isInvalid()) { return; } assumeCorked(); @@ -543,17 +543,17 @@ struct HttpResponseWrapper { } NativeString secWebSocketKey(args.GetIsolate(), args[1]); - if (secWebSocketKey.isInvalid(args)) { + if (secWebSocketKey.isInvalid()) { return; } NativeString secWebSocketProtocol(args.GetIsolate(), args[2]); - if (secWebSocketProtocol.isInvalid(args)) { + if (secWebSocketProtocol.isInvalid()) { return; } NativeString secWebSocketExtensions(args.GetIsolate(), args[3]); - if (secWebSocketExtensions.isInvalid(args)) { + if (secWebSocketExtensions.isInvalid()) { return; } diff --git a/src/Utilities.h b/src/Utilities.h index c78a8f917..16759cc5e 100644 --- a/src/Utilities.h +++ b/src/Utilities.h @@ -143,7 +143,7 @@ static inline bool missingArguments(int length, const FunctionCallbackInfoThrowException(v8::Exception::Error(String::NewFromUtf8(args.GetIsolate(), message.c_str(), NewStringType::kNormal).ToLocalChecked()))); + args.GetIsolate()->ThrowException(v8::Exception::Error(String::NewFromUtf8(args.GetIsolate(), message.c_str(), NewStringType::kNormal).ToLocalChecked())); return true; } return false; @@ -156,16 +156,14 @@ struct Callback { if (!value->IsFunction()) { invalid = true; + isolate->ThrowException(v8::Exception::Error(String::NewFromUtf8Literal(isolate, "Passed callback is not a valid function."))); return; } f.Reset(isolate, Local::Cast(value)); } - bool isInvalid(const FunctionCallbackInfo &args) { - if (invalid) { - args.GetReturnValue().Set(args.GetIsolate()->ThrowException(v8::Exception::Error(String::NewFromUtf8(args.GetIsolate(), "Passed callback is not a valid function.", NewStringType::kNormal).ToLocalChecked()))); - } + bool isInvalid() { return invalid; } @@ -280,13 +278,11 @@ class NativeString { data = (char *) arrayBuffer->Data(); } else { invalid = true; + isolate->ThrowException(v8::Exception::Error(String::NewFromUtf8Literal(isolate, "Text and data can only be passed by String, ArrayBuffer or ArrayBufferView."))); } } - bool isInvalid(const FunctionCallbackInfo &args) { - if (invalid) { - args.GetReturnValue().Set(args.GetIsolate()->ThrowException(v8::Exception::Error(String::NewFromUtf8(args.GetIsolate(), "Text and data can only be passed by String, ArrayBuffer or ArrayBufferView.", NewStringType::kNormal).ToLocalChecked()))); - } + bool isInvalid() { return invalid; } diff --git a/src/WebSocketWrapper.h b/src/WebSocketWrapper.h index 24a389b68..76d57588b 100644 --- a/src/WebSocketWrapper.h +++ b/src/WebSocketWrapper.h @@ -31,7 +31,7 @@ struct WebSocketWrapper { Isolate *isolate = args.GetIsolate(); auto *ws = (uWS::WebSocket *) getInternalPointer(args.This());//->GetAlignedPointerFromInternalField(0); if (!ws) { - args.GetReturnValue().Set(isolate->ThrowException(v8::Exception::Error(String::NewFromUtf8(isolate, "Invalid access of closed uWS.WebSocket/SSLWebSocket.", NewStringType::kNormal).ToLocalChecked()))); + isolate->ThrowException(v8::Exception::Error(String::NewFromUtf8Literal(isolate, "Invalid access of closed uWS.WebSocket/SSLWebSocket."))); } return ws; } @@ -54,7 +54,7 @@ struct WebSocketWrapper { auto *ws = getWebSocket(args); if (ws) { NativeString topic(isolate, args[0]); - if (topic.isInvalid(args)) { + if (topic.isInvalid()) { return; } bool success = ws->subscribe(topic.getString()); @@ -69,7 +69,7 @@ struct WebSocketWrapper { auto *ws = getWebSocket(args); if (ws) { NativeString topic(isolate, args[0]); - if (topic.isInvalid(args)) { + if (topic.isInvalid()) { return; } bool success = ws->unsubscribe(topic.getString()); @@ -91,11 +91,11 @@ struct WebSocketWrapper { bool compress = args[3]->BooleanValue(isolate); NativeString topic(isolate, args[0]); - if (topic.isInvalid(args)) { + if (topic.isInvalid()) { return; } NativeString message(isolate, args[1]); - if (message.isInvalid(args)) { + if (message.isInvalid()) { return; } @@ -129,7 +129,7 @@ struct WebSocketWrapper { } NativeString message(args.GetIsolate(), args[1]); - if (message.isInvalid(args)) { + if (message.isInvalid()) { return; } @@ -191,7 +191,7 @@ struct WebSocketWrapper { auto *ws = getWebSocket(args); if (ws) { NativeString message(args.GetIsolate(), args[0]); - if (message.isInvalid(args)) { + if (message.isInvalid()) { return; } @@ -208,7 +208,7 @@ struct WebSocketWrapper { auto *ws = getWebSocket(args); if (ws) { NativeString message(args.GetIsolate(), args[0]); - if (message.isInvalid(args)) { + if (message.isInvalid()) { return; } @@ -225,7 +225,7 @@ struct WebSocketWrapper { auto *ws = getWebSocket(args); if (ws) { NativeString message(args.GetIsolate(), args[0]); - if (message.isInvalid(args)) { + if (message.isInvalid()) { return; } @@ -246,7 +246,7 @@ struct WebSocketWrapper { bool compress = args[2]->BooleanValue(isolate); NativeString message(args.GetIsolate(), args[0]); - if (message.isInvalid(args)) { + if (message.isInvalid()) { return; } @@ -263,7 +263,7 @@ struct WebSocketWrapper { auto *ws = getWebSocket(args); if (ws) { NativeString topic(args.GetIsolate(), args[0]); - if (topic.isInvalid(args)) { + if (topic.isInvalid()) { return; } @@ -280,7 +280,7 @@ struct WebSocketWrapper { auto *ws = getWebSocket(args); if (ws) { NativeString message(args.GetIsolate(), args[0]); - if (message.isInvalid(args)) { + if (message.isInvalid()) { return; } diff --git a/src/addon.cpp b/src/addon.cpp index 7e9a44db8..50c86cfcc 100644 --- a/src/addon.cpp +++ b/src/addon.cpp @@ -49,12 +49,12 @@ void uWS_getParts(const FunctionCallbackInfo &args) { Isolate *isolate = args.GetIsolate(); NativeString body(args.GetIsolate(), args[0]); - if (body.isInvalid(args)) { + if (body.isInvalid()) { return; } NativeString contentType(args.GetIsolate(), args[1]); - if (contentType.isInvalid(args)) { + if (contentType.isInvalid()) { return; } @@ -150,7 +150,7 @@ void uWS_clearTimeout(const FunctionCallbackInfo &args) { /* Pass various undocumented configs */ void uWS_cfg(const FunctionCallbackInfo &args) { NativeString key(args.GetIsolate(), args[0]); - if (key.isInvalid(args)) { + if (key.isInvalid()) { return; } @@ -164,7 +164,7 @@ void uWS_cfg(const FunctionCallbackInfo &args) { * would be cast to a bogus pointer and dereferenced, killing the process */ static inline bool invalidSocket(const FunctionCallbackInfo &args, const char *message) { if (!args[0]->IsExternal()) { - args.GetReturnValue().Set(args.GetIsolate()->ThrowException(v8::Exception::Error(String::NewFromUtf8(args.GetIsolate(), message, NewStringType::kNormal).ToLocalChecked()))); + args.GetIsolate()->ThrowException(v8::Exception::Error(String::NewFromUtf8(args.GetIsolate(), message, NewStringType::kNormal).ToLocalChecked())); return true; } return false; @@ -200,12 +200,12 @@ std::mutex kvMutex; // getString(key, collection) void uWS_getString(const FunctionCallbackInfo &args) { NativeString key(args.GetIsolate(), args[0]); - if (key.isInvalid(args)) { + if (key.isInvalid()) { return; } NativeString collection(args.GetIsolate(), args[1]); - if (collection.isInvalid(args)) { + if (collection.isInvalid()) { return; } @@ -216,16 +216,16 @@ void uWS_getString(const FunctionCallbackInfo &args) { void uWS_setString(const FunctionCallbackInfo &args) { NativeString key(args.GetIsolate(), args[0]); - if (key.isInvalid(args)) { + if (key.isInvalid()) { return; } NativeString value(args.GetIsolate(), args[1]); - if (value.isInvalid(args)) { + if (value.isInvalid()) { return; } NativeString collection(args.GetIsolate(), args[2]); - if (collection.isInvalid(args)) { + if (collection.isInvalid()) { return; } @@ -234,12 +234,12 @@ void uWS_setString(const FunctionCallbackInfo &args) { void uWS_getInteger(const FunctionCallbackInfo &args) { NativeString key(args.GetIsolate(), args[0]); - if (key.isInvalid(args)) { + if (key.isInvalid()) { return; } NativeString collection(args.GetIsolate(), args[1]); - if (collection.isInvalid(args)) { + if (collection.isInvalid()) { return; } @@ -250,14 +250,14 @@ void uWS_getInteger(const FunctionCallbackInfo &args) { void uWS_setInteger(const FunctionCallbackInfo &args) { NativeString key(args.GetIsolate(), args[0]); - if (key.isInvalid(args)) { + if (key.isInvalid()) { return; } uint32_t value = Local::Cast(args[1])->Value(); NativeString collection(args.GetIsolate(), args[2]); - if (collection.isInvalid(args)) { + if (collection.isInvalid()) { return; } @@ -266,14 +266,14 @@ void uWS_setInteger(const FunctionCallbackInfo &args) { void uWS_incInteger(const FunctionCallbackInfo &args) { NativeString key(args.GetIsolate(), args[0]); - if (key.isInvalid(args)) { + if (key.isInvalid()) { return; } uint32_t change = Local::Cast(args[1])->Value(); NativeString collection(args.GetIsolate(), args[2]); - if (collection.isInvalid(args)) { + if (collection.isInvalid()) { return; } @@ -286,7 +286,7 @@ void uWS_incInteger(const FunctionCallbackInfo &args) { void uWS_getStringKeys(const FunctionCallbackInfo &args) { NativeString collection(args.GetIsolate(), args[0]); - if (collection.isInvalid(args)) { + if (collection.isInvalid()) { return; } @@ -306,7 +306,7 @@ void uWS_getStringKeys(const FunctionCallbackInfo &args) { void uWS_getIntegerKeys(const FunctionCallbackInfo &args) { NativeString collection(args.GetIsolate(), args[0]); - if (collection.isInvalid(args)) { + if (collection.isInvalid()) { return; } @@ -326,12 +326,12 @@ void uWS_getIntegerKeys(const FunctionCallbackInfo &args) { void uWS_deleteString(const FunctionCallbackInfo &args) { NativeString key(args.GetIsolate(), args[0]); - if (key.isInvalid(args)) { + if (key.isInvalid()) { return; } NativeString collection(args.GetIsolate(), args[1]); - if (collection.isInvalid(args)) { + if (collection.isInvalid()) { return; } @@ -343,12 +343,12 @@ void uWS_deleteString(const FunctionCallbackInfo &args) { void uWS_deleteInteger(const FunctionCallbackInfo &args) { NativeString key(args.GetIsolate(), args[0]); - if (key.isInvalid(args)) { + if (key.isInvalid()) { return; } NativeString collection(args.GetIsolate(), args[1]); - if (collection.isInvalid(args)) { + if (collection.isInvalid()) { return; } @@ -360,7 +360,7 @@ void uWS_deleteInteger(const FunctionCallbackInfo &args) { void uWS_deleteStringCollection(const FunctionCallbackInfo &args) { NativeString collection(args.GetIsolate(), args[0]); - if (collection.isInvalid(args)) { + if (collection.isInvalid()) { return; } @@ -372,7 +372,7 @@ void uWS_deleteStringCollection(const FunctionCallbackInfo &args) { void uWS_deleteIntegerCollection(const FunctionCallbackInfo &args) { NativeString collection(args.GetIsolate(), args[0]); - if (collection.isInvalid(args)) { + if (collection.isInvalid()) { return; }