Skip to content

Commit

Permalink
Merge pull request #119 from eslint/issue115
Browse files Browse the repository at this point in the history
New: Add Super node (fixes #115)
  • Loading branch information
nzakas committed Apr 4, 2015
2 parents 0193bfe + 461e762 commit a23b65d
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 81 deletions.
2 changes: 1 addition & 1 deletion espree.js
Original file line number Diff line number Diff line change
Expand Up @@ -2862,7 +2862,7 @@ function parsePrimaryExpression() {
if (allowSuper && matchKeyword("super") && state.inFunctionBody) {
marker = markerCreate();
lex();
return markerApply(marker, astNodeFactory.createIdentifier("super"));
return markerApply(marker, astNodeFactory.createSuper());
}

if (matchKeyword("this")) {
Expand Down
140 changes: 75 additions & 65 deletions lib/ast-node-factory.js

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions lib/ast-node-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ module.exports = {
ReturnStatement: "ReturnStatement",
SequenceExpression: "SequenceExpression",
SpreadElement: "SpreadElement",
Super: "Super",
SwitchCase: "SwitchCase",
SwitchStatement: "SwitchStatement",
TaggedTemplateExpression: "TaggedTemplateExpression",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,7 @@ module.exports = {
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "super",
"type": "Super",
"range": [
27,
32
Expand Down Expand Up @@ -221,4 +220,4 @@ module.exports = {
"column": 2
}
}
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,7 @@ module.exports = {
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "super",
"type": "Super",
"range": [
41,
46
Expand Down Expand Up @@ -224,4 +223,4 @@ module.exports = {
"column": 2
}
}
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,7 @@ module.exports = {
"expression": {
"type": "CallExpression",
"callee": {
"type": "Identifier",
"name": "super",
"type": "Super",
"range": [
21,
26
Expand Down Expand Up @@ -145,4 +144,4 @@ module.exports = {
"column": 2
}
}
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,7 @@ module.exports = {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "super",
"type": "Super",
"range": [
41,
46
Expand Down Expand Up @@ -260,4 +259,4 @@ module.exports = {
"column": 2
}
}
};
};
Original file line number Diff line number Diff line change
Expand Up @@ -34,8 +34,7 @@ module.exports = {
"type": "MemberExpression",
"computed": false,
"object": {
"type": "Identifier",
"name": "super",
"type": "Super",
"range": [
21,
26
Expand Down Expand Up @@ -181,4 +180,4 @@ module.exports = {
"column": 2
}
}
};
};

0 comments on commit a23b65d

Please sign in to comment.