Commit Graph

3539 Commits

Author SHA1 Message Date
Ilya Gorbunov 4798c029de Limit visibility of sublists, make them implement RandomAccess 2017-06-10 10:00:15 +03:00
Anton Bannykh 46d9d296ca JS: use '/' as separator on all platforms to prevent sourcemap parse errors 2017-06-09 20:32:22 +03:00
Alexey Andreev 4252d9786b Fix translation of interface with non-abstract methods in JS BE
Fix additional case of generic interfaces in KT-18187
2017-06-08 13:51:18 +03:00
Alexey Andreev 59240a4bd9 Report errors in JS source maps as compiler warnings 2017-06-07 11:13:55 +03:00
Alexey Andreev bf21cfd6e0 Use source map remapper in JS inliner 2017-06-07 11:13:55 +03:00
Alexey Andreev 9c4ec902b0 Fix test broken by changes in JS source maps 2017-06-07 11:13:54 +03:00
Alexey Andreev e43cc65702 Fix location reported by JS parser in case of long lines 2017-06-07 11:13:54 +03:00
Alexey Andreev 1dae687e7d Fix support of - and + prefix operators in JS parser
Treat number literal that represents minimum integer as integer node in
JS AST.

Treat +<number_literal> JS AST as unary node (+) containing single
number literal
2017-06-07 11:13:53 +03:00
Alexey Andreev 590954e9a8 Add processor that removes location from ambiguous JS AST nodes
There are cases when it's impossible to distinguish which JS node
owns location denoted by source map. Consider example:

a + b

Both root JsBinaryNode and its arg1 point to the same start location.
Out translator provides full information, though parser can't
produce the same AST. The second AST will miss some of the locations
available on the first one. This processor gets AST node produced
by translator and removes locations from there so that both ASTs
become equal.
2017-06-07 11:13:53 +03:00
Alexey Andreev c5bf76578a Add test infrastructure for JS source map parser and generator 2017-06-07 11:13:52 +03:00
Alexey Andreev ca738a9536 Prevent JS source map builder from inserting overlapping mappings
Check if newly inserted mapping is in the same position within
JS line and in this case omit the mapping
2017-06-07 11:13:51 +03:00
Alexey Andreev 174068c462 Add JS source map parser and remapper
JS source map remapper takes parsed source maps
together with JS AST with correct JS positioning information
and converts the latter into Kotlin positioning information
2017-06-07 11:13:51 +03:00
Alexey Andreev e784d1846e Fix warning in BasicBoxTest (JS) 2017-06-07 11:13:50 +03:00
Alexey Andreev 93ec81d2eb Add source information to parsed JS AST 2017-06-07 11:13:50 +03:00
Alexey Andreev 1d1da326be Refactor JS parser 2017-06-07 11:13:49 +03:00
Alexey Andreev 3a3720db8d Reformat JS parser for conformance with project's style settings 2017-06-07 11:13:49 +03:00
Alexey Andreev 41ad637bad Fix warnings in JS parser 2017-06-07 11:13:48 +03:00
Alexey Andreev 9d186cfc66 Fix JS source maps for temporary variables 2017-06-07 11:13:47 +03:00
Alexey Andreev 27a44f3282 Fix JS source maps for complex enum entry 2017-06-07 11:13:47 +03:00
Alexey Andreev b70c52e41f Fix JS source maps for optional arguments
Also, when function has expression body, use expression instead
of function declaration to mark return statement.
2017-06-07 11:13:46 +03:00
Alexey Andreev 6f0e4c4deb Fix JS source maps for data class synthetic methods 2017-06-07 11:13:46 +03:00
Alexey Andreev 5bc6c07f9e Fix JS source maps for companion objects of enum 2017-06-07 11:13:45 +03:00
Alexey Andreev c9545f291a Fix JS source maps for properties without initializer 2017-06-07 11:13:44 +03:00
Pavel V. Talanov bdf76f23c4 Jvm Codegen: do not throw on malformed delegation to a type parameter
Fix exception on light class building

See KT-15931
2017-06-06 17:11:19 +03:00
Alexander Udalov 7febd846e8 Export 'intellij-core' in module 'frontend'
Remove intellij-core from dependencies of modules which already depend
on frontend or any module that exports frontend (such as frontend.java)
2017-06-06 14:29:26 +03:00
Alexander Udalov cbaa676c3d Move some declarations between 'descriptors' and 'deserialization'
- Move the following from 'deserialization' to 'descriptors':
  NotFoundClasses.kt
  AdditionalClassPartsProvider.kt
  ClassDescriptorFactory.kt
  PlatformDependentDeclarationFilter.kt
  findClassInModule.kt
