MCPcopy
hub / github.com/pugjs/pug / checkExtendPosition

Function checkExtendPosition

packages/pug-linker/index.js:191–206  ·  view source on GitHub ↗
(ast, hasExtends)

Source from the content-addressed store, hash-verified

189}
190
191function checkExtendPosition(ast, hasExtends) {
192 var legitExtendsReached = false;
193 walk(ast, function(node) {
194 if (node.type === 'Extends') {
195 if (hasExtends && !legitExtendsReached) {
196 legitExtendsReached = true;
197 } else {
198 error(
199 'EXTENDS_NOT_FIRST',
200 'Declaration of template inheritance ("extends") should be the first thing in the file. There can only be one extends statement per file.',
201 node
202 );
203 }
204 }
205 });
206}

Callers 1

linkFunction · 0.85

Calls 1

errorFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…