Skip to content

Commit

Permalink
Basic URL toJSON() test
Browse files Browse the repository at this point in the history
Standard discussion: whatwg/url#137.
  • Loading branch information
annevk authored Feb 8, 2017
1 parent 35f16a6 commit 02585db
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 0 deletions.
2 changes: 2 additions & 0 deletions url/interfaces.html
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ <h1>URL IDL tests</h1>
attribute USVString search;
readonly attribute URLSearchParams searchParams;
attribute USVString hash;

USVString toJSON();
};

[Constructor(optional (USVString or URLSearchParams) init = ""),
Expand Down
12 changes: 12 additions & 0 deletions url/url-tojson.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<!doctype html>
<meta charset=utf-8>
<title>URL's toJSON()</title>
<script src=/resources/testharness.js></script>
<script src=/resources/testharnessreport.js></script>
<div id=log></div>
<script>
test(() => {
const a = new URL("https://example.com/")
assert_equals(JSON.stringify(a), "\"https://example.com/\"")
})
</script>

0 comments on commit 02585db

Please sign in to comment.