aboutsummaryrefslogtreecommitdiff
path: root/src/new_fields/URLField.ts
diff options
context:
space:
mode:
authorHannah <hannah_chow@brown.edu>2020-02-11 06:34:19 -0500
committerHannah <hannah_chow@brown.edu>2020-02-11 06:34:19 -0500
commitb60154479add51f826afaeff074cf43a6b416831 (patch)
tree723f7f1356b1c3dcf5c409347b125d5a577b538f /src/new_fields/URLField.ts
parent74ca8ac01e32faa8adab54ddfd806fe46cda03ec (diff)
parentdc6453e27375a1b3d614a74b7fd1d83695f130d7 (diff)
merge
Diffstat (limited to 'src/new_fields/URLField.ts')
-rw-r--r--src/new_fields/URLField.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/new_fields/URLField.ts b/src/new_fields/URLField.ts
index 35ef6dd02..cfab36906 100644
--- a/src/new_fields/URLField.ts
+++ b/src/new_fields/URLField.ts
@@ -1,7 +1,7 @@
import { Deserializable } from "../client/util/SerializationHelper";
import { serializable, custom } from "serializr";
import { ObjectField } from "./ObjectField";
-import { ToScriptString, Copy } from "./FieldSymbols";
+import { ToScriptString, ToString, Copy } from "./FieldSymbols";
import { Scripting, scriptingGlobal } from "../client/util/Scripting";
function url() {
@@ -32,6 +32,9 @@ export abstract class URLField extends ObjectField {
[ToScriptString]() {
return `new ${this.constructor.name}("${this.url.href}")`;
}
+ [ToString]() {
+ return this.url.href;
+ }
[Copy](): this {
return new (this.constructor as any)(this.url);