File tree Expand file tree Collapse file tree 1 file changed +12
-0
lines changed
javascript/ql/src/semmle/javascript/frameworks Expand file tree Collapse file tree 1 file changed +12
-0
lines changed Original file line number Diff line number Diff line change @@ -237,6 +237,18 @@ module HTTP {
237237 * Holds if `call` decorates the function `pred`.
238238 * This means that `call` returns a function that forwards its arguments to `pred`.
239239 * Only holds when the decorator looks like it is decorating a route-handler.
240+ *
241+ * Below is a code example relating `call`, `decoratee`, `outer`, `inner`.
242+ * ```
243+ * function outer(method) {
244+ * return function inner(req, res) {
245+ * return method.call(this, req, res);
246+ * };
247+ * }
248+ * var route = outer(function decoratee(req, res) { // <- call
249+ * res.end("foo");
250+ * });
251+ * ```
240252 */
241253 private predicate isDecoratedCall ( DataFlow:: CallNode call , DataFlow:: FunctionNode decoratee ) {
242254 // indirect route-handler `result` is given to function `outer`, which returns function `inner` which calls the function `pred`.
You can’t perform that action at this time.
0 commit comments