Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Unified Diff: extensions/renderer/resources/binding.js

Issue 1902003003: [Extensions] Have Binding inherit from null proto (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: extensions/renderer/resources/binding.js
diff --git a/extensions/renderer/resources/binding.js b/extensions/renderer/resources/binding.js
index 60d85a97afa38731403fb18afb2e0350f3b12598..4509f26c98632b0ea8b640f15e118fe9c9a4ea2f 100644
--- a/extensions/renderer/resources/binding.js
+++ b/extensions/renderer/resources/binding.js
@@ -179,7 +179,6 @@ var platform = getPlatform();
function Binding(apiName) {
this.apiName_ = apiName;
this.apiFunctions_ = new APIFunctions(apiName);
- this.customEvent_ = null;
this.customHooks_ = [];
};
@@ -188,6 +187,17 @@ Binding.create = function(apiName) {
};
Binding.prototype = {
+ // Sneaky workaround for Object.prototype getters/setters - our prototype
+ // isn't Object.prototype. SafeBuiltins (e.g. $Object.hasOwnProperty())
+ // should still work.
+ __proto__: null,
+
+ // Forward-declare properties.
+ apiName_: undefined,
+ apiFunctions_: undefined,
+ customEvent_: undefined,
+ customHooks_: undefined,
+
// The API through which the ${api_name}_custom_bindings.js files customize
// their API bindings beyond what can be generated.
//
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698