From 923eb3d8dad2cf0260909c8c6d861be568832149 Mon Sep 17 00:00:00 2001 From: Tomasz Andrzejak Date: Mon, 9 Dec 2024 19:28:19 +0100 Subject: [PATCH] Rename res to rval --- builtins/web/blob.cpp | 20 ++++++++++---------- builtins/web/blob.h | 10 +++++----- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/builtins/web/blob.cpp b/builtins/web/blob.cpp index 87d5703..2b33c2f 100644 --- a/builtins/web/blob.cpp +++ b/builtins/web/blob.cpp @@ -287,13 +287,13 @@ DEFINE_BLOB_METHOD(stream) DEFINE_BLOB_METHOD(text) DEFINE_BLOB_METHOD_W_ARGS(slice) -bool Blob::arrayBuffer(JSContext *cx, HandleObject self, MutableHandleValue res) { +bool Blob::arrayBuffer(JSContext *cx, HandleObject self, MutableHandleValue rval) { JS::RootedObject promise(cx, JS::NewPromiseObject(cx, nullptr)); if (!promise) { return false; } - res.setObject(*promise); + rval.setObject(*promise); auto buffer = data_to_owned_array_buffer(cx, self); if (!buffer) { @@ -307,13 +307,13 @@ bool Blob::arrayBuffer(JSContext *cx, HandleObject self, MutableHandleValue res) return true; } -bool Blob::bytes(JSContext *cx, HandleObject self, MutableHandleValue res) { +bool Blob::bytes(JSContext *cx, HandleObject self, MutableHandleValue rval) { JS::RootedObject promise(cx, JS::NewPromiseObject(cx, nullptr)); if (!promise) { return false; } - res.setObject(*promise); + rval.setObject(*promise); JS::RootedObject buffer(cx, data_to_owned_array_buffer(cx, self)); if (!buffer) { @@ -333,7 +333,7 @@ bool Blob::bytes(JSContext *cx, HandleObject self, MutableHandleValue res) { return true; } -bool Blob::slice(JSContext *cx, HandleObject self, const CallArgs &args, MutableHandleValue res) { +bool Blob::slice(JSContext *cx, HandleObject self, const CallArgs &args, MutableHandleValue rval) { auto src = Blob::blob(self); int64_t size = src->length(); int64_t start = 0; @@ -378,11 +378,11 @@ bool Blob::slice(JSContext *cx, HandleObject self, const CallArgs &args, Mutable return false; } - res.setObject(*new_blob); + rval.setObject(*new_blob); return true; } -bool Blob::stream(JSContext *cx, HandleObject self, MutableHandleValue res) { +bool Blob::stream(JSContext *cx, HandleObject self, MutableHandleValue rval) { auto native_stream = streams::NativeStreamSource::create(cx, self, JS::UndefinedHandleValue, stream_pull, stream_cancel); @@ -404,17 +404,17 @@ bool Blob::stream(JSContext *cx, HandleObject self, MutableHandleValue res) { return false; } - res.setObject(*stream); + rval.setObject(*stream); return true; } -bool Blob::text(JSContext *cx, HandleObject self, MutableHandleValue res) { +bool Blob::text(JSContext *cx, HandleObject self, MutableHandleValue rval) { JS::RootedObject promise(cx, JS::NewPromiseObject(cx, nullptr)); if (!promise) { return false; } - res.setObject(*promise); + rval.setObject(*promise); auto src = Blob::blob(self); auto encoding = const_cast(jsencoding::encoding_for_label_no_replacement( diff --git a/builtins/web/blob.h b/builtins/web/blob.h index 80541e0..3bf45f6 100644 --- a/builtins/web/blob.h +++ b/builtins/web/blob.h @@ -58,11 +58,11 @@ class Blob : public TraceableBuiltinImpl { using ByteBuffer = js::Vector; using ReadersMap = JS::GCHashMap, js::SystemAllocPolicy>; - static bool arrayBuffer(JSContext *cx, HandleObject self, MutableHandleValue result); - static bool bytes(JSContext *cx, HandleObject self, MutableHandleValue result); - static bool stream(JSContext *cx, HandleObject self, MutableHandleValue result); - static bool text(JSContext *cx, HandleObject self, MutableHandleValue result); - static bool slice(JSContext *cx, HandleObject self, const CallArgs &args, MutableHandleValue result); + static bool arrayBuffer(JSContext *cx, HandleObject self, MutableHandleValue rval); + static bool bytes(JSContext *cx, HandleObject self, MutableHandleValue rval); + static bool stream(JSContext *cx, HandleObject self, MutableHandleValue rval); + static bool text(JSContext *cx, HandleObject self, MutableHandleValue rval); + static bool slice(JSContext *cx, HandleObject self, const CallArgs &args, MutableHandleValue rval); static ReadersMap *readers(JSObject *self); static ByteBuffer *blob(JSObject *self);