Commit Graph

447 Commits

Author SHA1 Message Date
David Sherret
93ffb9700b
Increase swc_ecma_parser_macros version to 0.4.1 in swc_ecma_parser (#736) 2020-03-28 13:54:53 +09:00
강동윤
706ae00523
Fix deeply nested optional chaining (#735)
- Handle deeply nested optional chaining expression correctly (Closes #732)
2020-03-28 11:59:45 +09:00
강동윤
2225679ea7
Fix capturing (#731)
Fix token capturing (Closes #728)
2020-03-26 14:56:54 +09:00
Muslim Guseinov
6a6013b14c
Fix enum default value transform (#730) 2020-03-26 10:53:35 +09:00
강동윤
ebc7070d1f
Fix parser (#727)
- Allow await in an yield expression (fixes #720)
 - Prevent duplicate tokens while capturing (fixes #726)
2020-03-25 17:40:05 +09:00
David Sherret
b17b249fa6
Fix union and intersection type start (#725) 2020-03-22 11:02:41 +09:00
David Sherret
b677115702
Fix async arrow expression and TsIndexSignature param ident spans (#721)
- Fix async arrow expression start.
- Fix TsIndexSignature inner ident and type ann spans.
2020-03-15 08:18:28 +09:00
강동윤
c7b12cd408
Fix bugs (#718)
- Handle inline source map (Closes #706)
 - Fix parsing of conditional expression starting with async (Closes #706)
2020-03-13 23:34:36 +09:00
강동윤
dc2e2fabbd
Allow optional binding pattern in ambient context (#715) 2020-03-10 13:59:32 +09:00
David Sherret
2f47d41f2b
Fix tagged template start to include tag (#714)
Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-03-10 12:35:42 +09:00
강동윤
6f4e534c88 Bump versions 2020-03-10 10:39:42 +09:00
David Sherret
5a2f9249b2
Fix class declaration with decorators start. (#711) 2020-03-10 10:38:56 +09:00
David Sherret
1e13299540
Fix arrow start in conditional expression. (#712) 2020-03-10 10:29:34 +09:00
강동윤
544090832d Bump 2020-03-10 00:41:04 +09:00
강동윤
da97acca20 Bump 2020-03-10 00:35:53 +09:00
강동윤
e448a8910c
Fix bugs (#710)
- The parser now supports parsing optional patterns in .d.ts files (Closes #709)
 - The source map is handled properly (Closes #705, Closes #707)
2020-03-09 21:18:41 +09:00
강동윤
759d671df1 Don't print 2020-03-05 11:20:49 +09:00
강동윤
e5a818aabd
Fix resolver and block_scoping (#700) 2020-03-04 16:07:17 +09:00
강동윤
6e028696a5
Faster sourcemap generation for large files (#697)
We buffer operations related to source map and make it fast using an assumption that the byte positions always increment while emitting a file.
2020-03-02 20:49:08 +09:00
강동윤
8f280c535c
Performance (#696)
- Parser performance is improved by ~15%
 - Codegen performance is improved by ~90% (when comment and source map is enabled)
2020-03-01 20:05:03 +09:00
강동윤
99b5018ba6
Fix ts enum with initializer (#694) 2020-02-29 14:54:10 +09:00
강동윤
3911ab75b9 Bump version 2020-02-29 10:34:10 +09:00
David Sherret
0e8c5a6c93
Fix assignment pattern start when there is a type annotation (#693)
- Update dashmap to 3.5.1

Co-authored-by: 강동윤 <kdy1997.dev@gmail.com>
2020-02-29 10:29:34 +09:00
강동윤
363b8353cf
resolver: handle hoisting correctly (#689) 2020-02-25 21:29:52 +09:00
강동윤
1cf86b059d
Fix bugs (#687)
- stript type-only export default
- allow `continue` in a for loop
2020-02-22 14:49:04 +09:00
강동윤
cb43a69e02
implement { Hash, Eq } for ast nodes (#684)
As NaN is`IIdent` not `Number`, we can use implement Hash and Eq for ast nodes.
2020-02-21 12:47:06 +09:00
강동윤
e3ca8e5d13
Fix bugs (#683)
- Fix block_scoping (Fix #682)
 - Handle new.target in susbscript position (Fix #675)
2020-02-20 13:06:28 +09:00
강동윤
f79223e98c
resolver: Handle method property correctly (#679) 2020-02-19 19:49:58 +09:00
강동윤
087e768810 Bump version 2020-02-19 12:55:41 +09:00
David Sherret
0d17f014e3
Fix tagged template span to include tag. (#677) 2020-02-19 12:50:07 +09:00
강동윤
53d09d448e
Handle await-for loop just like babel (#676) 2020-02-18 12:27:13 +09:00
강동윤
e709da9d55
Fix SourceMap (#672)
Previously, `SourceMap` (taken from rustc) has a bug which reuses start position when new_source_file is invoked concurrently.
2020-02-17 15:56:41 +09:00
강동윤
64ed0bd801
Validate sourcemap (#669) 2020-02-16 16:51:42 +09:00
강동윤
f17e49934c Add { Load, Resolve } 2020-02-15 12:52:06 +09:00
David Sherret
4550f7e1af
Support type predicate "asserts" with no "is" (#667) 2020-02-15 10:44:02 +09:00
강동윤
1fc09caa2f
type-only import, exports (#662) 2020-02-13 22:56:13 +09:00
강동윤
f344caa4fa
Reduce binary size (#663)
This pr add two helper macros to prevent folding type unnecessarily.
This reduces the binary size by 3MB on linux.
2020-02-13 21:55:54 +09:00
강동윤
f26ef0cfb7
Fix optimizer (#661) 2020-02-13 15:03:38 +09:00
강동윤
348052b017
Improve optimizer (#660)
Although it's quite naive at the moment, I added two optimization passes.

 - dead code elimination (Closes #607)
 - inlining
2020-02-13 11:45:14 +09:00
kdy1
82e73b1121 Fix bugs (#659)
- Strip out const assertions (Closes #656)
 - Fix exclude of the file matcher (Closes #658) 
 - Automatic typescript detection (Closes #655)
2020-02-12 15:07:45 +00:00
강동윤
64f6e51b42
Unescape template literals before emitting. (#652)
Fixes #637.
Fixes #639.
2020-02-11 13:33:29 +09:00
David Sherret
1bf81c6e85
Fix span of the ExportNamespaceSpecifer (#651) 2020-02-11 11:02:37 +09:00
강동윤
8fb7c516d7 Better error message for missing browserslist. (#650)
Better error message for missing brwoserslist.

Fixes #648
2020-02-10 19:27:56 +09:00
David Sherret
4b7222cbfe
Support export * as ns from "module" (#647) 2020-02-10 11:30:25 +09:00
Hyeon Kim
226336b38b
Fix version of regenerator-runtime (#644)
7.7.7 is version of @babel/runtime, not regenerator-runtime. Looks like
the intended version was "0.11.0" as you can see in the yarn.lock:

    regenerator-runtime@^0.11.0:
      version "0.11.1"
      resolved "https://registry.yarnpkg.com/regenerator-runtime/-/re...
      integrity sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT9...

Reference:
  https://github.com/swc-project/swc/commit/05be89c19
2020-02-10 03:23:10 +09:00
David Sherret
530a5f34db Support ecmascript private fields when parsing TypeScript. (#642) 2020-02-10 03:22:51 +09:00
kdy1
f8c358c9ac Strip type-only imports (#641)
Fixes #640
2020-02-09 11:35:33 +00:00
kdy1
add63826bd Allow await expression at other than expression statement (#636)
Fixes #635
2020-02-08 01:49:00 +00:00
dsherret
55c0258017 Remove empty expression in expression statement with top level await (#630)
Eats the semi-colon.

This doesn't compile (edit: doesn't compile the code in the tests) though because the target of that folder is ES2015. Also, this is kind of strange for me to put the tests in the "typescript" folder. Should we create something more general?

You can take over this PR if you'd like!
2020-02-07 05:33:26 +00:00
강동윤
26eb4e3206
Collect all comments (#633)
- Comments are now appended
 - pin dashmap's version
2020-02-07 14:32:43 +09:00