How to use the esutils/lib/code.isIdentifierStartES6 function in esutils

To help you get started, we’ve selected a few esutils examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github stealjs / steal / ext / babel-code-frame.js View on Github external
function isIdentifierNameES6(id) {
            var i, iz, ch, lowCh, check;
            if (id.length === 0) {
                return false;
            }
            check = code.isIdentifierStartES6;
            for (i = 0, iz = id.length; i < iz; ++i) {
                ch = id.charCodeAt(i);
                if (55296 <= ch && ch <= 56319) {
                    ++i;
                    if (i >= iz) {
                        return false;
                    }
                    lowCh = id.charCodeAt(i);
                    if (!(56320 <= lowCh && lowCh <= 57343)) {
                        return false;
                    }
                    ch = decodeUtf16(ch, lowCh);
                }
                if (!check(ch)) {
                    return false;
                }