Skip to content

Commit

Permalink
turn super references into a this expression - fixes #10
Browse files Browse the repository at this point in the history
  • Loading branch information
sebmck committed Feb 28, 2015
1 parent ecf3637 commit 96c2602
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
6 changes: 5 additions & 1 deletion eslint/babel-eslint-parser/acorn-to-esprima.js
Expand Up @@ -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";
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion eslint/babel-eslint-parser/package.json
@@ -1,6 +1,6 @@
{
"name": "babel-eslint",
"version": "1.0.11",
"version": "1.0.12",
"description": "",
"main": "index.js",
"repository": {
Expand Down

0 comments on commit 96c2602

Please sign in to comment.