MCPcopy
hub / github.com/Unitech/pm2 / object

Function object

lib/tools/json5.js:416–455  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

414 },
415
416 object = function () {
417
418// Parse an object value.
419
420 var key,
421 object = {};
422
423 if (ch === '{') {
424 next('{');
425 white();
426 while (ch) {
427 if (ch === '}') {
428 next('}');
429 return object; // Potentially empty object
430 }
431
432 // Keys can be unquoted. If they are, they need to be
433 // valid JS identifiers.
434 if (ch === '"' || ch === "'") {
435 key = string();
436 } else {
437 key = identifier();
438 }
439
440 white();
441 next(':');
442 object[key] = value();
443 white();
444 // If there's no comma after this pair, this needs to be
445 // the end of the object.
446 if (ch !== ',') {
447 next('}');
448 return object;
449 }
450 next(',');
451 white();
452 }
453 }
454 error("Bad object");
455 };
456
457 value = function () {
458

Callers 1

json5.jsFile · 0.85

Calls 5

whiteFunction · 0.85
stringFunction · 0.85
identifierFunction · 0.85
errorFunction · 0.85
nextFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…