- Move the following form 'descriptors' to 'deserialization':
  BuiltInSerializerProtocol.kt
  builtInsPackageFragmentProvider.kt
- Extract a marker interface from BuiltInsPackageFragment and move its
  implementation to 'deserialization'
- Change the type of parameters in PlatformDependentDeclarationFilter
  and AdditionalClassPartsProvider to ClassDescriptor

This will help in getting rid of the circular dependency of
'descriptors' <-> 'deserialization'
2017-06-06 14:29:18 +03:00
Alexey Andreev b6d12fe7f3 Fix bug in re-importing modules from inline declarations in JS
Fix another case in KT-18201
2017-06-06 13:36:19 +03:00
Alexey Andreev 3180ea24d1 Fix assertion in test for reimporting declarations in JS 2017-06-05 11:21:41 +03:00
Alexey Andreev 1df6f2f9a0 JS BE: expose imported modules via $$importsForInline$$ property
... and use it as prefix to FQN in inline functions. This allows
to properly inline function declared in module A to module B,
when this function calls another function in module C.

See KT-18201
2017-06-02 14:18:42 +03:00
Dmitry Petrov d559212d70 Optimize out trivial INSTANCEOF checks
#KT-18157 Fixed Target versions 1.1.4
2017-05-31 16:48:14 +03:00
Alexey Andreev e6b0cc64bd Fix copying of non-abstract functions of interfaces in JS BE
Fix copying of non-abstract functions of interfaces to implementing
classes when implementing class inherits interface via 2+ paths.

See KT-18187
2017-05-31 11:21:13 +03:00
Dmitry Petrov 78de1fb72c Handle incorrect code for interface delegation
#KT-15931 Fixed Target versions 1.1.4
2017-05-31 10:18:48 +03:00
Alexey Andreev 4346fb5c23 Minor refactoring of JS AST nodes representing boolean literals 2017-05-30 12:49:00 +03:00
Alexey Andreev 5715803b96 Fix incremental recompilation of JS source maps
Note that this breaks binary compatibility.
It should be OK, since nobody is using incremental compilation API
for now.
2017-05-30 12:48:59 +03:00
Alexey Andreev ed592452a3 Fix JS source maps for functions with expression body 2017-05-30 12:48:59 +03:00
Alexey Andreev 1014666937 Fix JS source maps for delegates and backing fields 2017-05-30 12:48:58 +03:00
Alexey Andreev 13795b47fb Fix JS source maps for initialization of variables captured by class 2017-05-30 12:48:58 +03:00
Alexey Andreev bfc3a9c2af Fix JS source maps for && expression with complex operands 2017-05-30 12:48:57 +03:00
Alexey Andreev 1111f2d5cd Fix JS source maps for while/do..while statements 2017-05-30 12:48:57 +03:00
Alexey Andreev 413ac40c25 Fix JS source maps for for statements 2017-05-30 12:48:56 +03:00
Alexey Andreev d7a10750e0 Fix JS source maps for lambdas 2017-05-30 12:48:55 +03:00
Alexey Andreev 82d37c0d57 Fix JS source maps for catch blocks 2017-05-30 12:48:55 +03:00
Alexey Andreev 6ad991adfb Fix JS source maps for "is" and "in" clauses in when expression 2017-05-30 12:48:54 +03:00
Alexey Andreev 9692c02f6e Fix JS source maps for string literals 2017-05-30 12:48:53 +03:00
Alexey Andreev 8dae399945 Fix generation of JS source maps for default parameters
(Of open member functions)
2017-05-30 12:48:52 +03:00
Alexey Andreev e1009622af Fix generation of JS source maps for call expressions 2017-05-30 12:48:52 +03:00
Alexey Andreev 6e489900cb Fix generation of JS source maps for long literals 2017-05-30 12:48:51 +03:00
Alexey Andreev 89e3fb7592 Keep JS AST source information after refreshing local names 2017-05-30 12:48:51 +03:00
Alexey Andreev ad89e5906f Fix JS source maps for increment expression used as statement 2017-05-30 12:48:50 +03:00
Alexey Andreev bad79dfa85 Fix JS source maps for return statement of inlined function 2017-05-30 12:48:49 +03:00