Index: lib/requestNotifier.js |
=================================================================== |
--- a/lib/requestNotifier.js |
+++ b/lib/requestNotifier.js |
@@ -28,19 +28,19 @@ let nodeData = new WeakMap(); |
let windowStats = new WeakMap(); |
let windowSelection = new WeakMap(); |
let setEntry, hasEntry, getEntry; |
if (false) |
{ |
// This branch can be enabled again once all of bug 673468, bug 819131 and |
// bug 982561 are fixed and we can use weak maps. |
- setEntry = function(map, key, value) map.set(key, value); |
- hasEntry = function(map, key) map.has(key); |
- getEntry = function(map, key) map.get(key); |
+ setEntry = (map, key, value) => map.set(key, value); |
+ hasEntry = (map, key) => map.has(key); |
+ getEntry = (map, key) => map.get(key); |
} |
else |
{ |
// Fall back to user data |
let dataSeed = Math.random(); |
let nodeDataProp = "abpNodeData" + dataSeed; |
let windowStatsProp = "abpWindowStats" + dataSeed; |
let windowSelectionProp = "abpWindowSelection" + dataSeed; |
@@ -54,19 +54,19 @@ else |
return windowStatsProp; |
case windowSelection: |
return windowSelectionProp; |
default: |
return null; |
} |
}; |
- setEntry = function(map, key, value) key.setUserData(getProp(map), value, null); |
- hasEntry = function(map, key) key.getUserData(getProp(map)); |
- getEntry = function(map, key) key.getUserData(getProp(map)) || undefined; |
+ setEntry = (map, key, value) => key.setUserData(getProp(map), value, null); |
+ hasEntry = (map, key) => key.getUserData(getProp(map)); |
+ getEntry = (map, key) => key.getUserData(getProp(map)) || undefined; |
} |
/** |
* List of notifiers in use - these notifiers need to receive notifications on |
* new requests. |
* @type RequestNotifier[] |
*/ |
let activeNotifiers = []; |
@@ -343,22 +343,28 @@ RequestEntry.prototype = |
* Filter that was applied to this request (if any) |
* @type Filter |
*/ |
filter: null, |
/** |
* String representation of the content type, e.g. "subdocument" |
* @type String |
*/ |
- get typeDescr() require("contentPolicy").Policy.typeDescr[this.type], |
+ get typeDescr() |
+ { |
+ return require("contentPolicy").Policy.typeDescr[this.type]; |
+ }, |
/** |
* User-visible localized representation of the content type, e.g. "frame" |
* @type String |
*/ |
- get localizedDescr() require("contentPolicy").Policy.localizedDescr[this.type], |
+ get localizedDescr() |
+ { |
+ return require("contentPolicy").Policy.localizedDescr[this.type]; |
+ }, |
/** |
* Attaches this request object to a DOM node. |
*/ |
attachToNode: function(/**Node*/ node) |
{ |
let existingData = getEntry(nodeData, node); |
if (typeof existingData == "undefined") |