diff options
author | 2022-03-27 02:42:02 -0700 | |
---|---|---|
committer | 2022-03-27 02:45:30 -0700 | |
commit | 309350e74cf0bf854c0148b627f6df8b5282ad2f (patch) | |
tree | e698660375ef137b1b16b06ba5c474fed18ce65b /src/javascript/jsc/bindings/ZigGlobalObject.cpp | |
parent | 0132b7164e956d56bf74dd8c45ad4cf90769961b (diff) | |
download | bun-309350e74cf0bf854c0148b627f6df8b5282ad2f.tar.gz bun-309350e74cf0bf854c0148b627f6df8b5282ad2f.tar.zst bun-309350e74cf0bf854c0148b627f6df8b5282ad2f.zip |
[bun.js] begin the webkit-ing
Diffstat (limited to 'src/javascript/jsc/bindings/ZigGlobalObject.cpp')
-rw-r--r-- | src/javascript/jsc/bindings/ZigGlobalObject.cpp | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/javascript/jsc/bindings/ZigGlobalObject.cpp b/src/javascript/jsc/bindings/ZigGlobalObject.cpp index ad1c23da5..fd43fcaeb 100644 --- a/src/javascript/jsc/bindings/ZigGlobalObject.cpp +++ b/src/javascript/jsc/bindings/ZigGlobalObject.cpp @@ -75,6 +75,8 @@ #include "ZigSourceProvider.h" +#include "JSDOMURL.h" + using JSGlobalObject = JSC::JSGlobalObject; using Exception = JSC::Exception; using JSValue = JSC::JSValue; @@ -699,6 +701,14 @@ void GlobalObject::installAPIGlobals(JSClassRef* globals, int count) JSC::CustomGetterSetter::create(vm(), property_lazyProcessGetter, property_lazyProcessSetter), PropertyAttribute::DontDelete | JSC::PropertyAttribute::CustomAccessor | 0); + auto domURL = WebCore::DOMURL::create("https://example.com/"_s, WTF::String()); + auto url = WebCore::JSDOMURL::create( + WebCore::JSDOMURL::createStructure(vm(), this, objectPrototype()), + this, + domURL.returnValue().get()); + + this->putDirect(vm(), clientData->builtinNames().urlPublicName(), JSC::JSValue(url), JSC::PropertyAttribute::DontDelete | 0); + extraStaticGlobals.releaseBuffer(); } |