Skip to content

Commit

Permalink
Remove or= from variable initialization
Browse files Browse the repository at this point in the history
The original code created a local variable `head` and assigned
it to either `...getElementsByTagName('head')[0]` or to
`document.documentElement`.

The new code fails to compile, because a variable named `head`
does not exist in scope.
  • Loading branch information
mrhmouse committed Apr 8, 2016
1 parent fec8206 commit f8225f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/jsonp.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ JSONP = (options = {}) ->
script.onload = script.onreadystatechange = null
script.parentNode?.removeChild script
script = null
head or= window.document.getElementsByTagName('head')[0] or window.document.documentElement
head = window.document.getElementsByTagName('head')[0] or window.document.documentElement
# (see jQuery bugs #2709 and #4378)
head.insertBefore script, head.firstChild

Expand Down

0 comments on commit f8225f7

Please sign in to comment.