docs/libs/typescript.js
function checkStrictModeIdentifier(node) {
            if (inStrictMode &&
                node.originalKeywordKind >= 106 /* FirstFutureReservedWord */ &&
                node.originalKeywordKind <= 114 /* LastFutureReservedWord */ &&
                !ts.isIdentifierName(node) &&
                !ts.isInAmbientContext(node)) {
                // Report error only if there are no parse errors in file
                if (!file.parseDiagnostics.length) {
                    file.bindDiagnostics.push(ts.createDiagnosticForNode(node, getStrictModeIdentifierMessage(node), ts.declarationNameToString(node)));
                }
            }
        }
function checkStrictModeIdentifier(node) {
            if (inStrictMode &&
                node.originalKeywordKind >= 106 /* FirstFutureReservedWord */ &&
                node.originalKeywordKind <= 114 /* LastFutureReservedWord */ &&
                !ts.isIdentifierName(node) &&
                !ts.isInAmbientContext(node)) {
                // Report error only if there are no parse errors in file
                if (!file.parseDiagnostics.length) {
                    file.bindDiagnostics.push(ts.createDiagnosticForNode(node, getStrictModeIdentifierMessage(node), ts.declarationNameToString(node)));
                }
            }
        }
function checkStrictModeIdentifier ( node ) { if ( inStrictMode && node . originalKeywordKind >= 106 /* FirstFutureReservedWord */ && node . originalKeywordKind <= 114 /* LastFutureReservedWord */ && ! ts . isIdentifierName ( node ) && ! ts . isInAmbientContext ( node ) ) { // Report error only if there are no parse errors in file if ( ! file . parseDiagnostics . length ) { file . bindDiagnostics . push ( ts . createDiagnosticForNode ( node , getStrictModeIdentifierMessage ( node ) , ts . declarationNameToString ( node ) ) ) ; } } }
The binder visits every node in the syntax tree so it is a convenient place to perform a single localized check for reserved words used as identifiers in strict mode code.
The binder visits every node in the syntax tree so it is a convenient place to perform a single localized check for reserved words used as identifiers in strict mode code .