From 2e1e954eac00c69c76a6fbbcc343a82516275ca2 Mon Sep 17 00:00:00 2001 From: janekptacijarabaci Date: Thu, 10 Aug 2017 17:47:40 +0200 Subject: JS - URL - add toJSON support --- dom/url/URL.h | 6 ++++++ dom/url/tests/test_url.html | 6 ++++++ dom/webidl/URL.webidl | 5 ++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/dom/url/URL.h b/dom/url/URL.h index 16b4678ba..45e4dd289 100644 --- a/dom/url/URL.h +++ b/dom/url/URL.h @@ -155,6 +155,12 @@ public: GetHref(aRetval, aRv); } + void + ToJSON(nsAString& aResult, ErrorResult& aRv) const + { + GetHref(aResult, aRv); + } + // URLSearchParamsObserver void URLSearchParamsUpdated(URLSearchParams* aSearchParams) override; diff --git a/dom/url/tests/test_url.html b/dom/url/tests/test_url.html index 3f3f727d6..d07a752bb 100644 --- a/dom/url/tests/test_url.html +++ b/dom/url/tests/test_url.html @@ -438,5 +438,11 @@ url = new URL("data:text/html,Link"); is(url.href, "data:text/html,Link"); + + diff --git a/dom/webidl/URL.webidl b/dom/webidl/URL.webidl index 0baa9913c..4d491e1b3 100644 --- a/dom/webidl/URL.webidl +++ b/dom/webidl/URL.webidl @@ -44,9 +44,12 @@ interface URL { attribute USVString pathname; [Throws] attribute USVString search; - readonly attribute URLSearchParams searchParams; + [SameObject] readonly attribute URLSearchParams searchParams; [Throws] attribute USVString hash; + + [Throws] + USVString toJSON(); }; partial interface URL { -- cgit v1.2.3