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

Issue 29379570: Issue 4968 - Fix messageResponder syntax, declaring functions inside a block not allowed in strict … (Closed)

Created:
March 9, 2017, 11:14 a.m. by Wladimir Palant
Modified:
March 13, 2017, 1:45 p.m.
Reviewers:
kzar
CC:
Thomas Greiner
Base URL:
https://hg.adblockplus.org/adblockplusui
Visibility:
Public.

Description

Note that in order to get the current first-run page working in Firefoxthis change is not sufficient. Messaging semantics have to be adjusted in the adblockplus repository as well because current code expects messageResponder to use onMessage callbacks.

Patch Set 1 #

Total comments: 3
Unified diffs Side-by-side diffs Delta from patch set Stats (+3 lines, -2 lines) Patch
M messageResponder.js View 2 chunks +3 lines, -2 lines 3 comments Download

Messages

Total messages: 4
Wladimir Palant
March 9, 2017, 11:14 a.m. (2017-03-09 11:14:16 UTC) #1
kzar
https://codereview.adblockplus.org/29379570/diff/29379571/messageResponder.js File messageResponder.js (right): https://codereview.adblockplus.org/29379570/diff/29379571/messageResponder.js#newcode20 messageResponder.js:20: (function(global) Why pass `this` as the `global` instead of ...
March 10, 2017, 1:42 p.m. (2017-03-10 13:42:33 UTC) #2
Wladimir Palant
https://codereview.adblockplus.org/29379570/diff/29379571/messageResponder.js File messageResponder.js (right): https://codereview.adblockplus.org/29379570/diff/29379571/messageResponder.js#newcode20 messageResponder.js:20: (function(global) On 2017/03/10 13:42:33, kzar wrote: > Why pass ...
March 12, 2017, 8:16 a.m. (2017-03-12 08:16:18 UTC) #3
kzar
March 13, 2017, 7:47 a.m. (2017-03-13 07:47:24 UTC) #4
LGTM

https://codereview.adblockplus.org/29379570/diff/29379571/messageResponder.js
File messageResponder.js (right):

https://codereview.adblockplus.org/29379570/diff/29379571/messageResponder.js...
messageResponder.js:20: (function(global)
On 2017/03/12 08:16:18, Wladimir Palant wrote:
> On 2017/03/10 13:42:33, kzar wrote:
> > Why pass `this` as the `global` instead of referring to `window` directly?
> 
> Because that's assumptions about the global object. In browser context the
> global object can be referred to via global window variable. In other contexts
> this variable doesn't exist. In particular, when this runs in Firefox window
> will be undefined.

Acknowledged.

Powered by Google App Engine
This is Rietveld