File tree Expand file tree Collapse file tree
javascript/ql/src/semmle/javascript/frameworks Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -125,6 +125,7 @@ module Templating {
125125 /**
126126 * Gets the innermost JavaScript expression containing this template tag, if any.
127127 */
128+ pragma [ nomagic]
128129 Expr getEnclosingExpr ( ) { expr_contains_template_tag_location ( result , getLocation ( ) ) }
129130 }
130131
@@ -315,12 +316,17 @@ module Templating {
315316 )
316317 }
317318
319+ pragma [ nomagic]
320+ private Folder getFolder ( ) {
321+ result = getFile ( ) .getParentContainer ( )
322+ }
323+
318324 /** Gets the template file referenced by this node. */
319325 final TemplateFile getTemplateFile ( ) {
320326 result =
321327 this .getValue ( )
322328 .( TemplateFileReferenceString )
323- .getTemplateFile ( getFile ( ) . getParentContainer ( ) )
329+ .getTemplateFile ( getFolder ( ) )
324330 }
325331 }
326332
@@ -377,7 +383,12 @@ module Templating {
377383
378384 DefaultTemplateReferenceString ( ) { this = r .getValue ( ) .replaceAll ( "\\" , "/" ) }
379385
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 ( ) }
381392 }
382393
383394 /** 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