Skip to content

Commit 4368788

Browse files
authored
feat: Add parser name (#562)
* feat: Add parser name * Fix lint error
1 parent fe89a66 commit 4368788

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

espree.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,7 @@ export function parse(code, options) {
139139
//------------------------------------------------------------------------------
140140

141141
export const version = espreeVersion;
142+
export const name = "espree";
142143

143144
/* istanbul ignore next */
144145
export const VisitorKeys = (function() {
@@ -148,16 +149,16 @@ export const VisitorKeys = (function() {
148149
// Derive node types from VisitorKeys
149150
/* istanbul ignore next */
150151
export const Syntax = (function() {
151-
let name,
152+
let key,
152153
types = {};
153154

154155
if (typeof Object.create === "function") {
155156
types = Object.create(null);
156157
}
157158

158-
for (name in VisitorKeys) {
159-
if (Object.hasOwnProperty.call(VisitorKeys, name)) {
160-
types[name] = name;
159+
for (key in VisitorKeys) {
160+
if (Object.hasOwnProperty.call(VisitorKeys, key)) {
161+
types[key] = key;
161162
}
162163
}
163164

0 commit comments

Comments
 (0)