MCPcopy Index your code
hub / github.com/nodejs/node / createPropertyDescriptor

Function createPropertyDescriptor

test/fixtures/snapshot/typescript.js:26731–26741  ·  view source on GitHub ↗
(attributes, singleLine)

Source from the content-addressed store, hash-verified

26729 return false;
26730 }
26731 function createPropertyDescriptor(attributes, singleLine) {
26732 var properties = [];
26733 tryAddPropertyAssignment(properties, "enumerable", asExpression(attributes.enumerable));
26734 tryAddPropertyAssignment(properties, "configurable", asExpression(attributes.configurable));
26735 var isData = tryAddPropertyAssignment(properties, "writable", asExpression(attributes.writable));
26736 isData = tryAddPropertyAssignment(properties, "value", attributes.value) || isData;
26737 var isAccessor = tryAddPropertyAssignment(properties, "get", attributes.get);
26738 isAccessor = tryAddPropertyAssignment(properties, "set", attributes.set) || isAccessor;
26739 ts.Debug.assert(!(isData && isAccessor), "A PropertyDescriptor may not be both an accessor descriptor and a data descriptor.");
26740 return createObjectLiteralExpression(properties, !singleLine);
26741 }
26742 function updateOuterExpression(outerExpression, expression) {
26743 switch (outerExpression.kind) {
26744 case 212 /* SyntaxKind.ParenthesizedExpression */: return updateParenthesizedExpression(outerExpression, expression);

Callers

nothing calls this directly

Calls 4

tryAddPropertyAssignmentFunction · 0.85
asExpressionFunction · 0.85
assertMethod · 0.80

Tested by

no test coverage detected