aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-09-01 01:08:59 -0700
committerGravatar Jarred Sumner <709451+Jarred-Sumner@users.noreply.github.com> 2022-09-01 01:08:59 -0700
commit5eb431dcd0efa16a23fae40473268aa5d465c200 (patch)
tree75e1a1f627474322737c8ec8d5d38447a6dee4f2
parent5d993988508e3138f8dbc7ef69cd59de7d6c4584 (diff)
downloadbun-5eb431dcd0efa16a23fae40473268aa5d465c200.tar.gz
bun-5eb431dcd0efa16a23fae40473268aa5d465c200.tar.zst
bun-5eb431dcd0efa16a23fae40473268aa5d465c200.zip
Fixes https://github.com/oven-sh/bun/issues/1183
-rw-r--r--src/bun.js/api/bun.zig3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bun.js/api/bun.zig b/src/bun.js/api/bun.zig
index 0c22a5d9b..ed3ad3710 100644
--- a/src/bun.js/api/bun.zig
+++ b/src/bun.js/api/bun.zig
@@ -1365,6 +1365,7 @@ pub const Crypto = struct {
}
pub fn update(this: *@This(), globalThis: *JSC.JSGlobalObject, callframe: *JSC.CallFrame) callconv(.C) JSC.JSValue {
+ const thisValue = callframe.this();
const input = callframe.argument(0);
const buffer = JSC.Node.SliceOrBuffer.fromJS(globalThis.ptr(), globalThis.bunVM().allocator, input) orelse {
globalThis.throwInvalidArguments("expected string or buffer", .{});
@@ -1372,7 +1373,7 @@ pub const Crypto = struct {
};
defer buffer.deinit();
this.hashing.update(buffer.slice());
- return input;
+ return thisValue;
}
pub fn digest_(