Commit Graph

59 Commits

Author SHA1 Message Date
Ilya Goncharov abb5f55087 [Wasm] Use static import for wasm imports
^KT-65777 fixed
2024-02-19 10:01:10 +00:00
Artem Kobzar 57a4d09ad2 [K/Wasm] Add tests for nested external declarations + fix them 2024-01-22 11:55:09 +00:00
Artem Kobzar a55c65e3e2 [K/Wasm] Add simple TypeScript definitions generating ^KT-65009 Fixed 2024-01-16 11:10:27 +00:00
Artem Kobzar 1473b4bb41 [K/Wasm] Introduce JsBigInt type 2023-12-13 18:44:57 +00:00
Artem Kobzar 2eb1e65bbf [K/Wasm] Allow to export unsigned numbers 2023-12-08 09:06:19 +00:00
Artem Kobzar 55d41db2ce [K/JS] Include jsFirEs6Test into jsFirCompilerTest tests 2023-11-24 22:09:43 +00:00
Mikhail Glukhikh 4913c38e98 FIR2IR: insert spread for named argument against primitive vararg
#KT-60312 Fixed
2023-11-13 16:23:26 +00:00
Dmitriy Novozhilov 8578a0bf6a [FIR2IR] Properly insert casts for smartcasts in argument position
Previously cast inserter didn't consider expected type for arguments
  of function calls

^KT-63257 Fixed
2023-11-10 07:50:01 +00:00
Svyatoslav Kuzmich 833c8b2cd4 [Wasm] Fix transforming setField in an inline class constructor body
IrSetField was transformed to its value to preserve side effects
This transformation produced invalid IR in cases where
IrSetField used in Unit-returning expression context.

This commit fixes it by producing Unit-typed expression

^KT-59084 Fixed
2023-08-17 10:35:00 +00:00
Igor Yakovlev 98329f30f8 [Wasm] Rename wasm initialize function 2023-08-08 18:10:19 +02:00
Svyatoslav Kuzmich 47ade4530c [Wasm] Add compiler flag to disable exception handling proposal
Fail with unreachable instead of throwing an exception

Merge-request: KT-MR-11481
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
2023-08-07 16:19:29 +00:00
Artem Kobzar 08bd0d6ce1 [K/JS] Generate tests for K2 + ES-classes compilation 2023-08-01 09:16:20 +00:00
Svyatoslav Kuzmich 384c700a85 [Wasm] Fix access to WebIDL dictionary members
Evaluate external interface companion objects as an empty JS object
instead of null due to null checks on interop boundary.

^KT-59082 Fixed
2023-07-25 15:27:22 +00:00
Shagen Ogandzhanian eb7805baf9 [KT-59294] [wasm] Resolve undefined to null for any nullable types in external functions 2023-07-21 19:13:57 +00:00
Artem Kobzar 41f27d19b5 [K/JS, K/Wasm] Generate star imports for external objects with the @JsModule annotation for ES modules 2023-07-18 15:36:19 +00:00
Igor Yakovlev 78fa93d75c [Wasm] Restrict WasmExport functions for primitive typed signature 2023-07-17 14:01:13 +00:00
Igor Yakovlev b5eafb9eb7 [Wasm] WasmExport implementation 2023-07-07 20:45:51 +00:00
Svyatoslav Kuzmich a3e2d2804c [Wasm] Update testData after adding K2 and new test infra support.
- Actualize muted K2 tests
- Actualize muted K1 tests with module systems because legacy Wasm test
  infra had no respect for "// MODULE: ..." test directives
2023-06-25 10:20:40 +02:00
Igor Yakovlev 1749bafc30 [Wasm] Rename dateref to structref 2023-05-19 15:50:07 +00:00
Svyatoslav Kuzmich 933f47aaf9 [Wasm] Rename JsHandle to JsReference
Decision to do this was made at Kotlin/Wasm interop design meeting
2023-04-21 15:03:20 +00:00
Svyatoslav Kuzmich 1b7c63bd49 [Wasm] Fix js interop closure signature
Before we used IrType.render() which is not unique.
This changes adds a proper serialization of adapter signature to string.
2023-03-20 15:16:00 +00:00
Svyatoslav Kuzmich 1208a26fc4 [Wasm] Use JsAny, JsHandle and other Js* types in stdlib and kotlin-test 2023-03-16 09:12:07 +00:00
Svyatoslav Kuzmich 1e91fe155b [Wasm] Restrict types allowed in JS interop
- Prohibit Any, Array and other unsupported non-external types in JS
  interop context
- Add K1 diagnostic
- Update BE testdata

