Commit Graph

47 Commits

Author SHA1 Message Date
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
Svyatoslav Kuzmich f833fc4bcb [Wasm] Default parameter values for external functions
+ import top-level external functions wrapped in lambdas
2021-11-17 19:28:14 +00:00
Ivan Kylchik c7435ba760 Replace all occurrences of WITH_RUNTIME with WITH_STDLIB
We are going to deprecate `WITH_RUNTIME` directive. The main reason
behind this change is that `WITH_STDLIB` directive better describes
its meaning, specifically it will add kotlin stdlib to test's classpath.
2021-11-17 15:26:38 +03:00
Svyatoslav Kuzmich 03c352c11e [Wasm] Lower complex external declarations
- Properties
- Member functions
- Object declarations
- Constructors
- Classes with instance checks
2021-11-10 19:48:11 +03:00
Svyatoslav Kuzmich c0761bf34a [Wasm] Support callable references to external functions
1. Move jsInteropFunctionsLowering after callable reference lowering,
  so it can continue to deal with just functions and function calls.
2. Generate lowered closure class in JsInteropFunctionsLowering because
2021-11-10 19:48:10 +03:00
Ivan Kylchik ef8199718e [JS TESTS] Move externals.js into main module in functionTypes.kt 2021-11-08 23:50:35 +03:00
Svyatoslav Kuzmich a13329fc65 [JS IR] Regenerate and mute test 2021-10-28 22:39:09 +03:00
Svyatoslav Kuzmich f7d3cb269f [Wasm] Support passing lambdas from Kotlin to JS 2021-10-28 18:47:38 +03:00
Svyatoslav Kuzmich 4fc461a2ff [Wasm] Imporove external interface support
* Support boxing/unboxing when casting to Any
* Support ===, equals, hashCode, toString

* Support adapting String in interop boundary
2021-10-23 01:26:12 +03:00
Svyatoslav Kuzmich 0abc798da9 [Wasm] Add JS interop tests 2021-09-16 14:20:35 +03:00