Commit Graph

85 Commits

Author SHA1 Message Date
Dmitriy Novozhilov 3f5e6a79c7 Replace all throw error(...) with just error(...)
`throw` is not needed in this case, because `error(...)` already
  raises exception (so `throw` is unreachable). Also after previous
  commit compiler reports `UNREACHABLE_CODE` warning on such `throw`
2021-07-02 17:55:21 +03:00
Ilya Gorbunov e450a6494a Migrate deprecations in core, compiler, idea, tests
Replacing deprecated Char.toInt() with Char.code and
Number.toChar() with Number.toInt().toChar(), where Number is not Int.

KT-23451
2021-04-07 18:30:20 +03:00
Roman Artemev 46b98a1e98 [JS BE] Make sourceMap generation more precise
- Don't produce mapping for closing bracket in case of expressionBody
 - Map Kt*Function declaration into corresponding js fun declaration
 - Update test data & add new test
2019-07-24 18:56:40 +03:00
Anton Bannykh a3aca662c1 JS: improve json parsestring 2019-05-28 23:33:17 +03:00
Anton Bannykh 56915d1c07 JS: optimize JSON parser 2019-05-28 23:33:17 +03:00
Marcin Moskala 686cfa6fd2 Fix common misspellings 2018-12-21 16:13:42 +03:00
Alexander Udalov f868964e25 Fix most unchecked/deprecation javac warnings in compiler modules 2018-10-17 18:39:49 +02:00
Alexey Tsvetkov b0e8c85e88 Compare JS source maps in readable way in IC tests 2018-04-19 05:18:54 +03:00
Alexey Andreev 8514a7706f Remove json.org library, use own JSON parser to parse source maps 2017-11-29 20:08:29 +03:00
Alexey Andreev 729715ec62 Add simple JSON parser 2017-11-29 19:43:28 +03:00
Alexey Andreev a6e98c30d7 JS: fix crash when js function contains assignment with bad LHS
Fix KT-20905
2017-10-30 13:08:35 +03:00
Alexey Andreev cb0482f53e JS: fix crash when js function contains for statement w/o initializer
Fix KT-20898
2017-10-23 17:19:49 +03:00
Alexey Andreev 8cdef4139e Fix JS DCE removing reachable functions 2017-10-10 18:59:18 +03:00
Alexey Andreev 9008791a54 JS: generate paths in source maps relative to .map file location
See KT-19818
2017-10-06 15:24:25 +03:00
Alexey Andreev 27e319a279 JS: fix parsing of object literals in js() function.
Also, fix generation of source maps of content of js() function.

See KT-19794
2017-10-04 12:01:51 +03:00
Alexey Andreev 0269c3309a JS: fix parsing of wrong delete operation in js function.
See KT-15294
2017-09-29 14:32:49 +03:00
Alexey Andreev c66bc0b0e9 Remap source maps in JS DCE. Improve JS DCE error logging
See KT-19821
2017-09-08 18:27:41 +03:00
Alexey Andreev 8c256b24dc Avoid duplication of imports introduced during JS inlining 2017-09-04 15:33:10 +03:00
Alexey Andreev 445a80c755 Support new JS inline function format in multi-module projects 2017-09-04 15:33:03 +03:00
Alexey Andreev 5a9adcca2d Improve performance of JS tests
* Do not read protos for descriptors of stdlib and kotlin-tests
  repeatedly
* Parse libraries lazily in inline, so that when no inline function
  exist in a test, we won't parse huge kotlin.js file
* Speed-up source map parser
2017-07-11 11:06:52 +03:00
Alexey Andreev 1e74325c52 Generated source map for JS function's closing curly bracket 2017-07-06 10:20:44 +03:00
Alexey Andreev dea73ebecf Refactor generator of JS source map
- refactor pipeline for generation of source map
- generate "empty" mappings for nodes that impossible
  to map to something reasonable
- generate more accurate locations in source maps for specific
  JS AST nodes
- for binary operation nodes parser now returns location
  of binary operator tokens instead of location of first operand
- change completely how source map remapper works
2017-07-06 10:20:41 +03:00
Alexey Andreev a0e1bde594 Allow to embed source files into JS source maps 2017-06-26 18:15:28 +03:00
Alexey Andreev bf21cfd6e0 Use source map remapper in JS inliner 2017-06-07 11:13:55 +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 c5bf76578a Add test infrastructure for JS source map parser and generator 2017-06-07 11:13:52 +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 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 e9a2c8c0f1 Prevent JS AST nodes of several types to be shared 2017-05-30 12:48:47 +03:00
Alexey Andreev 4bb1130f3f Fix translation of labels with non-identifier names in JS BE
See KT-18027
2017-05-29 15:37:31 +03:00
Alexey Andreev ca7062d776 Fix JS parser to properly handle "." <keyword> sequence 2017-05-26 18:20:16 +03:00
Alexey Andreev 9e89213d66 Prototyping DCE tool for JS 2017-05-26 18:20:15 +03:00
Zalim Bashorov c021af0fef KJS: fix non-local return inside catch block 2017-04-19 20:20:21 +03:00
Alexey Andreev b11e33901b Fix parsing of JavaScript number literals out of integer range
Fix KT-17219
2017-04-17 14:17:08 +03:00
Mikhail Glukhikh d0cc1635db Cleanup: apply "Use synthetic property access syntax" 2017-03-15 16:13:40 +03:00
Alexey Andreev f33d421bab JS: make JS parser to store function's name in AST. See KT-15475 2017-01-12 18:12:40 +03:00
Zalim Bashorov 316da8331f KJS: relocate com.google.dart.compiler -> org.jetbrains.kotlin 2017-01-09 17:14:19 +03:00
Alexey Andreev d2fdc7ffc0 JS: when both clauses of if become empty during optimization, remove if entirely. Make condition and then clause of JsIf non-nullable. Fix #KT-13912 2016-11-17 12:20:37 +03:00
Valentin Kipyatkov b551886889 Code cleanup: removed redundant semicolons 2016-04-29 11:26:25 +03:00
Alexey Andreev af7ddb4572 Adds test infrastructure for JS optimizer. Adds simple tests 2016-04-05 14:40:24 +03:00
Ilya Gorbunov 744a7a83f7 Cleanup RC deprecations in compiler and plugin. 2016-01-27 18:34:30 +03:00
Dmitry Jemerov d6a11b839b js: cleanup 'public', property access syntax 2016-01-07 18:15:19 +01:00
Michael Bogdanov aeb6486473 Deprecated 'INSTANCE$' replaced with 'INSTANCE' 2015-12-24 13:59:43 +03:00
Yan Zhulanow 278f1cd6ef Fix "Placing function type parameters after the function name" errors in project 2015-11-27 15:51:11 +03:00
Yan Zhulanow e14c9645dc Error on 'if' without an 'else' branch when used as an expression 2015-10-19 03:56:15 +03:00
Alexey Tsvetkov efba2a2372 JS: make JsEmpty singleton 2015-04-16 21:17:09 +03:00