Skip to content

Commit 54a2ecb

Browse files
committed
fix: support JS_IR and Wasm target for 2.0.x
1 parent 225e4c1 commit 54a2ecb

File tree

1 file changed

+6
-7
lines changed

1 file changed

+6
-7
lines changed

src/webdemo-api.js

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -50,27 +50,26 @@ export default class WebDemoApi {
5050
* @returns {*|PromiseLike<T>|Promise<T>}
5151
*/
5252
static translateKotlinToJs(code, compilerVersion, platform, args, hiddenDependencies) {
53-
const MINIMAL_MINOR_VERSION_IR = 5
54-
const MINIMAL_MINOR_VERSION_WASM = 9
55-
const minor = parseInt(compilerVersion.split(".")[1]);
53+
const MINIMAL_VERSION_IR = '1.5.0';
54+
const MINIMAL_VERSION_WASM = '1.9.0';
5655

57-
if (platform === TargetPlatforms.JS_IR && minor < MINIMAL_MINOR_VERSION_IR) {
56+
if (platform === TargetPlatforms.JS_IR && compilerVersion < MINIMAL_VERSION_IR) {
5857
return Promise.resolve({
5958
output: "",
6059
errors: [{
6160
severity: "ERROR",
62-
message: `JS IR compiler backend accessible only since 1.${MINIMAL_MINOR_VERSION_IR}.0 version`
61+
message: `JS IR compiler backend accessible only since ${MINIMAL_VERSION_IR} version`
6362
}],
6463
jsCode: ""
6564
})
6665
}
6766

68-
if (platform === TargetPlatforms.WASM && minor < MINIMAL_MINOR_VERSION_WASM) {
67+
if (platform === TargetPlatforms.WASM && compilerVersion < MINIMAL_VERSION_WASM) {
6968
return Promise.resolve({
7069
output: "",
7170
errors: [{
7271
severity: "ERROR",
73-
message: `Wasm compiler backend accessible only since 1.${MINIMAL_MINOR_VERSION_WASM}.0 version`
72+
message: `Wasm compiler backend accessible only since ${MINIMAL_VERSION_WASM} version`
7473
}],
7574
jsCode: ""
7675
})

0 commit comments

Comments
 (0)