File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed
javascript/ql/src/semmle/javascript/frameworks Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -125,6 +125,7 @@ module Templating {
125
125
/**
126
126
* Gets the innermost JavaScript expression containing this template tag, if any.
127
127
*/
128
+ pragma [ nomagic]
128
129
Expr getEnclosingExpr ( ) { expr_contains_template_tag_location ( result , getLocation ( ) ) }
129
130
}
130
131
@@ -315,12 +316,17 @@ module Templating {
315
316
)
316
317
}
317
318
319
+ pragma [ nomagic]
320
+ private Folder getFolder ( ) {
321
+ result = getFile ( ) .getParentContainer ( )
322
+ }
323
+
318
324
/** Gets the template file referenced by this node. */
319
325
final TemplateFile getTemplateFile ( ) {
320
326
result =
321
327
this .getValue ( )
322
328
.( TemplateFileReferenceString )
323
- .getTemplateFile ( getFile ( ) . getParentContainer ( ) )
329
+ .getTemplateFile ( getFolder ( ) )
324
330
}
325
331
}
326
332
@@ -377,7 +383,12 @@ module Templating {
377
383
378
384
DefaultTemplateReferenceString ( ) { this = r .getValue ( ) .replaceAll ( "\\" , "/" ) }
379
385
380
- override Folder getContextFolder ( ) { result = r .getFile ( ) .getParentContainer ( ) }
386
+ pragma [ nomagic] // Stop optimizer from trying to share the 'getParentContainer' join
387
+ private Folder getFileReferenceFolder ( ) {
388
+ result = pragma [ only_bind_out ] ( r ) .getFile ( ) .getParentContainer ( )
389
+ }
390
+
391
+ override Folder getContextFolder ( ) { result = getFileReferenceFolder ( ) }
381
392
}
382
393
383
394
/** The `X` in a path of form `../X`, treated as a separate path string with a different context folder. */
You can’t perform that action at this time.
0 commit comments