url: use private properties for brand check
Follow-up for the recommendation from @joyeecheung and @aduh95.
This pull request changes the error code from ERR_INVALID_THIS
to error name TypeError
. This is mostly done to improve the performance and reduce the branches while calling any getter of the URL class. Additionally, this pull request merges isURL
and isURLInstance
methods.
cc @nodejs/url @nodejs/performance