Skip to content

Commit 653deb5

Browse files
Remove swjs_library_version
This function was used to check the compatibility between the JavaScriptKit Swift library and JS runtime because they were manually kept in sync by users of the library with npm and SwiftPM. Now that the library is distributed as a single SwiftPM package, there is no need for this function.
1 parent 1a33c51 commit 653deb5

File tree

5 files changed

+0
-24
lines changed

5 files changed

+0
-24
lines changed

Runtime/src/index.ts

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -56,14 +56,6 @@ export class SwiftRuntime {
5656
`
5757
);
5858
}
59-
if (this.exports.swjs_library_version() != this.version) {
60-
throw new Error(
61-
`The versions of JavaScriptKit are incompatible.
62-
WebAssembly runtime ${this.exports.swjs_library_version()} != JS runtime ${
63-
this.version
64-
}`
65-
);
66-
}
6759
}
6860

6961
main() {

Runtime/src/types.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export type JavaScriptValueKind = number;
77
export type JavaScriptValueKindAndFlags = number;
88

99
export interface ExportedFunctions {
10-
swjs_library_version(): number;
1110
swjs_library_features(): number;
1211
swjs_prepare_host_function_call(size: number): pointer;
1312
swjs_cleanup_host_function_call(argv: pointer): void;

Sources/JavaScriptKit/Runtime/index.js

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/JavaScriptKit/Runtime/index.mjs

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Sources/_CJavaScriptKit/_CJavaScriptKit.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,6 @@ extern void *memcpy (void *__restrict, const void *__restrict, size_t);
1313
#include <stdbool.h>
1414

1515
#endif
16-
/// The compatibility runtime library version.
17-
/// Notes: If you change any interface of runtime library, please increment
18-
/// this and `SwiftRuntime.version` in `./Runtime/src/index.ts`.
19-
__attribute__((export_name("swjs_library_version")))
20-
int swjs_library_version(void) {
21-
return 708;
22-
}
2316

2417
__attribute__((export_name("swjs_prepare_host_function_call")))
2518
void *swjs_prepare_host_function_call(const int argc) {

0 commit comments

Comments
 (0)