11cb0ef41Sopenharmony_ci'use strict'; 21cb0ef41Sopenharmony_ci 31cb0ef41Sopenharmony_cirequire('../common'); 41cb0ef41Sopenharmony_ci 51cb0ef41Sopenharmony_ciconst { URL } = require('url'); 61cb0ef41Sopenharmony_ciconst assert = require('assert'); 71cb0ef41Sopenharmony_ci 81cb0ef41Sopenharmony_ci[ 91cb0ef41Sopenharmony_ci 'toString', 101cb0ef41Sopenharmony_ci 'toJSON', 111cb0ef41Sopenharmony_ci].forEach((i) => { 121cb0ef41Sopenharmony_ci assert.throws(() => Reflect.apply(URL.prototype[i], [], {}), { 131cb0ef41Sopenharmony_ci code: 'ERR_INVALID_THIS', 141cb0ef41Sopenharmony_ci }); 151cb0ef41Sopenharmony_ci}); 161cb0ef41Sopenharmony_ci 171cb0ef41Sopenharmony_ci[ 181cb0ef41Sopenharmony_ci 'href', 191cb0ef41Sopenharmony_ci 'protocol', 201cb0ef41Sopenharmony_ci 'username', 211cb0ef41Sopenharmony_ci 'password', 221cb0ef41Sopenharmony_ci 'host', 231cb0ef41Sopenharmony_ci 'hostname', 241cb0ef41Sopenharmony_ci 'port', 251cb0ef41Sopenharmony_ci 'pathname', 261cb0ef41Sopenharmony_ci 'search', 271cb0ef41Sopenharmony_ci 'hash', 281cb0ef41Sopenharmony_ci].forEach((i) => { 291cb0ef41Sopenharmony_ci assert.throws(() => Reflect.get(URL.prototype, i, {}), { 301cb0ef41Sopenharmony_ci code: 'ERR_INVALID_THIS', 311cb0ef41Sopenharmony_ci }); 321cb0ef41Sopenharmony_ci 331cb0ef41Sopenharmony_ci assert.throws(() => Reflect.set(URL.prototype, i, null, {}), { 341cb0ef41Sopenharmony_ci code: 'ERR_INVALID_THIS', 351cb0ef41Sopenharmony_ci }); 361cb0ef41Sopenharmony_ci}); 371cb0ef41Sopenharmony_ci 381cb0ef41Sopenharmony_ci[ 391cb0ef41Sopenharmony_ci 'origin', 401cb0ef41Sopenharmony_ci 'searchParams', 411cb0ef41Sopenharmony_ci].forEach((i) => { 421cb0ef41Sopenharmony_ci assert.throws(() => Reflect.get(URL.prototype, i, {}), { 431cb0ef41Sopenharmony_ci code: 'ERR_INVALID_THIS', 441cb0ef41Sopenharmony_ci }); 451cb0ef41Sopenharmony_ci}); 46