njs icon indicating copy to clipboard operation
njs copied to clipboard

URL native object.

Open xeioex opened this issue 6 years ago • 1 comments

Link.

xeioex avatar Apr 25 '19 12:04 xeioex

At least run-time support of #118 is required to do this properly:

> var u = new URL('text.txt', 'file:///')
undefined
> u
URL {
  href: 'file:///text.txt',
  origin: 'null',
  protocol: 'file:',
  username: '',
  password: '',
  host: '',
  hostname: '',
  port: '',
  pathname: '/text.txt',
  search: '',
  searchParams: URLSearchParams {},
  hash: '' }
> Object.getOwnPropertyNames(u)
[]
> Object.getOwnPropertyNames(Object.getPrototypeOf(u))
[ 'constructor',
  'toString',
  'href',
  'origin',
  'protocol',
  'username',
  'password',
  'host',
  'hostname',
  'port',
  'pathname',
  'search',
  'searchParams',
  'hash',
  'toJSON' ]
> Object.getOwnPropertyDescriptor(Object.getPrototypeOf(u), 'href')
{ get: [Function: get],
  set: [Function: set],
  enumerable: true,
  configurable: true }

drsm avatar Apr 25 '19 12:04 drsm