Commit Graph

200 Commits

Author SHA1 Message Date
Ilya Goncharov 9b4821be28 [Gradle, JS] Add module dom-api-compat
This reverts commit ba8cc877fd.
2023-02-22 11:00:11 +00:00
Artem Kobzar d39fd9416a [Build] Fix compilation of kotlin-js(-ir) libraries in 1.9.0 (stdlib and test) 2023-02-18 13:26:53 +00:00
Alexander Korepanov 9324cf3360 [JS IR] Support function type interfaces in incremental cache infrastructure
The patch removes logic of generating extra IrFiles (fake file) into
 IrModuleFragment for the function type interfaces during klib deserialization,
 because IC infrastructure can not process files which do not exist in klib.

 Instead of adding extra IrFiles during deserialization, the empty files
 with required packages are added into Kotlin/JS stdlib physically.
 These files are used as containers for function type interface declarations.

 Since Kotlin/WASM uses the same klib loading infrastructure as Kotlin/JS,
 the the empty files are added into Kotlin/WASM stdlib as well.

 The patch also adds a check that IrModuleFagment has files only from klib.

^KT-55720 Fixed
2023-02-03 12:23:48 +00:00
Ilya Goncharov d7c31f79a8 Do not suppress NPM related tasks, but be aware about checking of them in task graph 2023-01-19 13:43:57 +00:00
Artem Kobzar 71486a321c [K/JS] Add support of compilation with ES-classes 2023-01-17 18:14:17 +00:00
Abduqodiri Qurbonzoda ba2833b90f Mark Base64 API with ExperimentalEncodingApi 2023-01-16 11:24:50 +00:00
Artem Kobzar 642bbd38ba [K/JS] Move global interface id state into an object to prevent interface ids reinitialization ^Fixed KT-55758 2023-01-09 20:56:19 +00:00
Ilya Goncharov ba8cc877fd [Gradle, JS] Remove module dom-api-compat 2023-01-04 16:30:33 +00:00
Ilya Goncharov 688894aabc [JS, Stdlib] Move DOM API to separate module kotlin-dom-api-compat
[JS, Stdlib] Leave sources of dom api inside stdlib

[Stdlib, JS] Leave ItemArrayLike inside stdlib
2022-12-22 15:45:23 +00:00
Artem Kobzar 8a89b2f29f [K/JS] Remove the old interface runtime check because of bootstrapping
Merge-request: KT-MR-7457
Merged-by: Artem Kobzar <Artem.Kobzar@jetbrains.com>
2022-10-21 11:34:31 +00:00
Ilya Gorbunov 607f15b55b Sycnhronize docs of primitives in JS-IR, Wasm, Native sources 2022-10-02 19:04:37 +00:00
Artem Kobzar 73e7053c35 [K/JS] Use only single variant of default arguments function wrapper for exported and not-exported functions 2022-09-19 17:49:04 +00:00
Artem Kobzar d9c5f100db [K/JS] Use intrinsics instead of new functions in IR backend. 2022-09-19 13:04:16 +00:00
Artem Kobzar a368fc37c7 [K/JS] Make interface subtyping faster and lighter. 2022-09-19 10:26:11 +00:00
Nikolay Krasko 01f567a16d Disable yarn and npm tasks from the build when tests are not active
Kotlin build shouldn't depend on npm during while deploy artefacts tasks

^KTI-887 Fixed
^KT-53687 Related
2022-08-30 22:15:16 +00:00
Ilya Gorbunov 203a00151d rangeUntil member operator in builtins #KT-52933 2022-08-24 22:22:53 +00:00
Artem Kobzar 87038e7d8a [K/JS] feat: add logic under the flag for strict implicit export generating inside d.ts files. 2022-08-09 16:48:59 +00:00
Ilya Gorbunov cd9b36b4c3 Introduce OpenEndRange and make primitive ranges implement it
#KT-52932
2022-06-28 00:08:03 +00:00
Nikolay Krasko 405e90abee Apply -Xklib-relative-path-base to all KotlinCompile tasks
As absolute paths were also revealed in
   atomicfu.jar
   kotlin-stdlib-wasm
   kotlin-test-wasm

Use solution from Alexander Likhachev (avoid accessing
buildDir, projectDir in doFirst()) to prevent breaking the configuration
cache.

Should be removed after fixing KT-50876

KTI-729
2022-04-07 19:17:20 +00:00
Ilya Gorbunov 000165b12b Fix incorrect conversion of Long to String in base 36 in JS KT-48924 2022-03-30 06:13:51 +00:00
Artem Kobzar 0153f5d92a chore: set isComplete flag also for interfaces that do not contain constructor fields. 2022-03-21 18:53:04 +00:00
Artem Kobzar ac542d4c01 feat(JS/IR isInterfaceImpl perf): improve isInterfaceImpl performance by memoize an result. 2022-02-28 20:28:10 +00:00
Artem Kobzar 804eb61bf0 feat: add polyfills insertion for ES Next used features 2022-02-16 10:49:11 +00:00
Alexander Korepanov 769fbcf3d0 [JS IR] Improve performance for runtime typecheck
This is a part of KT-42743
2022-01-31 09:15:58 +00:00
Sergej Jaskiewicz d5e46e0607 [JS IR] Introduce intrinsics for slicing array-like objects 2022-01-27 11:06:16 +00:00
Sergej Jaskiewicz 08e6116ecb [JS IR] Introduce jsArguments() intrinsic function
`jsArguments()` is lowered into a reference of the `arguments` object.

