Bug 1368170 - Remove unused Function.prototype.inherits methods. r=francois

These methods do not appear to be used.

When JSM global sharing is enabled, these methods contaminate the
global Function.prototype, which breaks Marionette object
serialization.

MozReview-Commit-ID: CAfJ2FCkhlK

--HG--
extra : rebase_source : 38acb4616ee14283d0f67e1b2144972c7d139f84
This commit is contained in:
Andrew McCreight 2017-05-26 13:46:10 -07:00
parent fa48a67c05
commit c11ddf3017
2 changed files with 0 additions and 38 deletions

View File

@ -48,35 +48,3 @@ this.BindToObject = function BindToObject(fn, self, opt_args) {
return newfn;
}
/**
* Inherit the prototype methods from one constructor into another.
*
* Usage:
*
* function ParentClass(a, b) { }
* ParentClass.prototype.foo = function(a) { }
*
* function ChildClass(a, b, c) {
* ParentClass.call(this, a, b);
* }
*
* ChildClass.inherits(ParentClass);
*
* var child = new ChildClass("a", "b", "see");
* child.foo(); // works
*
* In addition, a superclass' implementation of a method can be invoked
* as follows:
*
* ChildClass.prototype.foo = function(a) {
* ChildClass.superClass_.foo.call(this, a);
* // other code
* };
*/
Function.prototype.inherits = function(parentCtor) {
var tempCtor = function(){};
tempCtor.prototype = parentCtor.prototype;
this.superClass_ = parentCtor.prototype;
this.prototype = new tempCtor();
}

View File

@ -14,12 +14,6 @@ function Init() {
// Pull the library in.
var jslib = Cc["@mozilla.org/url-classifier/jslib;1"]
.getService().wrappedJSObject;
Function.prototype.inherits = function(parentCtor) {
var tempCtor = function(){};
tempCtor.prototype = parentCtor.prototype;
this.superClass_ = parentCtor.prototype;
this.prototype = new tempCtor();
},
modScope.G_Preferences = jslib.G_Preferences;
modScope.G_PreferenceObserver = jslib.G_PreferenceObserver;
modScope.G_ObserverServiceObserver = jslib.G_ObserverServiceObserver;