Skip to content

Commit

Permalink
Rename res to rval
Browse files Browse the repository at this point in the history
  • Loading branch information
andreiltd committed Dec 9, 2024
1 parent 58e2d05 commit 923eb3d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
20 changes: 10 additions & 10 deletions builtins/web/blob.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand All @@ -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) {
Expand All @@ -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;
Expand Down Expand Up @@ -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);

Expand All @@ -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 *>(jsencoding::encoding_for_label_no_replacement(
Expand Down
10 changes: 5 additions & 5 deletions builtins/web/blob.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ class Blob : public TraceableBuiltinImpl<Blob> {
using ByteBuffer = js::Vector<uint8_t, 0, js::SystemAllocPolicy>;
using ReadersMap = JS::GCHashMap<HeapObj, BlobReader, js::StableCellHasher<HeapObj>, 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);
Expand Down

0 comments on commit 923eb3d

Please sign in to comment.