^KT-57136 Fixed
2023-03-16 09:12:07 +00:00
Svyatoslav Kuzmich 525317962c [Wasm] Test js(code) with vararg parameter 2023-03-09 12:50:14 +00:00
Svyatoslav Kuzmich d5b958f744 [Wasm] Support default parameter values in functions with js(code) 2023-03-09 12:50:14 +00:00
Zalim Bashorov 4d7cf81ed0 [Wasm] Stop supporting "_export.js" in test infra, use import/export capability in relevant tests
* It works slightly differently in SpiderMonkey.
* It was a hack.
2023-03-06 23:19:02 +01:00
Zalim Bashorov bec827b654 [Wasm] Update SpiderMonkey to 112.0a1 (2023-03-04-09-52-24) 2023-03-06 23:19:02 +01:00
Svyatoslav Kuzmich 01fcc84d73 [Wasm] Refactor callingWasmDirectly.kt test from @JsFun to @WasmImport 2023-03-03 19:39:11 +00:00
Svyatoslav Kuzmich 7175b9f31c [Wasm] Migrate usages of @JsFun to js("code") 2023-03-03 19:39:10 +00:00
Svyatoslav Kuzmich 71e6b19760 [Wasm] Support restricted version of js("code") (KT-56955) 2023-03-03 19:39:09 +00:00
Svyatoslav Kuzmich 3c35328c09 [Wasm] Fix overriding external fun with default parameters (Fix KT-56976) 2023-03-03 12:33:53 +00:00
Zalim Bashorov b02279de14 [Wasm] Run wasm test using all available VMs: V8 & SpiderMonkey for now
Also, add a new directive, `WASM_FAILS_IN`, to specify VMs where a test is expected to fail for now.

#KT-56166 Fixed
2023-01-27 17:57:50 +01:00
Svyatoslav Kuzmich d14d4c8510 [Wasm] Support JsModule and JsQualifier 2023-01-13 21:58:34 +00:00
Svyatoslav Kuzmich 1564de5859 [Wasm] Support external vararg
Initial implementation copies Wasm array to JS array and spreads it
2023-01-11 10:35:36 +00:00
Igor Yakovlev fc80104d55 [Wasm] Fix external functions import clashing 2022-12-29 11:57:47 +00:00
Igor Yakovlev dc2dcfffee [Wasm] Enable passing test 2022-12-29 11:57:45 +00:00
Igor Yakovlev 1b2b7ce34c [Wasm] Support Number type for external functions 2022-12-29 11:57:45 +00:00
Igor Yakovlev 4dedd47172 [Wasm] Fix JsName external declarations 2022-12-29 11:57:45 +00:00
Svyatoslav Kuzmich 9d099348ba [Wasm] Disable interop adapters for WasmImport
Merge-request: KT-MR-8152
2022-12-28 17:33:51 +00:00
Svyatoslav Kuzmich dd53998c2d [Wasm] Add uninstantiated MJS wrapper
It allows

* Custom imports
* Ability to skip initializer
2022-12-28 12:13:52 +01:00
Svyatoslav Kuzmich 3bbd8c291a [Wasm] Add @WasmImport annotation
Imports top-level function from given module
2022-12-28 12:13:18 +01:00
Svyatoslav Kuzmich d788adcbb5 [Wasm] Move non-recursive function types out of rec group
This fixes linking with other wasm modules with non-rec types
2022-12-21 20:20:13 +00:00
Dmitriy Novozhilov b174bb8844 [FIR] Update testdata after introducing FirResolvedErrorReference 2022-12-15 12:12:19 +00:00
Ilya Chernikov 78ca733c38 FIR JS: add K2 variants of all other JS tests
except tests that are not possible to add without some modifications in
the test infra. See todos on the commented-out test declarations
2022-11-12 16:28:24 +01:00
Igor Yakovlev 5218acd5c9 [WASM] Optimise interop adapters 2022-10-18 20:48:12 +02:00
Igor Yakovlev 081cd4a4a8 [WASM] Support nullable types for external functions 2022-09-22 11:54:04 +02:00
Svyatoslav Kuzmich 11c8c01a50 [Wasm] Update v8 shell to v10.5.207 2022-07-19 18:46:52 +02:00
Igor Yakovlev 6f88e9b16f [WASM] Fix interop adapter for long strings 2022-06-28 18:00:40 +00:00
Svyatoslav Kuzmich d1c81eb6ba [Wasm] Support Wasm GC milestone 5 2022-05-20 12:22:43 +03:00
Svyatoslav Kuzmich 4636f71076 [Wasm] Loader improvements
- Output ES modules instead of plain files
- Support -Xwasm-launcher=d8 for d8 shell used in tests and benchmarks.
- Reuse launcher generation logic in CLI and box tests runners.
- Create separate output directory for each box since
  there are multiple output files generated for each test.
- Stop using absolute paths in generate JS files
  to simplify running generated code on different machine
- Remove ">>>" from println output


Merge-request: KT-MR-5729
Merged-by: Svyatoslav Kuzmich <svyatoslav.kuzmich@jetbrains.com>
2022-02-10 22:59:44 +00:00