turn super references into a this expression - fixes babel/babel-eslint#10
This commit is contained in:
parent
e08a0fab99
commit
02f4f5e885
@ -25,7 +25,7 @@ function isCompatTag(tagName) {
|
||||
|
||||
var astTransformVisitor = {
|
||||
noScope: true,
|
||||
enter: function (node) {
|
||||
enter: function (node, parent) {
|
||||
if (t.isSpreadProperty(node)) {
|
||||
node.type = "Property";
|
||||
node.kind = "init";
|
||||
@ -46,6 +46,10 @@ var astTransformVisitor = {
|
||||
}
|
||||
|
||||
// classes
|
||||
|
||||
if (t.isReferencedIdentifier(node, parent, { name: "super" })) {
|
||||
return t.inherits(t.thisExpression(), node);
|
||||
}
|
||||
|
||||
if (t.isClassProperty(node)) {
|
||||
// eslint doesn't like these
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "babel-eslint",
|
||||
"version": "1.0.11",
|
||||
"version": "1.0.12",
|
||||
"description": "",
|
||||
"main": "index.js",
|
||||
"repository": {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user