JavaScript: Add syntax examples in AMD.qll, AST.qll and Stmt.qll.#1574
JavaScript: Add syntax examples in AMD.qll, AST.qll and Stmt.qll.#1574semmle-qlci merged 2 commits intogithub:masterfrom
AMD.qll, AST.qll and Stmt.qll.#1574Conversation
| * Example: | ||
| * | ||
| * ``` | ||
| * #! /usr/bin/node |
There was a problem hiding this comment.
Do you use the #! to indicate that this is an entire file and not just a statement?
If not, do we really need #! in the example?
It is strictly speaking not valid JavaScript, and it wont make sense to include through the <script> element mentioned above.
There was a problem hiding this comment.
Yes, the idea is to show different kinds of scripts. I don't think there is an implication that one would include it using a <script> element?
| * | ||
| * Example: | ||
| * | ||
| * <pre> |
There was a problem hiding this comment.
No. We need to use <pre> instead of the backticks so we can use the &# entity to escape the slash, which otherwise would terminate the comment.
| * Examples: | ||
| * | ||
| * ``` | ||
| * "use strict"; |
There was a problem hiding this comment.
Perhaps enclose this in a function body so it is clearer what a statement container is.
| * Example: | ||
| * | ||
| * ``` | ||
| * for(var i=0; i<10; ++i) |
There was a problem hiding this comment.
Consistency: the other loop examples use braces around the body
|
Thanks, @esben-semmle, comments addressed. |
No description provided.