summaryrefslogtreecommitdiff
path: root/tools/ts_library_builder/ast_util.ts
diff options
context:
space:
mode:
authorandy finch <andyfinch7@gmail.com>2019-04-01 15:09:59 -0400
committerRyan Dahl <ry@tinyclouds.org>2019-04-01 15:09:59 -0400
commitb0a23beb8fae964be3cdd8c23c38af66257d34c7 (patch)
tree8f7875c8ca059dfb0a3ade4da7bfb94e57d6e1aa /tools/ts_library_builder/ast_util.ts
parent659acadf77fdbeef8579a37839a464feb408437a (diff)
Add web worker JS API (#1993)
* Refactored the way worker polling is scheduled and errors are handled. * Share the worker future as a Shared
Diffstat (limited to 'tools/ts_library_builder/ast_util.ts')
-rw-r--r--tools/ts_library_builder/ast_util.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/ts_library_builder/ast_util.ts b/tools/ts_library_builder/ast_util.ts
index d195da721..14546f9c5 100644
--- a/tools/ts_library_builder/ast_util.ts
+++ b/tools/ts_library_builder/ast_util.ts
@@ -94,11 +94,14 @@ export function addVariableDeclaration(
node: StatementedNode,
name: string,
type: string,
+ isConst: boolean,
hasDeclareKeyword?: boolean,
jsdocs?: JSDoc[]
): VariableStatement {
return node.addVariableStatement({
- declarationKind: VariableDeclarationKind.Const,
+ declarationKind: isConst
+ ? VariableDeclarationKind.Const
+ : VariableDeclarationKind.Let,
declarations: [{ name, type }],
docs: jsdocs && jsdocs.map(jsdoc => jsdoc.getText()),
hasDeclareKeyword