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

Function parsePropertyPattern

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

Source from the content-addressed store, hash-verified

2260 }
2261
2262 function parsePropertyPattern() {
2263 var node = new Node(), key, computed = match('['), init;
2264 if (lookahead.type === Token.Identifier) {
2265 key = parseVariableIdentifier();
2266 if (match('=')) {
2267 lex();
2268 init = parseAssignmentExpression();
2269 return node.finishProperty(
2270 'init', key, false,
2271 new WrappingNode(key).finishAssignmentPattern(key, init), false, false);
2272 } else if (!match(':')) {
2273 return node.finishProperty('init', key, false, key, false, false);
2274 }
2275 } else {
2276 key = parseObjectPropertyKey();
2277 }
2278 expect(':');
2279 init = parsePatternWithDefault();
2280 return node.finishProperty('init', key, computed, init, false, false);
2281 }
2282
2283 function parseObjectPattern() {
2284 var node = new Node(), properties = [];

Callers 1

parseObjectPatternFunction · 0.85

Calls 7

matchFunction · 0.85
parseVariableIdentifierFunction · 0.85
lexFunction · 0.85
parseObjectPropertyKeyFunction · 0.85
expectFunction · 0.85
parsePatternWithDefaultFunction · 0.85

Tested by

no test coverage detected