Skip to content
This repository was archived by the owner on Oct 8, 2024. It is now read-only.

Commit 8a31fca

Browse files
Fixed compilation transform error when there are no host functions used. (#69)
* Fix error when no host functions are in use * Update CHANGELOG.md
1 parent 2911c36 commit 8a31fca

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Change Log
22

3+
# UNRELEASED
4+
5+
- Fixed compilation transform error when there are no host functions used. [#68](https://github.com/gohypermode/functions-as/pull/68)
6+
37
# 2024-04-25 - Version 0.6.0
48

59
_Note: Requires Hypermode Runtime v0.6.0 or newer_

src/transform/src/extractor.ts

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -169,9 +169,12 @@ export class Extractor {
169169

170170
private getHostFunctions() {
171171
const results: importExportInfo[] = [];
172-
this.program.moduleImports.get("hypermode").forEach((v, k) => {
173-
results.push({ name: k, function: v.internalName });
174-
});
172+
const hypermodeImports = this.program.moduleImports.get("hypermode");
173+
if (hypermodeImports) {
174+
hypermodeImports.forEach((v, k) => {
175+
results.push({ name: k, function: v.internalName });
176+
});
177+
}
175178
return results;
176179
}
177180

0 commit comments

Comments
 (0)