aboutsummaryrefslogtreecommitdiff
path: root/src/bun.js/builtins/js
diff options
context:
space:
mode:
Diffstat (limited to 'src/bun.js/builtins/js')
-rw-r--r--src/bun.js/builtins/js/JSBufferConstructor.js8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/bun.js/builtins/js/JSBufferConstructor.js b/src/bun.js/builtins/js/JSBufferConstructor.js
index 4c3650360..10994394e 100644
--- a/src/bun.js/builtins/js/JSBufferConstructor.js
+++ b/src/bun.js/builtins/js/JSBufferConstructor.js
@@ -31,16 +31,12 @@ function from(items) {
if (!@isConstructor(this))
@throwTypeError("Buffer.from requires |this| to be a constructor");
- if (@isUndefinedOrNull(items))
+ if (@isUndefinedOrNull(items)) {
@throwTypeError(
"The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.",
);
-
- if (@argumentCount() === 1 && @isTypedArrayView(items)) {
- var out = this.allocUnsafe(items.byteLength);
- out.copy(items);
- return out;
}
+
// TODO: figure out why private symbol not found
if (