MCPcopy Index your code
hub / github.com/nodejs/node / checkStrictModeLabeledStatement

Function checkStrictModeLabeledStatement

test/fixtures/snapshot/typescript.js:46701–46708  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

46699 }
46700 }
46701 function checkStrictModeLabeledStatement(node) {
46702 // Grammar checking for labeledStatement
46703 if (inStrictMode && ts.getEmitScriptTarget(options) >= 2 /* ScriptTarget.ES2015 */) {
46704 if (ts.isDeclarationStatement(node.statement) || ts.isVariableStatement(node.statement)) {
46705 errorOnFirstToken(node.label, ts.Diagnostics.A_label_is_not_allowed_here);
46706 }
46707 }
46708 }
46709 function errorOnFirstToken(node, message, arg0, arg1, arg2) {
46710 var span = ts.getSpanOfTokenAtPosition(file, node.pos);
46711 file.bindDiagnostics.push(ts.createFileDiagnostic(file, span.start, span.length, message, arg0, arg1, arg2));

Callers 1

bindWorkerFunction · 0.85

Calls 1

errorOnFirstTokenFunction · 0.85

Tested by

no test coverage detected