Skip to content

Commit

Permalink
Fix URL.canParse.length (#9710)
Browse files Browse the repository at this point in the history
* Fix URL.canParse.length

* Add URL.canParse.length test

---------

Co-authored-by: John-David Dalton <john.david.dalton@gmail.com>
  • Loading branch information
PondWader and jdalton authored Mar 29, 2024
1 parent fb8a299 commit 9ecb691
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/bun.js/bindings/webcore/JSDOMURL.cpp
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ using JSDOMURLDOMConstructor = JSDOMConstructor<JSDOMURL>;
static const HashTableValue JSDOMURLConstructorTableValues[] = {
{ "createObjectURL"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsDOMURLConstructorFunction_createObjectURL, 1 } },
{ "revokeObjectURL"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsDOMURLConstructorFunction_revokeObjectURL, 1 } },
{ "canParse"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsDOMURLConstructorFunction_canParse, 2 } },
{ "canParse"_s, static_cast<unsigned>(JSC::PropertyAttribute::Function), NoIntrinsic, { HashTableValue::NativeFunctionType, jsDOMURLConstructorFunction_canParse, 1 } },
};

static inline JSC::EncodedJSValue constructJSDOMURL1(JSGlobalObject* lexicalGlobalObject, CallFrame* callFrame)
Expand Down
4 changes: 4 additions & 0 deletions test/js/web/url/url.test.ts
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -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);
});
});
});

0 comments on commit 9ecb691

Please sign in to comment.