MCPcopy Create free account
hub / github.com/nodejs/node / generateSetAccessor

Function generateSetAccessor

test/fixtures/snapshot/typescript.js:158179–158188  ·  view source on GitHub ↗
(fieldName, accessorName, type, modifiers, isStatic, container)

Source from the content-addressed store, hash-verified

158177 ], /*multiLine*/ true));
158178 }
158179 function generateSetAccessor(fieldName, accessorName, type, modifiers, isStatic, container) {
158180 return ts.factory.createSetAccessorDeclaration(
158181 /*decorators*/ undefined, modifiers, accessorName, [ts.factory.createParameterDeclaration(
158182 /*decorators*/ undefined,
158183 /*modifiers*/ undefined,
158184 /*dotDotDotToken*/ undefined, ts.factory.createIdentifier("value"),
158185 /*questionToken*/ undefined, type)], ts.factory.createBlock([
158186 ts.factory.createExpressionStatement(ts.factory.createAssignment(createAccessorAccessExpression(fieldName, isStatic, container), ts.factory.createIdentifier("value")))
158187 ], /*multiLine*/ true));
158188 }
158189 function updatePropertyDeclaration(changeTracker, file, declaration, type, fieldName, modifiers) {
158190 var property = ts.factory.updatePropertyDeclaration(declaration, declaration.decorators, modifiers, fieldName, declaration.questionToken || declaration.exclamationToken, type, declaration.initializer);
158191 changeTracker.replaceNode(file, declaration, property);

Callers 1

Calls 1

Tested by

no test coverage detected