MCPcopy Index your code
hub / github.com/BloombergGraphics/whatiscode / parseLexicalBinding

Function parseLexicalBinding

scripts/libs/esprima.js:3280–3301  ·  view source on GitHub ↗
(kind, options)

Source from the content-addressed store, hash-verified

3278 }
3279
3280 function parseLexicalBinding(kind, options) {
3281 var init = null, id, node = new Node();
3282
3283 id = parsePattern();
3284
3285 // 12.2.1
3286 if (strict && id.type === Syntax.Identifier && isRestrictedWord(id.name)) {
3287 tolerateError(Messages.StrictVarName);
3288 }
3289
3290 if (kind === 'const') {
3291 if (!matchKeyword('in')) {
3292 expect('=');
3293 init = parseAssignmentExpression();
3294 }
3295 } else if ((!options.inFor && id.type !== Syntax.Identifier) || match('=')) {
3296 expect('=');
3297 init = parseAssignmentExpression();
3298 }
3299
3300 return node.finishVariableDeclarator(id, init);
3301 }
3302
3303 function parseBindingList(kind, options) {
3304 var list = [];

Callers 1

parseBindingListFunction · 0.85

Calls 7

parsePatternFunction · 0.85
isRestrictedWordFunction · 0.85
tolerateErrorFunction · 0.85
matchKeywordFunction · 0.85
expectFunction · 0.85
matchFunction · 0.85

Tested by

no test coverage detected