@@ -210,23 +210,23 @@ module.exports = {
210
210
* @returns {boolean } Whether or not the tokens are on the same line.
211
211
* @public
212
212
*/
213
- isTokenOnSameLine : function ( left , right ) {
213
+ isTokenOnSameLine ( left , right ) {
214
214
return left . loc . end . line === right . loc . start . line ;
215
215
} ,
216
216
217
- isNullOrUndefined : isNullOrUndefined ,
218
- isCallee : isCallee ,
219
- isES5Constructor : isES5Constructor ,
220
- getUpperFunction : getUpperFunction ,
221
- isArrayFromMethod : isArrayFromMethod ,
222
- isParenthesised : isParenthesised ,
217
+ isNullOrUndefined,
218
+ isCallee,
219
+ isES5Constructor,
220
+ getUpperFunction,
221
+ isArrayFromMethod,
222
+ isParenthesised,
223
223
224
224
/**
225
225
* Checks whether or not a given node is a string literal.
226
226
* @param {ASTNode } node - A node to check.
227
227
* @returns {boolean } `true` if the node is a string literal.
228
228
*/
229
- isStringLiteral : function ( node ) {
229
+ isStringLiteral ( node ) {
230
230
return (
231
231
( node . type === "Literal" && typeof node . value === "string" ) ||
232
232
node . type === "TemplateLiteral"
@@ -247,7 +247,7 @@ module.exports = {
247
247
* @param {ASTNode } node - A node to check.
248
248
* @returns {boolean } `true` if the node is breakable.
249
249
*/
250
- isBreakableStatement : function ( node ) {
250
+ isBreakableStatement ( node ) {
251
251
return breakableTypePattern . test ( node . type ) ;
252
252
} ,
253
253
@@ -257,7 +257,7 @@ module.exports = {
257
257
* @param {ASTNode } node - A node to get.
258
258
* @returns {string|null } The label or `null`.
259
259
*/
260
- getLabel : function ( node ) {
260
+ getLabel ( node ) {
261
261
if ( node . parent . type === "LabeledStatement" ) {
262
262
return node . parent . label . name ;
263
263
}
@@ -270,7 +270,7 @@ module.exports = {
270
270
* @returns {Reference[] } An array of only references which are non initializer and writable.
271
271
* @public
272
272
*/
273
- getModifyingReferences : function ( references ) {
273
+ getModifyingReferences ( references ) {
274
274
return references . filter ( isModifyingReference ) ;
275
275
} ,
276
276
@@ -281,7 +281,7 @@ module.exports = {
281
281
* @returns {boolean } True if the text is surrounded by the character, false if not.
282
282
* @private
283
283
*/
284
- isSurroundedBy : function ( val , character ) {
284
+ isSurroundedBy ( val , character ) {
285
285
return val [ 0 ] === character && val [ val . length - 1 ] === character ;
286
286
} ,
287
287
@@ -290,7 +290,7 @@ module.exports = {
290
290
* @param {LineComment|BlockComment } node The node to be checked
291
291
* @returns {boolean } `true` if the node is an ESLint directive comment
292
292
*/
293
- isDirectiveComment : function ( node ) {
293
+ isDirectiveComment ( node ) {
294
294
const comment = node . value . trim ( ) ;
295
295
296
296
return (
@@ -323,7 +323,7 @@ module.exports = {
323
323
* @param {string } name - A variable name to find.
324
324
* @returns {escope.Variable|null } A found variable or `null`.
325
325
*/
326
- getVariableByName : function ( initScope , name ) {
326
+ getVariableByName ( initScope , name ) {
327
327
let scope = initScope ;
328
328
329
329
while ( scope ) {
@@ -360,7 +360,7 @@ module.exports = {
360
360
* @param {SourceCode } sourceCode - A SourceCode instance to get comments.
361
361
* @returns {boolean } The function node is the default `this` binding.
362
362
*/
363
- isDefaultThisBinding : function ( node , sourceCode ) {
363
+ isDefaultThisBinding ( node , sourceCode ) {
364
364
if ( isES5Constructor ( node ) || hasJSDocThisTag ( node , sourceCode ) ) {
365
365
return false ;
366
366
}
@@ -496,7 +496,7 @@ module.exports = {
496
496
* @returns {int } precedence level
497
497
* @private
498
498
*/
499
- getPrecedence : function ( node ) {
499
+ getPrecedence ( node ) {
500
500
switch ( node . type ) {
501
501
case "SequenceExpression" :
502
502
return 0 ;
@@ -594,7 +594,7 @@ module.exports = {
594
594
* @param {ASTNode|null } node - A node to check.
595
595
* @returns {boolean } `true` if the node is a loop node.
596
596
*/
597
- isLoop : function ( node ) {
597
+ isLoop ( node ) {
598
598
return Boolean ( node && anyLoopPattern . test ( node . type ) ) ;
599
599
} ,
600
600
@@ -609,7 +609,7 @@ module.exports = {
609
609
* @param {ASTNode|null } node - A node to check.
610
610
* @returns {boolean } `true` if the node is a function node.
611
611
*/
612
- isFunction : function ( node ) {
612
+ isFunction ( node ) {
613
613
return Boolean ( node && anyFunctionPattern . test ( node . type ) ) ;
614
614
} ,
615
615
0 commit comments