Skip to content

Commit 712a337

Browse files
committed
qhelp adjustments based on code-review
1 parent ced5e3e commit 712a337

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

javascript/ql/src/Declarations/SuspiciousMethodNameDeclaration.qhelp

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,15 @@
44
<qhelp>
55
<overview>
66
<p>
7-
In TypeScript the keywords <code>constructor</code> and <code>new</code> for member declarations are
8-
used to declare constructors in classes and interfaces respectively.
9-
However, by using the wrong keyword a programmer can accidentally declare e.g.
10-
a method called <code>constructor</code> inside an interface.
11-
Similarly the keyword <code>function</code> is used to declare functions in
12-
some contexts, however, using the keyword <code>function</code> inside a class
13-
or interface results in declaring a method called <code>function</code>.
7+
In TypeScript the keywords <code>constructor</code> and <code>new</code> for
8+
member declarations are used to declare constructors in classes and interfaces
9+
respectively.
10+
However, a member declaration with the name <code>new</code> in an interface
11+
or <code>constructor</code> in a class, will declare ordinary methods named
12+
<code>new</code> or <code>constructor</code> rather than constructors.
13+
Similarly, the keyword <code>function</code> is used to declare functions in
14+
some contexts, however, using the name <code>function</code> for a class
15+
or interface member declaration declares a method named <code>function</code>.
1416
</p>
1517

1618
</overview>

0 commit comments

Comments
 (0)