11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_ci// Tests below are not from WPT. 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_cirequire('../common'); 61cb0ef41Sopenharmony_ciconst assert = require('assert'); 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ci{ 91cb0ef41Sopenharmony_ci const params = new URLSearchParams(); 101cb0ef41Sopenharmony_ci assert.throws(() => { 111cb0ef41Sopenharmony_ci params.getAll.call(undefined); 121cb0ef41Sopenharmony_ci }, { 131cb0ef41Sopenharmony_ci code: 'ERR_INVALID_THIS', 141cb0ef41Sopenharmony_ci name: 'TypeError', 151cb0ef41Sopenharmony_ci message: 'Value of "this" must be of type URLSearchParams' 161cb0ef41Sopenharmony_ci }); 171cb0ef41Sopenharmony_ci assert.throws(() => { 181cb0ef41Sopenharmony_ci params.getAll(); 191cb0ef41Sopenharmony_ci }, { 201cb0ef41Sopenharmony_ci code: 'ERR_MISSING_ARGS', 211cb0ef41Sopenharmony_ci name: 'TypeError', 221cb0ef41Sopenharmony_ci message: 'The "name" argument must be specified' 231cb0ef41Sopenharmony_ci }); 241cb0ef41Sopenharmony_ci 251cb0ef41Sopenharmony_ci const obj = { 261cb0ef41Sopenharmony_ci toString() { throw new Error('toString'); }, 271cb0ef41Sopenharmony_ci valueOf() { throw new Error('valueOf'); } 281cb0ef41Sopenharmony_ci }; 291cb0ef41Sopenharmony_ci const sym = Symbol(); 301cb0ef41Sopenharmony_ci assert.throws(() => params.getAll(obj), /^Error: toString$/); 311cb0ef41Sopenharmony_ci assert.throws(() => params.getAll(sym), 321cb0ef41Sopenharmony_ci /^TypeError: Cannot convert a Symbol value to a string$/); 331cb0ef41Sopenharmony_ci} 34