| Summary: | [FF] Illegal constructor in URL-shim.js | ||
|---|---|---|---|
| Product: | [ECD] Orion | Reporter: | John Arthorne <john.arthorne> |
| Component: | Client | Assignee: | Simon Kaegi <simon_kaegi> |
| Status: | RESOLVED FIXED | QA Contact: | |
| Severity: | normal | ||
| Priority: | P3 | CC: | mamacdon, simon_kaegi |
| Version: | unspecified | ||
| Target Milestone: | 2.0 RC2 | ||
| Hardware: | PC | ||
| OS: | Windows 7 | ||
| Whiteboard: | |||
I guess we could remember the decision in localstorage... I guess we could try checking
> typeof window.URL === "function" && URL.length > 1
to decide whether the 2-argument URL constructor exists, before trying to invoke it. But I'm not sure if host object constructors like URL are guaranteed to have a meaningful "length" property so maybe this won't work.
Nice simple idea Mark. I've added "URL.length !== 0" to the check as I think that is the most conservative and matches the latest for both Chrome and FF. Incidentally, for IE10 typeof URL is "object" so this is caught earlier. Mark reviewed. |
Seen in I20130208-1010 on orion.eclipse org and orionode 0.0.12 from npm. Running Firefox 19.0 latest in beta channel. If I configure Firebug to halt on errors, it halts on URL-shim.js line 17: Illegal constructor. if (typeof window.URL === "function" && new window.URL("http://www.w3.org").protocol === "http:") { I don't know if this is a valid complaint, but it's annoying because it always halts on this when I'm trying to chase down an unrelated bug.