Implement server.url (#7043)

* Implement `server.url`

* Fix memory leak
This commit is contained in:
Ashcon Partovi
2023-11-10 23:00:27 -08:00
committed by GitHub
parent 01e0136d7c
commit f0cbc79d8b
13 changed files with 346 additions and 28 deletions

View File

@@ -510,6 +510,12 @@ pub const String = extern struct {
return BunString__toJSWithLength(globalObject, this, len);
}
pub fn toJSDOMURL(this: *String, globalObject: *bun.JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
return BunString__toJSDOMURL(globalObject, this);
}
pub fn toJSConst(this: *const String, globalObject: *bun.JSC.JSGlobalObject) JSC.JSValue {
JSC.markBinding(@src());
var a = this.*;
@@ -693,6 +699,7 @@ pub const String = extern struct {
extern fn BunString__fromJS(globalObject: *JSC.JSGlobalObject, value: bun.JSC.JSValue, out: *String) bool;
extern fn BunString__toJS(globalObject: *JSC.JSGlobalObject, in: *String) JSC.JSValue;
extern fn BunString__toJSWithLength(globalObject: *JSC.JSGlobalObject, in: *String, usize) JSC.JSValue;
extern fn BunString__toJSDOMURL(globalObject: *JSC.JSGlobalObject, in: *String) JSC.JSValue;
extern fn BunString__toWTFString(this: *String) void;
pub fn ref(this: String) void {