Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(195)

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

Can't Edit
Can't Publish+Mail
Start Review
Created:
2 years, 6 months ago by Wladimir Palant
Modified:
2 years, 6 months ago
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
2 years, 6 months ago (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 ...
2 years, 6 months ago (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 ...
2 years, 6 months ago (2017-03-12 08:16:18 UTC) #3
kzar
2 years, 6 months ago (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.
Sign in to reply to this message.

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld 87257f5