MCPcopy
hub / github.com/BloombergGraphics/whatiscode / parseArrayInitialiser

Function parseArrayInitialiser

scripts/libs/esprima.js:2324–2345  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

2322 // 11.1.4 Array Initialiser
2323
2324 function parseArrayInitialiser() {
2325 var elements = [], node = new Node();
2326
2327 expect('[');
2328
2329 while (!match(']')) {
2330 if (match(',')) {
2331 lex();
2332 elements.push(null);
2333 } else {
2334 elements.push(parseAssignmentExpression());
2335
2336 if (!match(']')) {
2337 expect(',');
2338 }
2339 }
2340 }
2341
2342 lex();
2343
2344 return node.finishArrayExpression(elements);
2345 }
2346
2347 // 11.1.5 Object Initialiser
2348

Callers 1

parsePrimaryExpressionFunction · 0.85

Calls 4

expectFunction · 0.85
matchFunction · 0.85
lexFunction · 0.85

Tested by

no test coverage detected