Changes between Version 14 and Version 16 of Ticket #7296


Ignore:
Timestamp:
02/23/2019 08:57:01 AM (4 months ago)
Author:
mjethani
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7296

    • Property Status changed from new to reviewing
  • Ticket #7296 – Description

    v14 v16  
    1010 
    1111=== What to change === 
    12 Implement a function `parseURL()` that uses the above regular expression to extract the protocol and the hostname from a URL. It should return an object containing the properties `href`, `protocol`, and `hostname` and a `toString()` method that returns the value of the `href` property. `parseURL(url).toString() == new URL(url).toString()` should be `true`. 
     12Implement a function `parseURL()` that uses the above regular expression to extract the protocol and the hostname from a URL. It should return an object containing the properties `href`, `protocol`, and `hostname` and a `toString()` method that returns the value of the `href` property. 
     13 
     14For any `url` that is a canonicalized URL, all of the following should be `true`: 
     15 
     16* `parseURL(url).href === new URL(url).href` 
     17* `parseURL(url).protocol === new URL(url).protocol` 
     18* `parseURL(url).hostname === new URL(url).hostname` 
     19* `parseURL(url).toString() === new URL(url).toString()` 
    1320 
    1421For the tests, pick up some ideas [https://cs.chromium.org/chromium/src/url/gurl_unittest.cc?rcl=9ec7bc85e0f6a0bf28eff6b2eca678067da547e9 from Chromium]. Note however that `parseURL()` should expect an already canonicalized URL; accordingly, the tests should use only canonicalized URLs.