Skip to content

Commit

Permalink
Moves polyfill to avoid situation where superClass_ field gets overrw…
Browse files Browse the repository at this point in the history
…itten by parent.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=154925094
  • Loading branch information
tashawych authored and brad4d committed May 3, 2017
1 parent c661709 commit f5d74cf
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 32 deletions.
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/js/es6/util/inherits.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ $jscomp.inherits = function(childCtor, parentCtor) {
/** @constructor */
function tempCtor() {}
tempCtor.prototype = parentCtor.prototype;
childCtor.superClass_ = parentCtor.prototype;
childCtor.prototype = new tempCtor();
/** @override */
childCtor.prototype.constructor = childCtor;
Expand All @@ -69,5 +70,4 @@ $jscomp.inherits = function(childCtor, parentCtor) {
childCtor[p] = parentCtor[p];
}
}
childCtor.superClass_ = parentCtor.prototype;
};
2 changes: 1 addition & 1 deletion src/com/google/javascript/jscomp/resources.json

Large diffs are not rendered by default.

30 changes: 0 additions & 30 deletions test/com/google/javascript/jscomp/runtime_tests/superclass_test.js

This file was deleted.

0 comments on commit f5d74cf

Please sign in to comment.