Skip to content
This repository was archived by the owner on May 1, 2019. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,4 @@
"strip-indent": "^2.0.0",
"typescript": "^2.1.4"
}
}
}
8 changes: 4 additions & 4 deletions src/javascript/ast-value.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,13 @@ function unaryToValue(unary: estree.UnaryExpression): LiteralValue {
const operand = expressionToValue(unary.argument);
switch (unary.operator) {
case '!':
return !operand;
return !(operand as any);
case '-':
return -operand;
return -(operand as any);
case '+':
return +operand;
return +(operand as any);
case '~':
return ~operand;
return ~(operand as any);
case 'typeof':
return typeof operand;
case 'void':
Expand Down
2 changes: 1 addition & 1 deletion src/perf/parse-all-benchmark.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class Averager<K> {

entries(): Iterable<[K, number]> {
const entries = this.count.keys().map(
(k) => <[K, number]>[k, this.elapsed.get(k) / this.count.get(k)]);
(k) => <[K, number]>[k, this.elapsed.get(k)! / this.count.get(k)!]);
return entries.sort((a, b) => a[1] - b[1]);
}
}
Expand Down
2 changes: 1 addition & 1 deletion src/typescript/typescript-analyzer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ function isLibraryPath(filename: string) {
return filename.startsWith('/$lib/');
}

const libraryCache = new Map<string, string>();
const libraryCache = new Map<string, string|undefined>();
function getLibrarySource(filePath: string) {
if (libraryCache.has(filePath)) {
return libraryCache.get(filePath);
Expand Down