diff options
author | 2022-09-16 00:53:03 -0700 | |
---|---|---|
committer | 2022-09-16 00:53:03 -0700 | |
commit | 0ce709d96abb48c747f5c93033c9a80fe79ee3bc (patch) | |
tree | f535a53c23fd95154b36ceab7c38c8e3a0275c89 /src/bun.js/bindings/JSBuffer.cpp | |
parent | fd808dec524c60ba18c620e27b205828760a6e41 (diff) | |
download | bun-0ce709d96abb48c747f5c93033c9a80fe79ee3bc.tar.gz bun-0ce709d96abb48c747f5c93033c9a80fe79ee3bc.tar.zst bun-0ce709d96abb48c747f5c93033c9a80fe79ee3bc.zip |
Make new HTTP client more stable
Diffstat (limited to 'src/bun.js/bindings/JSBuffer.cpp')
-rw-r--r-- | src/bun.js/bindings/JSBuffer.cpp | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/bun.js/bindings/JSBuffer.cpp b/src/bun.js/bindings/JSBuffer.cpp index 4b509f257..a1b9a5d40 100644 --- a/src/bun.js/bindings/JSBuffer.cpp +++ b/src/bun.js/bindings/JSBuffer.cpp @@ -248,8 +248,8 @@ static EncodedJSValue constructFromEncoding(JSGlobalObject* lexicalGlobalObject, result = Bun__encoding__constructFromLatin1(lexicalGlobalObject, view.characters8(), view.length(), static_cast<uint8_t>(encoding)); break; } - case WebCore::BufferEncodingType::ascii: // ascii is a noop for latin1 - case WebCore::BufferEncodingType::latin1: { // The native encoding is latin1, so we don't need to do any conversion. + case WebCore::BufferEncodingType::ascii: // ascii is a noop for latin1 + case WebCore::BufferEncodingType::latin1: { // The native encoding is latin1, so we don't need to do any conversion. result = JSBuffer__bufferFromPointerAndLength(lexicalGlobalObject, view.characters8(), view.length()); break; } @@ -1216,7 +1216,7 @@ static inline JSC::EncodedJSValue jsBufferPrototypeFunction_writeBody(JSC::JSGlo if (callFrame->argumentCount() > 2) { uint32_t arg_len = 0; arg_len = callFrame->argument(2).toUInt32(lexicalGlobalObject); - length = std::min(arg_len, length-offset); + length = std::min(arg_len, length - offset); } if (callFrame->argumentCount() > 2) { @@ -1329,7 +1329,6 @@ template<> EncodedJSValue JSC_HOST_CALL_ATTRIBUTES JSBufferConstructor::construc JSC::JSObject* constructor = lexicalGlobalObject->m_typedArrayUint8.constructor(lexicalGlobalObject); - // TODO: avoid this copy MarkedArgumentBuffer args; for (size_t i = 0; i < argsCount; ++i) args.append(callFrame->uncheckedArgument(i)); |