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

Issue 29417597: Issue 5161 - Use maps, sets, and null-prototype objects where appropriate

Can't Edit
Can't Publish+Mail
Start Review
Created:
1 week, 1 day ago by Manish Jethani
Modified:
6 days, 13 hours ago
Reviewers:
kzar
CC:
Sebastian Noack, Wladimir Palant
Base URL:
https://hg.adblockplus.org/adblockpluschrome/
Visibility:
Public.

Description

Use maps, sets, and null-prototype objects where appropriate The following changes have been made: - A number of instances of Object.create have been changed to use Map or Set objects instead - Object.create is being used instead of an object literal now in some cases - Some related optimizations, esp. in ext.PageMap In some cases the semantics have changed. For example, iteration is now guaranteed to be in insertion order. I have assumed that this won't break anything. There's also a utility function ext.mapIterable that lets you do the equivalent of Array.prototype.map on any iterable without having to create an array.

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+105 lines, -69 lines) Patch
M ext/background.js View 8 chunks +62 lines, -40 lines 0 comments Download
M ext/common.js View 1 chunk +18 lines, -0 lines 0 comments Download
M lib/devtools.js View 4 chunks +9 lines, -11 lines 0 comments Download
M lib/popupBlocker.js View 3 chunks +12 lines, -9 lines 0 comments Download
M lib/whitelisting.js View 2 chunks +3 lines, -3 lines 0 comments Download
M options.js View 1 chunk +1 line, -6 lines 0 comments Download

Messages

Total messages: 5
Manish Jethani
1 week, 1 day ago (2017-04-19 16:33:29 UTC) #1
Manish Jethani
Patch Set 1
1 week, 1 day ago (2017-04-19 16:46:07 UTC) #2
kzar
On 2017/04/19 16:46:07, Manish Jethani wrote: > Patch Set 1 Please could you file an ...
1 week ago (2017-04-20 06:51:48 UTC) #3
Manish Jethani
On 2017/04/20 06:51:48, kzar wrote: > Please could you file an issue for this? Filed ...
1 week ago (2017-04-20 15:41:27 UTC) #4
Manish Jethani
6 days, 13 hours ago (2017-04-21 12:51:19 UTC) #5
By the way, the mapIterable function could be implemented as a generator
function like so:

  function* mapIterable(iterable, callback, thisArg)
  {
    for (let item of iterable)
      yield callback.call(thisArg, item);
  }

I wasn't sure if we had a policy about using generator functions. I couldn't
find any in the source from a quick search. If we can, it would make it a lot
simpler. It looks like both Chrome and Firefox have had basic support for a
while.
Sign in to reply to this message.

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