[Pkg-mozext-commits] [adblock-plus] 58/87: Issue 3873 - Replace object literals using __proto__ with Object.create(null)

David Prévot taffit at moszumanska.debian.org
Sat Apr 30 17:59:08 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository adblock-plus.

commit a85338c0bfa7a715e25a5224fc53a502086555b0
Author: Sebastian Noack <sebastian at adblockplus.org>
Date:   Thu Mar 24 18:04:54 2016 +0100

    Issue 3873 - Replace object literals using __proto__ with Object.create(null)
---
 lib/filterClasses.js        | 3 ++-
 test/filterClasses.js       | 2 +-
 test/subscriptionClasses.js | 2 +-
 3 files changed, 4 insertions(+), 3 deletions(-)

diff --git a/lib/filterClasses.js b/lib/filterClasses.js
index 2f68235..5a8ac6d 100644
--- a/lib/filterClasses.js
+++ b/lib/filterClasses.js
@@ -383,7 +383,8 @@ ActiveFilter.prototype =
       if (list.length == 1 && list[0][0] != "~")
       {
         // Fast track for the common one-domain scenario
-        domains = {__proto__: null, "": false};
+        domains = Object.create(null);
+        domains[""] = false;
         if (this.ignoreTrailingDot)
           list[0] = list[0].replace(/\.+$/, "");
         domains[list[0]] = true;
diff --git a/test/filterClasses.js b/test/filterClasses.js
index 0ec40c1..a25d767 100644
--- a/test/filterClasses.js
+++ b/test/filterClasses.js
@@ -162,7 +162,7 @@ function compareFilter(test, text, expected, postInit)
   filter.serialize(buffer);
   if (buffer.length)
   {
-    let map = {__proto__: null};
+    let map = Object.create(null);
     for (let line of buffer.slice(1))
     {
       if (/(.*?)=(.*)/.test(line))
diff --git a/test/subscriptionClasses.js b/test/subscriptionClasses.js
index 9ac3bf5..16e7933 100644
--- a/test/subscriptionClasses.js
+++ b/test/subscriptionClasses.js
@@ -32,7 +32,7 @@ function compareSubscription(test, url, expected, postInit)
   subscription.serialize(result);
   test.equal(result.sort().join("\n"), expected.sort().join("\n"), url);
 
-  let map = {__proto__: null};
+  let map = Object.create(null);
   for (let line of result.slice(1))
   {
     if (/(.*?)=(.*)/.test(line))

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-mozext/adblock-plus.git



More information about the Pkg-mozext-commits mailing list