Index: extensions/renderer/resources/binding.js |
diff --git a/extensions/renderer/resources/binding.js b/extensions/renderer/resources/binding.js |
index 13ac7f960ccd89e28d61d7e52ca65baded2c8451..888dd0642f4c2520ef70ec73f6eaf02aff9b9d74 100644 |
--- a/extensions/renderer/resources/binding.js |
+++ b/extensions/renderer/resources/binding.js |
@@ -26,11 +26,15 @@ var sendRequest = sendRequestHandler.sendRequest; |
// modify their behaviour (such as a custom way to handle requests to the |
// API, a custom callback, etc). |
function APIFunctions(namespace) { |
- this.apiFunctions_ = {}; |
- this.unavailableApiFunctions_ = {}; |
+ this.apiFunctions_ = { __proto__: null }; |
+ this.unavailableApiFunctions_ = { __proto__: null }; |
this.namespace = namespace; |
} |
+APIFunctions.prototype = { |
+ __proto__: null, |
+}; |
+ |
APIFunctions.prototype.register = function(apiName, apiFunction) { |
this.apiFunctions_[apiName] = apiFunction; |
}; |
@@ -184,9 +188,13 @@ function Binding(apiName) { |
this.customHooks_ = []; |
}; |
-Binding.create = function(apiName) { |
- return new Binding(apiName); |
-}; |
+$Object.defineProperty(Binding, 'create', { |
+ __proto__: null, |
+ configurable: false, |
+ enumerable: false, |
+ value: function(apiName) { return new Binding(apiName); }, |
+ writable: false, |
+}); |
Binding.prototype = { |
// Sneaky workaround for Object.prototype getters/setters - our prototype |
@@ -376,12 +384,11 @@ Binding.prototype = { |
return; |
} |
- var apiFunction = {}; |
+ var apiFunction = { __proto__: null }; |
apiFunction.definition = functionDef; |
- var apiFunctionName = schema.namespace + '.' + functionDef.name; |
- apiFunction.name = apiFunctionName; |
+ apiFunction.name = schema.namespace + '.' + functionDef.name; |
- if (!GetAvailability(apiFunctionName).is_available || |
+ if (!GetAvailability(apiFunction.name).is_available || |
(checkUnprivileged && !isSchemaAccessAllowed(functionDef))) { |
this.apiFunctions_.registerUnavailable(functionDef.name); |
return; |