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

Issue 29723558: Issue 6482 - Use ES6 classes (Closed)

Created:
March 15, 2018, 7:46 a.m. by Manish Jethani
Modified:
March 18, 2019, 5:15 a.m.
Reviewers:
Sebastian Noack
CC:
kzar
Base URL:
https://hg.adblockplus.org/adblockpluschrome/
Visibility:
Public.

Description

Issue 6482 - Use ES6 classes

Patch Set 1 #

Total comments: 7
Unified diffs Side-by-side diffs Delta from patch set Stats (+160 lines, -135 lines) Patch
M ext/background.js View 9 chunks +62 lines, -42 lines 3 comments Download
M ext/common.js View 1 chunk +10 lines, -6 lines 0 comments Download
M include.preload.js View 8 chunks +42 lines, -38 lines 1 comment Download
M lib/compat.js View 1 chunk +4 lines, -8 lines 1 comment Download
M lib/filterValidation.js View 2 chunks +31 lines, -29 lines 2 comments Download
M lib/messaging.js View 3 chunks +11 lines, -12 lines 0 comments Download

Messages

Total messages: 2
Manish Jethani
March 15, 2018, 7:46 a.m. (2018-03-15 07:46:16 UTC) #1
Manish Jethani
March 15, 2018, 7:54 a.m. (2018-03-15 07:54:11 UTC) #2
Patch Set 1

https://codereview.adblockplus.org/29723558/diff/29723559/ext/background.js
File ext/background.js (right):

https://codereview.adblockplus.org/29723558/diff/29723559/ext/background.js#n...
ext/background.js:37: 
I think it's better with a blank line between the methods but let me know if you
disagree.

https://codereview.adblockplus.org/29723558/diff/29723559/ext/background.js#n...
ext/background.js:69: };
Note that this is a class expression so it ends in a semicolon (similar to
function expression).

https://codereview.adblockplus.org/29723558/diff/29723559/ext/background.js#n...
ext/background.js:115: ext.getPage = id => new ext.Page({id: parseInt(id, 10)});
There was no real need for the local PageMap variable so I removed it, instead
we use ext.PageMap directly.

https://codereview.adblockplus.org/29723558/diff/29723559/include.preload.js
File include.preload.js (right):

https://codereview.adblockplus.org/29723558/diff/29723559/include.preload.js#...
include.preload.js:38: const selectorGroupSize = 1024;
There's no reason for this to be a member of ElemHide actually, it's a global
constant.

https://codereview.adblockplus.org/29723558/diff/29723559/lib/compat.js
File lib/compat.js (left):

https://codereview.adblockplus.org/29723558/diff/29723559/lib/compat.js#oldco...
lib/compat.js:94: delay: 0,
These are being assigned in the constructor (always) so there's no need for them
to live on the prototype.

https://codereview.adblockplus.org/29723558/diff/29723559/lib/filterValidatio...
File lib/filterValidation.js (left):

https://codereview.adblockplus.org/29723558/diff/29723559/lib/filterValidatio...
lib/filterValidation.js:31: *
See http://usejsdoc.org/howto-es2015-classes.html

We move the constructor-specific documentation to the constructor and get rid of
the @constructor tag.

https://codereview.adblockplus.org/29723558/diff/29723559/lib/filterValidatio...
lib/filterValidation.js:64: lineno: null,
Again, there's no real need for this to live on the prototype, it can just be
assigned in the constructor.

Powered by Google App Engine
This is Rietveld