diff options
author | 2022-03-30 20:50:19 -0700 | |
---|---|---|
committer | 2022-03-30 20:50:19 -0700 | |
commit | 1f77f2102e3021caa5563e00b5e9842497378837 (patch) | |
tree | 46796f4316de00a8b086830e2823c9734d4dcca8 | |
parent | ab7183217a33323c991ab5c3b04caec32954d9ee (diff) | |
download | bun-1f77f2102e3021caa5563e00b5e9842497378837.tar.gz bun-1f77f2102e3021caa5563e00b5e9842497378837.tar.zst bun-1f77f2102e3021caa5563e00b5e9842497378837.zip |
Update bindings.cpp
-rw-r--r-- | src/javascript/jsc/bindings/bindings.cpp | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/javascript/jsc/bindings/bindings.cpp b/src/javascript/jsc/bindings/bindings.cpp index a91f4ff95..3f5486c5f 100644 --- a/src/javascript/jsc/bindings/bindings.cpp +++ b/src/javascript/jsc/bindings/bindings.cpp @@ -48,8 +48,32 @@ #include "wtf/text/StringView.h" #include "wtf/text/WTFString.h" +#include "DOMURL.h" +#include "JSDOMURL.h" + extern "C" { +WebCore__DOMURL* WebCore__DOMURL__cast(JSC__JSValue JSValue0) +{ + auto* jsdomURL = JSC::jsCast<WebCore::JSDOMURL*>(JSC::JSValue::decode(JSValue0)); + if (jsdomURL == nullptr) { + return nullptr; + } + + return &jsdomURL->wrapped(); +} +void WebCore__DOMURL__href_(WebCore__DOMURL* domURL, ZigString* arg1) +{ + const WTF::URL& href = domURL->href(); + *arg1 = Zig::toZigString(href.string()); +} +void WebCore__DOMURL__pathname_(WebCore__DOMURL* domURL, ZigString* arg1) +{ + const WTF::URL& href = domURL->href(); + const WTF::StringView& pathname = href.path(); + *arg1 = Zig::toZigString(pathname); +} + JSC__JSValue SystemError__toErrorInstance(const SystemError* arg0, JSC__JSGlobalObject* globalObject) { |