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 = {
|
var astTransformVisitor = {
|
||||||
noScope: true,
|
noScope: true,
|
||||||
enter: function (node) {
|
enter: function (node, parent) {
|
||||||
if (t.isSpreadProperty(node)) {
|
if (t.isSpreadProperty(node)) {
|
||||||
node.type = "Property";
|
node.type = "Property";
|
||||||
node.kind = "init";
|
node.kind = "init";
|
||||||
@ -47,6 +47,10 @@ var astTransformVisitor = {
|
|||||||
|
|
||||||
// classes
|
// classes
|
||||||
|
|
||||||
|
if (t.isReferencedIdentifier(node, parent, { name: "super" })) {
|
||||||
|
return t.inherits(t.thisExpression(), node);
|
||||||
|
}
|
||||||
|
|
||||||
if (t.isClassProperty(node)) {
|
if (t.isClassProperty(node)) {
|
||||||
// eslint doesn't like these
|
// eslint doesn't like these
|
||||||
this.remove();
|
this.remove();
|
||||||
|
|||||||
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "babel-eslint",
|
"name": "babel-eslint",
|
||||||
"version": "1.0.11",
|
"version": "1.0.12",
|
||||||
"description": "",
|
"description": "",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user