MCPcopy Create free account
hub / github.com/microsoft/SandDance / parseObjectInitialiser

Function parseObjectInitialiser

docs/app/js/sanddance-app.js:144148–144164  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

144146 }
144147}
144148function parseObjectInitialiser() {
144149 var properties = [], property, name, key, map = {}, toString = String;
144150 index = lookahead.start;
144151 expect("{");
144152 while(!match("}")){
144153 property = parseObjectProperty();
144154 if (property.key.type === SyntaxIdentifier) name = property.key.name;
144155 else name = toString(property.key.value);
144156 key = "$" + name;
144157 if (Object.prototype.hasOwnProperty.call(map, key)) throwError({}, MessageStrictDuplicateProperty);
144158 else map[key] = true;
144159 properties.push(property);
144160 if (!match("}")) expect(",");
144161 }
144162 expect("}");
144163 return finishObjectExpression(properties);
144164} // 11.1.6 The Grouping Operator
144165function parseGroupExpression() {
144166 expect("(");
144167 const expr = parseExpression();

Callers 1

parsePrimaryExpressionFunction · 0.70

Calls 6

expectFunction · 0.70
matchFunction · 0.70
parseObjectPropertyFunction · 0.70
toStringFunction · 0.70
throwErrorFunction · 0.70
finishObjectExpressionFunction · 0.70

Tested by

no test coverage detected