This is useful for extracting varargs, when calling Kotlin code from
JavaScript. For a concrete example, see KT-15223.
2022-01-27 11:06:16 +00:00
Dmitriy Dolovov 3ec4a8d6f3 [IR] Rename LinkageError symbol to IrLinkageError
This is needed to 1) avoid ambiguity about the type of linkage used in Kotlin/Native compiler, 2) have the same exception name in JS and Native backends.

^KT-50775
2022-01-26 13:36:24 +03:00
Nikolay Krasko da556452c9 Use project directory as a base for stdlib js build
Some sources for kotlin-stdlib-js-ir are not copied to build dir
and used directly from the project.

Modify kotlin.test/js-ir as well, while there's no evidence of the
problem so far.

Should be removed after KT-50876 fix.

^KTI-730 In Progress
2022-01-25 00:58:54 +03:00
Nikolay Krasko 87bf6e010e Use relative paths in stdlib klib artifacts
Intentionally use doFirst section to trick gradle and not affect
inputs with absolute path usage.

Old behaviour can be returned by kotlin.build.use.absolute.paths.in.klib
in local.properties

Should be removed after KT-50876 fix.

^KTI-730 In Progress
2022-01-20 21:50:20 +03:00
Sergej Jaskiewicz ceb744b53b Revert "[JS IR] [runtime] Remove valueOf method from Long"
This reverts commit e13b6b2a90.

The significance of the breakage caused by the removal of `valueOf`
was underestimated.

#KT-50202 Open
2022-01-18 10:33:54 +00:00
Ilya Gorbunov 906a351a81 Regenerate standard library generated code 2022-01-17 15:38:27 +03:00
Sergej Jaskiewicz 6dc69adcc9 [JS IR] Don't mark Char as a value class
Char will still be treated as a value class
(see JsInlineClassesUtils.kt)
2021-12-16 12:46:11 +00:00
Sergej Jaskiewicz 86cabf3bb7 [JS IR] Use Uint16Array as CharArray's storage 2021-12-02 12:39:41 +00:00
Sergej Jaskiewicz 67dfe7bed1 [JS IR] Make Char a value class (again)
#KT-35100 Fixed
2021-12-02 12:39:40 +00:00
Sergej Jaskiewicz e13b6b2a90 [JS IR] [runtime] Remove valueOf method from Long
This method was used for coercing `Long` values to JavaScript
`number`. However, it caused issues when `Long` values were
concatenated to a string (see KT-8666, KT-26706).
2021-12-01 12:36:34 +00:00
Artem Kobzar 08b0e17d47 feat(polyfills): use stdlib for js polyfills. 2021-11-26 08:14:34 +00:00
Roman Artemev 7f27ebc589 [JS IR] Add API to js runtime to throw linkage errors 2021-11-19 01:16:35 +03:00
Anton Bannykh ee6d3ea281 [JS IR] mark coroutine intrinsics as inline
They are de-facto inlined, but their bodies don't get
loaded when using the "no bodies except for inline functions"
deserializtion mode.
2021-11-19 00:39:06 +03:00
Svyatoslav Kuzmich a6afb7cb41 [JS IR][Wasm] Preload (Suspend)FunctionN needed in lowerings
This reverts commit 15d178d850d15675ee39cbd833d13f4c8aed83ff.
2021-10-12 08:42:01 +03:00
Svyatoslav Kuzmich 3bce0cc055 [Wasm] Support coroutines
- Reuse JS IR Suspend function lowering
  - Fix types
  - Disable reinterpretCast-based optimization for inline
    classes
- Add basic support to Wasm stdlib
- Explicitly transform suspend functions into regular functions
  with continuations
- Clean suspend function handling from JS IR codegen
2021-10-12 08:42:01 +03:00
Ilya Goncharov b5fb0d9f33 [JS IR] Deprecate safeProperty(Get|Set) methods from stdlib 2021-10-01 13:21:19 +00:00
Ilya Goncharov 42e8017cc7 [JS IR] Revert removing of safeProperty(Get|Set) 2021-09-24 07:07:12 +00:00
Ilya Goncharov 064744fae7 [JS IR] Remove redundant legacy property access property 2021-09-24 07:07:12 +00:00
Abduqodiri Qurbonzoda f1befc0108 Format Other_Uppercase/Other_Lowercase property as an identifier in docs 2021-09-15 17:31:52 +03:00
Mikhail Glukhikh ed035d99ab Migrate -Xopt-in to -opt-in in Gradle Kotlin scripts 2021-09-03 15:40:47 +03:00
Abduqodiri Qurbonzoda 0faa83bacb Deprecate JS Array/PrimitiveArray.sort(comparison) functions 2021-09-02 01:38:03 +00:00
Ilya Goncharov 766857881a [JS IR] Review remarks
- Use intrinsic on this
- Enqueue invoke for DCE
- Change transform
- Ignore instead of target backend

^KT-46204 fixed
2021-08-10 07:24:51 +00:00
Ilya Goncharov a28138eb72 [JS IR] Change js function on Kotlin code
^KT-46204 fixed
2021-08-10 07:24:49 +00:00
Ilya Goncharov 627af332b1 [JS IR] Use PublishedApi for intrinsic
^KT-46204 fixed
2021-08-10 07:24:48 +00:00
Ilya Goncharov e6af3ff6a8 [JS IR] Rename and doc new intrinsics, add new intrinsic to call suspend fun as supertype
^KT-46204 fixed
2021-08-10 07:24:48 +00:00