MCPcopy Index your code
hub / github.com/ampproject/amphtml / subClass

Function subClass

src/polyfills/custom-elements.js:796–808  ·  view source on GitHub ↗

* Setups up prototype inheritance * * @param {!SUPER} superClass * @param {!SUB} subClass * @template SUPER * @template SUB

(superClass, subClass)

Source from the content-addressed store, hash-verified

794 * @template SUB
795 */
796function subClass(superClass, subClass) {
797 // Object.getOwnPropertyDescriptor(superClass.prototype, 'constructor')
798 // {value: ƒ, writable: true, enumerable: false, configurable: true}
799 subClass.prototype = Object.create(superClass.prototype, {
800 constructor: {
801 // enumerable: false,
802 configurable: true,
803 writable: true,
804 value: subClass,
805 },
806 });
807 setPrototypeOf(subClass, superClass);
808}
809
810/**
811 * Tests whether setting '__proto__' will change the prototype chain of an

Callers 2

polyfillFunction · 0.85
wrapHTMLElementFunction · 0.85

Calls 2

setPrototypeOfFunction · 0.85
createMethod · 0.45

Tested by

no test coverage detected