Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Issue 29349737: Issue 1727 - Fix WebSocket constructor without second argument in Chrome 47 (Closed)

Created:
Aug. 11, 2016, 2:12 p.m. by Sebastian Noack
Modified:
Aug. 15, 2016, 1:06 p.m.
Reviewers:
kzar, Wladimir Palant
Visibility:
Public.

Description

Issue 1727 - Fix WebSocket constructor without second argument in Chrome 47

Patch Set 1 #

Total comments: 6

Patch Set 2 : Rebased #

Patch Set 3 : Don't use Array.push #

Patch Set 4 : Just default to empty array #

Patch Set 5 : Omit the second argument if absent #

Total comments: 4
Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -1 line) Patch
M include.preload.js View 1 2 3 4 1 chunk +5 lines, -1 line 4 comments Download

Messages

Total messages: 12
Sebastian Noack
Aug. 11, 2016, 2:12 p.m. (2016-08-11 14:12:52 UTC) #1
kzar
https://codereview.adblockplus.org/29349737/diff/29349738/include.preload.js File include.preload.js (right): https://codereview.adblockplus.org/29349737/diff/29349738/include.preload.js#newcode400 include.preload.js:400: var args = [null]; I think this approach is ...
Aug. 11, 2016, 2:25 p.m. (2016-08-11 14:25:05 UTC) #2
Sebastian Noack
https://codereview.adblockplus.org/29349737/diff/29349738/include.preload.js File include.preload.js (right): https://codereview.adblockplus.org/29349737/diff/29349738/include.preload.js#newcode400 include.preload.js:400: var args = [null]; On 2016/08/11 14:25:05, kzar wrote: ...
Aug. 11, 2016, 2:38 p.m. (2016-08-11 14:38:46 UTC) #3
kzar
https://codereview.adblockplus.org/29349737/diff/29349738/include.preload.js File include.preload.js (right): https://codereview.adblockplus.org/29349737/diff/29349738/include.preload.js#newcode400 include.preload.js:400: var args = [null]; On 2016/08/11 14:38:46, Sebastian Noack ...
Aug. 11, 2016, 2:54 p.m. (2016-08-11 14:54:16 UTC) #4
Sebastian Noack
https://codereview.adblockplus.org/29349737/diff/29349738/include.preload.js File include.preload.js (right): https://codereview.adblockplus.org/29349737/diff/29349738/include.preload.js#newcode400 include.preload.js:400: var args = [null]; On 2016/08/11 14:54:16, kzar wrote: ...
Aug. 11, 2016, 3:11 p.m. (2016-08-11 15:11:36 UTC) #5
kzar
LGTM
Aug. 11, 2016, 3:27 p.m. (2016-08-11 15:27:15 UTC) #6
Sebastian Noack
It's actually not that simple. Not all false-ish values are supposed to be interpreted as ...
Aug. 11, 2016, 3:40 p.m. (2016-08-11 15:40:49 UTC) #7
kzar
LGTM
Aug. 11, 2016, 3:44 p.m. (2016-08-11 15:44:12 UTC) #8
Wladimir Palant
https://codereview.adblockplus.org/29349737/diff/29349752/include.preload.js File include.preload.js (right): https://codereview.adblockplus.org/29349737/diff/29349752/include.preload.js#newcode413 include.preload.js:413: websocket = new RealWebSocket(url, protocols); Why make assumptions about ...
Aug. 15, 2016, 12:33 p.m. (2016-08-15 12:33:24 UTC) #9
Wladimir Palant
https://codereview.adblockplus.org/29349737/diff/29349752/include.preload.js File include.preload.js (right): https://codereview.adblockplus.org/29349737/diff/29349752/include.preload.js#newcode413 include.preload.js:413: websocket = new RealWebSocket(url, protocols); On 2016/08/15 12:33:24, Wladimir ...
Aug. 15, 2016, 12:45 p.m. (2016-08-15 12:45:36 UTC) #10
Wladimir Palant
https://codereview.adblockplus.org/29349737/diff/29349752/include.preload.js File include.preload.js (right): https://codereview.adblockplus.org/29349737/diff/29349752/include.preload.js#newcode413 include.preload.js:413: websocket = new RealWebSocket(url, protocols); Never mind, calling RealWebSocket.apply() ...
Aug. 15, 2016, 1:01 p.m. (2016-08-15 13:01:24 UTC) #11
Sebastian Noack
Aug. 15, 2016, 1:06 p.m. (2016-08-15 13:06:10 UTC) #12
Message was sent while issue was closed.
https://codereview.adblockplus.org/29349737/diff/29349752/include.preload.js
File include.preload.js (right):

https://codereview.adblockplus.org/29349737/diff/29349752/include.preload.js#...
include.preload.js:413: websocket = new RealWebSocket(url, protocols);
On 2016/08/15 13:01:24, Wladimir Palant wrote:
> Never mind, calling RealWebSocket.apply() won't work no matter what you pass
in
> - detecting function call vs. new there doesn't work by checking this pointer.
> So avoiding assumptions about parameters here requires spread operator which
> sadly isn't supported before Chrome 46 or Safari 7.1, not worth it.

See patchset #2 (and the related discussin) for a compatible way to pass
variable arguments.

Powered by Google App Engine
This is Rietveld