MCPcopy
hub / github.com/handlebars-lang/handlebars.js / parseWithoutProcessing

Function parseWithoutProcessing

lib/handlebars/compiler/base.js:12–31  ·  view source on GitHub ↗
(input, options)

Source from the content-addressed store, hash-verified

10extend(yy, Helpers);
11
12export function parseWithoutProcessing(input, options) {
13 // Just return if an already-compiled AST was passed in.
14 if (input.type === 'Program') {
15 // When a pre-parsed AST is passed in, validate all node values to prevent
16 // code injection via type-confused literals.
17 validateInputAst(input);
18 return input;
19 }
20
21 parser.yy = yy;
22
23 // Altering the shared object here, but this is ok as parser is a sync operation
24 yy.locInfo = function(locInfo) {
25 return new yy.SourceLocation(options && options.srcName, locInfo);
26 };
27
28 let ast = parser.parse(input);
29
30 return ast;
31}
32
33export function parse(input, options) {
34 let ast = parseWithoutProcessing(input, options);

Callers 1

parseFunction · 0.85

Calls 1

validateInputAstFunction · 0.85

Tested by

no test coverage detected