From c66f90d809f3766b3ede135cc5eacb06fbdcd3ae Mon Sep 17 00:00:00 2001 From: PondWader <66561610+PondWader@users.noreply.github.com> Date: Fri, 29 Mar 2024 15:11:38 +0000 Subject: [PATCH 1/2] Fix URL.canParse.length --- src/bun.js/bindings/webcore/JSDOMURL.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) mode change 100644 => 100755 src/bun.js/bindings/webcore/JSDOMURL.cpp diff --git a/src/bun.js/bindings/webcore/JSDOMURL.cpp b/src/bun.js/bindings/webcore/JSDOMURL.cpp old mode 100644 new mode 100755 index b296575100e55e..87994d289a1e09 --- a/src/bun.js/bindings/webcore/JSDOMURL.cpp +++ b/src/bun.js/bindings/webcore/JSDOMURL.cpp @@ -132,7 +132,7 @@ using JSDOMURLDOMConstructor = JSDOMConstructor; static const HashTableValue JSDOMURLConstructorTableValues[] = { { "createObjectURL"_s, static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsDOMURLConstructorFunction_createObjectURL, 1 } }, { "revokeObjectURL"_s, static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsDOMURLConstructorFunction_revokeObjectURL, 1 } }, - { "canParse"_s, static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsDOMURLConstructorFunction_canParse, 2 } }, + { "canParse"_s, static_cast(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsDOMURLConstructorFunction_canParse, 1 } }, }; static inline JSC::EncodedJSValue constructJSDOMURL1(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame) From d067f1390cf569fe908fe04a4e0e7bc31411ad8e Mon Sep 17 00:00:00 2001 From: PondWader <66561610+PondWader@users.noreply.github.com> Date: Fri, 29 Mar 2024 15:20:31 +0000 Subject: [PATCH 2/2] Add URL.canParse.length test --- test/js/web/url/url.test.ts | 4 ++++ 1 file changed, 4 insertions(+) mode change 100644 => 100755 test/js/web/url/url.test.ts diff --git a/test/js/web/url/url.test.ts b/test/js/web/url/url.test.ts old mode 100644 new mode 100755 index c467f549f442f8..88a182a009c624 --- a/test/js/web/url/url.test.ts +++ b/test/js/web/url/url.test.ts @@ -226,5 +226,9 @@ describe("url", () => { expect(URL.canParse(url, base)).toBe(expected); }); }); + + it("URL.canParse.length should be 1", () => { + expect(URL.canParse.length).toBe(1); + }); }); });