aboutsummaryrefslogtreecommitdiff
path: root/src/javascript/jsc/bindings/ZigGlobalObject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/javascript/jsc/bindings/ZigGlobalObject.cpp')
-rw-r--r--src/javascript/jsc/bindings/ZigGlobalObject.cpp10
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();
}