You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -266,9 +267,40 @@ function getElementValues(nodeList, initialScope) {
266
267
returnvalueList
267
268
}
268
269
270
+
/**
271
+
* Checks if a variable is a built-in global.
272
+
* @param {Variable|null} variable The variable to check.
273
+
* @returns {variable is Variable & {defs:[]}}
274
+
*/
275
+
functionisBuiltinGlobal(variable){
276
+
return(
277
+
variable!=null&&
278
+
variable.defs.length===0&&
279
+
builtinNames.has(variable.name)&&
280
+
variable.nameinglobalObject
281
+
)
282
+
}
283
+
284
+
/**
285
+
* Checks if a variable can be considered as a constant.
286
+
* @param {Variable} variable
287
+
* @returns {variable is Variable & {defs: [import("eslint").Scope.Definition & { type: "Variable" }]}} True if the variable can be considered as a constant.
@@ -283,6 +315,68 @@ function isEffectivelyConst(variable) {
283
315
returnfalse
284
316
}
285
317
318
+
/**
319
+
* Checks if a variable has mutation in its property.
320
+
* @param {Variable} variable The variable to check.
321
+
* @param {Scope|null} initialScope The scope to start finding variable. Optional. If the node is a computed property node and this scope was given, this checks the computed property name by the `getStringIfConstant` function with the scope, and returns the value of it.
322
+
* @returns {boolean} True if the variable has mutation in its property.
0 commit comments