TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
Reported by
ambar....@gmail.com,
May 20 2017
|
||
Issue description
Chrome Version : "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.96 Safari/537.36"
URLs (if applicable) :
Other browsers tested:
Add OK or FAIL, along with the version, after other browsers where you
have tested this issue:
Safari: OK
Firefox: FAIL
IE:
What steps will reproduce the problem?
const foo = {fetch}
foo.fetch('/')
What is the expected result?
calls fetch
What happens instead?
TypeError: Failed to execute 'fetch' on 'Window': Illegal invocation
Please provide any additional information below. Attach a screenshot if
possible.
,
May 26 2017
This is working-as-intended I think. You cannot call a function implemented by Window with another object (fetch needs "this" to be set to the window object).
So this should work:
const foo = {fetch: fetch.bind(window)}
foo.fetch('/')
|
||
►
Sign in to add a comment |
||
Comment 1 by ricea@chromium.org
, May 26 2017Status: Untriaged (was: Unconfirmed)