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

Function parseObjectInitialiser

docs/tests/v2/es6/js/sanddance.js:128982–129018  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

128980}
128981
128982function parseObjectInitialiser() {
128983 var properties = [],
128984 property,
128985 name,
128986 key,
128987 map = {},
128988 toString = String;
128989 index = lookahead.start;
128990 expect('{');
128991
128992 while (!match('}')) {
128993 property = parseObjectProperty();
128994
128995 if (property.key.type === SyntaxIdentifier) {
128996 name = property.key.name;
128997 } else {
128998 name = toString(property.key.value);
128999 }
129000
129001 key = '$' + name;
129002
129003 if (Object.prototype.hasOwnProperty.call(map, key)) {
129004 throwError({}, MessageStrictDuplicateProperty);
129005 } else {
129006 map[key] = true;
129007 }
129008
129009 properties.push(property);
129010
129011 if (!match('}')) {
129012 expect(',');
129013 }
129014 }
129015
129016 expect('}');
129017 return finishObjectExpression(properties);
129018} // 11.1.6 The Grouping Operator
129019
129020
129021function parseGroupExpression() {

Callers 1

parsePrimaryExpressionFunction · 0.70

Calls 6

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

Tested by

no test coverage detected