diff options
author | 迷渡 <justjavac@gmail.com> | 2019-06-10 19:20:59 +0800 |
---|---|---|
committer | Ryan Dahl <ry@tinyclouds.org> | 2019-06-10 07:20:59 -0400 |
commit | 5871d22d9b1f99a4735ff7b4e2dcca977795aa74 (patch) | |
tree | 4eeb9dabb651058cddb4bc4cd30aee043ff0dfee /js/url_search_params_test.ts | |
parent | a115340288d974f141cceb16faac71914402c445 (diff) |
check `URLSearchParams.constructor`'s params (#2488)
Diffstat (limited to 'js/url_search_params_test.ts')
-rw-r--r-- | js/url_search_params_test.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/js/url_search_params_test.ts b/js/url_search_params_test.ts index 0bce1166c..d37b55497 100644 --- a/js/url_search_params_test.ts +++ b/js/url_search_params_test.ts @@ -147,6 +147,19 @@ test(function urlSearchParamsShouldThrowTypeError(): void { } assertEquals(hasThrown, 2); + + try { + new URLSearchParams([["1", "2", "3"]]); + hasThrown = 1; + } catch (err) { + if (err instanceof TypeError) { + hasThrown = 2; + } else { + hasThrown = 3; + } + } + + assertEquals(hasThrown, 2); }); test(function urlSearchParamsAppendArgumentsCheck(): void { |