Fix class inheritance in IE10 (#7969)
* Revert "Move subclass inheritance to end (#7772)"
This reverts commit f8ab9466d3.
* Only use getPrototypeOf if setPrototypeOf is implemented
* Update fixtures
* Helpers updates
* Update fixtures
* Fall back to getPrototypeOf
* Update fixtures
This commit is contained in:
committed by
Henry Zhu
parent
ffe04d9195
commit
2af7a33c4e
@@ -179,7 +179,6 @@ export default function transformClass(
|
||||
}
|
||||
|
||||
pushDescriptors();
|
||||
pushInheritsToBody();
|
||||
}
|
||||
|
||||
function pushBody() {
|
||||
@@ -263,6 +262,8 @@ export default function transformClass(
|
||||
}
|
||||
|
||||
function pushDescriptors() {
|
||||
pushInheritsToBody();
|
||||
|
||||
const { body } = classState;
|
||||
|
||||
let instanceProps;
|
||||
@@ -572,6 +573,8 @@ export default function transformClass(
|
||||
}
|
||||
|
||||
classState.body.push(classState.construct);
|
||||
|
||||
pushInheritsToBody();
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -582,9 +585,9 @@ export default function transformClass(
|
||||
|
||||
setState({ pushedInherits: true });
|
||||
|
||||
// Push to ensure that the constructor inheritance is set up after
|
||||
// Unshift to ensure that the constructor inheritance is set up before
|
||||
// any properties can be assigned to the prototype.
|
||||
classState.body.push(
|
||||
classState.body.unshift(
|
||||
t.expressionStatement(
|
||||
t.callExpression(
|
||||
classState.file.addHelper(
|
||||
|
||||
Reference in New Issue
Block a user