JS: Autoformat

This commit is contained in:
Asger Feldthaus
2020-06-15 20:40:17 +01:00
parent 3242f5ed94
commit 23d28967a7

View File

@@ -35,7 +35,12 @@ class RootDestructuringPattern extends BindingPattern {
/** Gets the first occurrence of the conflicting binding `name`. */
VarDecl getFirstClobberedVarDecl(string name) {
hasConflictingBindings(name) and
result = min(VarDecl decl | decl = getABindingVarRef() and decl.getName() = name | decl order by decl.getLocation().getStartLine(), decl.getLocation().getStartColumn())
result =
min(VarDecl decl |
decl = getABindingVarRef() and decl.getName() = name
|
decl order by decl.getLocation().getStartLine(), decl.getLocation().getStartColumn()
)
}
/** Holds if variables in this pattern may resemble type annotations. */
@@ -54,8 +59,10 @@ where
w = p.getABindingVarRef() and
w.getName() = n and
v != w and
if p.resemblesTypeAnnotation() then
message = "The pattern variable '" + n + "' appears to be a type, but is a variable previously bound $@."
else
message = "Repeated binding of pattern variable '" + n + "' previously bound $@."
if p.resemblesTypeAnnotation()
then
message =
"The pattern variable '" + n +
"' appears to be a type, but is a variable previously bound $@."
else message = "Repeated binding of pattern variable '" + n + "' previously bound $@."
select w, message, v, "here"