-
Notifications
You must be signed in to change notification settings - Fork 162
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should namespace objects have "length" and "name" own properties? #949
Comments
They should not. This is due to incorrect implementations of them as functions instead of namespace objects. You could also test that typeof x === "object" (not "function"). |
It appears to be a bit more nuanced. On Chrome 88, |
I was testing in Chrome 87. In Chrome Canary, I see that Regardless, sounds like we should have tests for each of the namespace objects to ensure they're objects, not functions. Checking that they don't have |
Turns out idlharness.js tests this. In https://wpt.fyi/results/css/cssom/idlharness.html?label=experimental&label=master&aligned, the 'CSS namespace: typeof is "object"' test fails in Safari. I'll file bugs. |
OK, I've filed https://bugs.webkit.org/show_bug.cgi?id=220855. |
Yes, the change was intentional. https://chromium-review.googlesource.com/c/chromium/src/+/2434404 is the patch to make CSS an IDL namespace. |
I think Gecko does have a bug here, filed https://bugzilla.mozilla.org/show_bug.cgi?id=1688335 |
Thanks for confirming @yuki3, I didn't think to check if And thanks @saschanaz for filing that Gecko bug, I forgot about |
I can't find anything in https://heycam.github.io/webidl/#namespace-object to suggest that a namespace object should have
length
orname
properties, but looking at namespace objects in implementations the results are mixed:CSS.length
is 0 andCSS.name
is "CSS" in Chrome, Firefox and Safariconsole.length
is 0 andconsole.name
is "console" in Firefox, but both are undefined in Chrome and SafariWebAssembly.length
andWebAssembly.name
are undefined in Chrome, Firefox and SafariI don't think this has caused any problems, but it could be a future nuisance making it harder to introduce a new namespace which has a
name
member. (Wanting alength
member seems less likely.)With confirmation that these shouldn't be there, I could add negative tests for it.
The text was updated successfully, but these errors were encountered: