* Creates a call to the current file's export function to export a value. * * @param name The bound name of the export. * @param value The exported value. * @param location The location to use for source maps and comments for the export.
(name, value, location, liveBinding)
| 105589 | * @param location The location to use for source maps and comments for the export. |
| 105590 | */ |
| 105591 | function createExportExpression(name, value, location, liveBinding) { |
| 105592 | return ts.setTextRange(liveBinding && languageVersion !== 0 /* ScriptTarget.ES3 */ ? factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier("Object"), "defineProperty"), |
| 105593 | /*typeArguments*/ undefined, [ |
| 105594 | factory.createIdentifier("exports"), |
| 105595 | factory.createStringLiteralFromNode(name), |
| 105596 | factory.createObjectLiteralExpression([ |
| 105597 | factory.createPropertyAssignment("enumerable", factory.createTrue()), |
| 105598 | factory.createPropertyAssignment("get", factory.createFunctionExpression( |
| 105599 | /*modifiers*/ undefined, |
| 105600 | /*asteriskToken*/ undefined, |
| 105601 | /*name*/ undefined, |
| 105602 | /*typeParameters*/ undefined, |
| 105603 | /*parameters*/ [], |
| 105604 | /*type*/ undefined, factory.createBlock([factory.createReturnStatement(value)]))) |
| 105605 | ]) |
| 105606 | ]) : factory.createAssignment(factory.createPropertyAccessExpression(factory.createIdentifier("exports"), factory.cloneNode(name)), value), location); |
| 105607 | } |
| 105608 | // |
| 105609 | // Modifier Visitors |
| 105610 | // |
no outgoing calls
no test coverage detected