turn super references into a this expression - fixes babel/babel-eslint#10

This commit is contained in:
Sebastian McKenzie 2015-02-28 17:37:12 +11:00
parent e08a0fab99
commit 02f4f5e885
2 changed files with 6 additions and 2 deletions

View File

@ -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

View File

@ -1,6 +1,6 @@
{
"name": "babel-eslint",
"version": "1.0.11",
"version": "1.0.12",
"description": "",
"main": "index.js",
"repository": {