Skip to content
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 new Headers(undefined) throw? #185

Closed
wheresrhys opened this issue Dec 17, 2015 · 5 comments
Closed

Should new Headers(undefined) throw? #185

wheresrhys opened this issue Dec 17, 2015 · 5 comments

Comments

@wheresrhys
Copy link

On reading the spec I'm not clear if this is a bug in Chrome or not

new Headers(undefined)
VM440:2 Uncaught TypeError: Failed to construct 'Headers': No matching constructor signature.(…)(anonymous function) @ VM440:2InjectedScript._evaluateOn @ VM363:875InjectedScript._evaluateAndWrap @ VM363:808InjectedScript.evaluate @ VM363:664
new Headers()
Headers {}

The spec says

The Headers(init) constructor, when invoked ... If init is given, fill headers with init.

Before I raise a Chrome bug could someone clarify if the above behaviour is compliant with the spec. Should passing undefined to Headers() qualify as 'init is given'?

@wheresrhys wheresrhys changed the title Should Headers(undefined) throw? Should new Headers(undefined) throw? Dec 17, 2015
@domenic
Copy link
Member

domenic commented Dec 17, 2015

Headers(undefined) is the same as Headers(), so yes, it should throw.

@domenic
Copy link
Member

domenic commented Dec 17, 2015

Er, I meant should not.

This may be fixed in Canary BTW.

@wheresrhys
Copy link
Author

ok, I'll try it out

@wheresrhys
Copy link
Author

No, still broken. Have raised an issue

@annevk
Copy link
Member

annevk commented Dec 18, 2015

You filed a duplicate of https://code.google.com/p/chromium/issues/detail?id=335871. Next time you might want to test in Firefox too, it's usually more correct when it comes to IDL.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

3 participants