Commit Graph

1415 Commits

Author SHA1 Message Date
Alexander Udalov 8dae1b62dd Add CharSequence.subSequence
This is done primarily for JVM interoperability, otherwise it's impossible to
inherit from CharSequence there. On JS subSequence at the moment just invokes
substring.

 #KT-5956 Fixed
2014-11-27 20:38:19 +03:00
Alexander Udalov 4d95bcfc7e Rename CharSequence.get to charAt
This is done for JVM interoperability. There's still a member function
String.get() and an extension function "get" on CharSequence

 #KT-1730 Fixed
 #KT-5389 Fixed
2014-11-27 20:38:18 +03:00
Alexander Udalov a7b88e9485 Make CharSequence.length a function instead of property
And String.length as well.

This is done for JVM interoperability: java.lang.CharSequence is an open class
and has a function 'length()' which should be implemented in subclasses
somehow.

A minor unexpected effect of this is that String.length() is now a compile-time
constant (it wasn't such as a property because properties are not supported in
compile-time constant evaluation)

 #KT-3571 Fixed
2014-11-27 20:38:17 +03:00
Zalim Bashorov 04f6d50423 Minor in JS stdlib: annotate volatile and synchronized as native.
Don't generate code for this classes to avoid warnings from some minifiers.
Note: volatile and synchronized was reserved word in ECMAScript 2, but is not since ECMAScript 5.
2014-11-25 21:11:17 +03:00
Andrey Breslav 2a334fc8f5 Support JS-targeted diagnostic tests 2014-11-25 18:45:43 +03:00
Valentin Kipyatkov ddc60ac5dd Better injecting of partial body resolve filter 2014-11-24 20:11:28 +03:00
Pavel V. Talanov bce399f5fd Rename: AnalyzeExhaust -> AnalysisResult 2014-11-21 15:56:05 +03:00
Zalim Bashorov 14fd6eaaeb Minor: added missed quote and space. 2014-11-18 15:57:50 +03:00
Stanislav Erokhin eb50e4adb3 Inject StorageManager to ResolutionTaskHolder 2014-11-17 17:38:52 +03:00
Nikolay Krasko e1d51e9879 Minor: code enhancements 2014-11-17 16:15:22 +03:00
Alexander Udalov 93696ff9bd Make Array.indices extension property, move to stdlib
This is not something that needs to be intrinsified. Note that compiler
optimizations are still possible and the fact whether 'indices' is a member or
an extension is irrelevant to the optimizer
2014-11-17 15:20:44 +03:00
Alexander Udalov 128c938965 Make Array.size() a function instead of a property
Also add a deprecated extension property to help migration. This is done to
unify getting size of arrays and collections
2014-11-17 15:02:38 +03:00
Valentin Kipyatkov 5f5d2de5e0 Moved KindFilter and DescriptorKindExclude out of JetScope, moved constants as well and renamed them 2014-11-12 21:57:49 +03:00
Valentin Kipyatkov 95b3885aa5 Refactored filtering by descriptor kind so that no knowledge about SAM-constructors required in core 2014-11-12 21:25:02 +03:00
Valentin Kipyatkov 6f2da4930a Descriptor kind filter replaced with bit mask 2014-11-12 21:24:59 +03:00
Valentin Kipyatkov 1983a9f3da Replaced usages of JetScope.getAllDescriptors() with JetScope.getDescriptors() (where makes sense) 2014-11-12 21:24:55 +03:00
Michael Nedzelsky dd86823480 JS backend: compile some builtins to builtins.js instead of stdlib 2014-11-11 17:09:00 +03:00
Michael Nedzelsky 5f576c4c05 JS backend: test for toGenerator from stdlib 2014-11-11 17:08:56 +03:00
Andrey Breslav 7d9be42969 LazinessTokens introduced to enable/disable building lazy types 2014-11-08 15:51:41 +02:00
Andrey Breslav 2334bf4c70 Resolution of type constructors in TypeResolver is now lazy (for types in declarations) 2014-11-08 15:51:41 +02:00
Andrey Breslav 266262df68 TypeResolver converted to Kotlin 2014-11-08 15:51:40 +02:00
Zalim Bashorov e457eea438 Use JarFileSystem for collect kotlin files inside archive instead of own implementation. 2014-11-07 16:30:52 +03:00
Zalim Bashorov b3defdbf90 JS tests: create JetFiles by JetPsiFactory instead of by PsiManager to avoid to access to PsiManager after it disposed.
That fixed js tests after changes in DiagnosticsWithSuppression.
2014-11-07 16:30:51 +03:00
Zalim Bashorov cd20301283 JS frontend: suppress warnings from stdlib. 2014-11-07 16:30:51 +03:00
Zalim Bashorov c8556ec1f7 JS frontend: suppress UNUSED_PARAM for native declarations.
#KT-2141 Fixed
2014-11-07 16:30:51 +03:00
Ilya Ryzhenkov ad1a2c4000 Update generated code to move "type" member into its place after it was demoted from keyword. 2014-11-06 16:45:58 +03:00
Ilya Ryzhenkov c2fabf5736 Comparator<T> replaced with Comparator<in T> #KT-6030 Fixed 2014-11-06 16:45:57 +03:00
Alexey Tsvetkov fb8918bbe6 JS backend: removed adding '$' to label suffix 2014-10-27 15:58:49 +03:00
Alexey Tsvetkov 78e12f7cfa JS backend minor: removed license from test cases 2014-10-27 15:58:49 +03:00
Andrey Breslav f06e5581aa Support creating flexible types in tests
Flexible types can not be created in normal user code, but if there's a special classifier `kotlin.internal.flexible.ft` with two type parameters,
its occurrences are replaced by flexible types, e.g. `ft<Int, Int?>` becomes `Int!`
2014-10-22 00:41:18 +04:00
Zalim Bashorov 8067a9ad56 Added regression tests for KT-2474 Range lacks reverse() in JavaScript backend
#KT-2474 Fixed
2014-10-21 22:46:09 +04:00
Zalim Bashorov 66519d9973 Added regression tests for KT-1906 Support invoke() convention is js-backend (including classes implementing Function trait)
#KT-1906 Fixed
2014-10-21 22:46:09 +04:00
Zalim Bashorov f3d9d21757 Added regression tests for KT-3518 Null pointer during null comparison in JS Backend. 2014-10-21 22:46:09 +04:00
Zalim Bashorov b3e34cc2b4 Minor: added regression tests for downTo.
Adopted tests from patch attached to KT-2586.
2014-10-21 18:25:17 +04:00
Zalim Bashorov fedbe26480 Minor: added regression tests for KT-4235
#KT-4235 Obsolete
2014-10-21 18:25:16 +04:00
Zalim Bashorov 335771d580 JS lib: provide Kotlin object as parameter of IIFE. 2014-10-21 14:49:00 +04:00
Zalim Bashorov 98d62283c7 JS lib: simplify DefaultPrimitiveHashSet. 2014-10-21 14:49:00 +04:00
Alexander Udalov 51fd654802 Regenerate injectors and keyword strings
After recent changes to Printer
2014-10-21 00:16:08 +04:00
Alexander Udalov f8be39b26b Regenerate tests
After recent changes to Printer and TestGenerator
2014-10-21 00:16:08 +04:00
Alexander Udalov 91105b8183 Minor, fix some warnings in DeclarationsChecker 2014-10-21 00:16:06 +04:00
Alexey Tsvetkov 1f87bea78f JS backend: added support for nested labels with the same name
#KT-5891 fixed
2014-10-20 19:51:35 +04:00
Alexey Tsvetkov 09c98226c8 JS backend: added tests for labels 2014-10-20 19:51:35 +04:00
Alexey Tsvetkov 0bc05135d8 JS test minor: renamed InlineTestUtils to DirectiveTestUtils 2014-10-20 19:51:35 +04:00
Alexey Tsvetkov 6d16d06120 JS test: extracted test with ast access and directives 2014-10-20 19:51:34 +04:00
Alexander Udalov 624e507ec2 Make enum classes comparable
#KT-3727 Fixed
2014-10-17 21:27:23 +04:00
Michael Nedzelsky 34269e1a3e JS backend: fix KT-6037 (default arguments in simple function with expression as body)
#KT-6037 Fixed
2014-10-17 00:46:05 +04:00
Alexey Tsvetkov 5fb5cea4a3 JS inline: fixed bug with simple return inline function, when result is not used.
When function body can be expression
(contains only one statement, and it's return),
 result was saved to resultExpr, not body.

 But when result was not used, resultExpr was not
 used then.

 Fixed by checking, that result is used in first place.
2014-10-16 17:16:10 +04:00
Alexey Tsvetkov be82d4c661 JS backend: increment counter for fresh names 2014-10-16 17:16:10 +04:00
Zalim Bashorov f0078b5e0f JS lib: export Kotlin object when it possible.
It allows use kotlin.js on node.js without modifications.
2014-10-14 18:02:28 +04:00
Zalim Bashorov 55c19a632a JS lib: introduced different output strategies, and chose them depending of environment.
#KT-2994 Fixed
2014-10-14 18:02:28 +04:00