Commit Graph
100 Commits
Author SHA1 Message Date
Ron Buckton 956a363028 Emit source positions for open/close braces (#47924) 2023-09-23 02:41:44 -04:00
Ron Buckton 8fc8c95830 Decorators normative updates (#55276) 2023-08-04 20:36:52 -04:00
Ron Buckton b1c4dc475c Fix class name references (#55262) 2023-08-04 20:36:26 -04:00
Ron Buckton 97ef321fa0 Fix export of enum with same-named member (#55070) 2023-07-19 15:52:19 -04:00
Ron Buckton f9cf8216c6 Support using and await using declarations (#54505) 2023-06-22 17:02:56 -04:00
Ron Buckton 72406c6892 Fix regression in WeakMap constructor type (#54592) 2023-06-09 17:17:27 -04:00
Ron Buckton 913e556373 Add --coverage option to build scripts for tests (#54499) 2023-06-02 16:00:47 -04:00
Ron Buckton 4c01b2f9ee Fix incorrect 'this' substitution in decorated static 'accessor' fields (#54474) 2023-05-31 18:17:43 -04:00
Ron Buckton b14264a2eb Reverse order of decorator-injected initializers (#54269) 2023-05-17 17:12:13 -04:00
Ron Buckton f9a7cbfe7b Fix crash in getAwaitedType (#54107) 2023-05-03 15:40:51 -04:00
Ron Buckton 611a912dd1 Fix class alias reference in static initializer for legacy class decorators (#54046) 2023-04-28 15:45:40 -04:00
Ron Buckton be27970251 Fix 'var' hoisting in 'if' in CJS/AMD emit (#54036) 2023-04-27 15:58:41 -04:00
Ron Buckton 5ad4ac8d11 Fix 'var' hoisting in 'if' in SystemJS emit (#54016) 2023-04-25 18:03:39 -04:00
Ron Buckton 36b632552d Remove EndOfDeclarationMarker and MergeDeclarationMarker nodes (#53901) 2023-04-21 17:21:26 -04:00
Ron Buckton 3e76fb5ca2 Fix CJS local binding emit for ES decorators (#53725) 2023-04-10 17:05:38 -04:00
Ron Buckton 85ef01d31a Fix double-emit in constructor (#53547) 2023-03-27 18:16:49 -04:00
Ron BucktonandDaniel Rosenwasser ae1b3db8ce Allow 'verbatimModuleSyntax' with transpileModule (#53240)
Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com>
2023-03-14 13:03:43 -07:00
Ron Buckton 73a98aee00 Add tests for Awaited<null> and Awaited<undefined> (#52960) 2023-03-01 12:56:42 -05:00
Ron Buckton 8becdf2b40 Fix emit for nested object rest in assignment pattern (#52922) 2023-02-22 20:41:09 -05:00
Ron Buckton fd0370822f Fix crash in 'Wrap in JSX Fragment' quick fix (#52816) 2023-02-16 21:34:58 -05:00
Ron Buckton 55eff14353 Fix crash in extract type and generate get/set refactors (#52803) 2023-02-16 16:15:54 -05:00
Ron Buckton 7dd2a5e905 Fix crash in private accessor emit (#52785) 2023-02-16 14:38:18 -05:00
Ron Buckton 2c67c8f756 Enforce NLT restriction after 'accessor' keyword (#52763) 2023-02-15 12:51:25 -05:00
Ron Buckton f23dd7a7b2 Fix crash in getAwaitedType (#52752) 2023-02-14 11:16:12 -05:00
Ron Buckton 6c9792aa87 Decorators normative changes (#52582) 2023-02-09 14:48:45 -05:00
Ron Buckton 1dc5b28b94 Restore global onProfilerEvent hook for ts-perf (#52523) 2023-01-30 22:23:29 -05:00
Ron Buckton f526e16b2d Remove outdated deprecations (#52314) 2023-01-20 12:19:13 -05:00
Ron Buckton 5b18979697 Implement the Stage 3 Decorators Proposal (#50820) 2023-01-19 17:54:12 -05:00
Ron Buckton 20182cf848 Organize imports collation (#52115) 2023-01-19 17:53:51 -05:00
Ron Buckton 9cdba994ac Remove some properties from Identifier (#52170) 2023-01-12 17:20:12 -05:00
Ron Buckton 90fb764a0f Fix private name generation and missing emit for auto-accessors (#52132) 2023-01-06 21:08:51 -05:00
Ron Buckton f43cd0acca Add RegExp indices and hasIndices (#52085)
* Add RegExp indices
* update --lib message
* newlines
* implement changes
* Fix failing tests

Thanks @xiBread!
2023-01-03 15:20:10 -05:00
Ron Buckton eb1e257072 Support outlining in multiline import/export decls (#51937) 2022-12-19 15:22:43 -08:00
Ron Buckton 44e8244dd9 Move auto-generated identifier info into separate object (#51900) 2022-12-15 13:59:57 -05:00
Ron Buckton 2993ea8eaa Monomorphic Symbol access (#51880) 2022-12-15 10:44:24 -05:00
Ron Buckton 6d41964fd0 Reduce polymorphism resulting from unstable Node shapes (#51682)
* Move .symbol to Declaration

* simplify some factories

* Move localSymbol to Declaration

* Ensure JSDocContainer types are properly initialized

* Move contextualType from Node to NodeLinks

* Move 'locals' and 'nextContainer' out of Node

* Move 'flowNode' out of 'Node'

* Pre-define endFlowNode/returnFlowNode

* Pre-define some SourceFile properties and a more stable cloneNode

* Don't add excess properties to type nodes in typeToTypeNode

* Refactor wrapSymbolTrackerToReportForContext to improve perf
2022-12-13 15:11:10 -05:00
Ron Buckton e67b06e909 Simplistic watch mode for runtests (#51461)
* Simplistic watch mode for runtests

* Use esbuild WatchMode object for testRunner updates

* switch AbortController to CancelToken
2022-11-09 15:07:08 -05:00
Ron Buckton 5cfb3a2fe3 Only call return() for an abrupt completion in user code (#51297) 2022-10-28 18:36:40 -04:00
Ron Buckton a7a9d158e8 Fix for broken baseline in yieldInForInInDownlevelGenerator (#51345) 2022-10-28 16:56:53 -04:00
Ron Buckton 7f8426f4df fix for-in enumeration containing yield in generator (#51295) 2022-10-28 15:09:10 -04:00
Ron Buckton 702de1eeaa Fix early call to return/throw on generator (#51294) 2022-10-24 22:37:42 -04:00
Ron Buckton a56b254ad3 Include 'this' type parameter in isRelatedTo fast path (#51230) 2022-10-21 08:00:24 -04:00
Ron Buckton 3abd351c0e Fix super property transform in async arrow in method (#51240) 2022-10-21 08:00:00 -04:00
Ron Buckton 2dff34e8c4 markAliasReferenced should include ExportValue as well (#51219) 2022-10-19 13:24:01 -04:00
Ron Buckton 865848fcfb Fix <= and > comparisons when compared against prerelease versions (#50915)
* Fix <= and > comparisons when compared against prerelease versions

* Improve coverage for semver
2022-09-28 18:46:06 -04:00
Ron Buckton a4cabe725b Support for auto-accessor fields from the Stage 3 Decorators proposal (#49705)
* Support for auto-accessor fields

* Add tests, ensure accessors are initialized in ctor

* classFields cleanup and PR feedback
2022-09-12 15:12:11 -04:00
Ron Buckton aaa4f9d9ff Make canHaveModifiers/Decorators public (#50399) 2022-08-22 15:01:17 -04:00
Ron Buckton 284837d66b Fixes for decorators property deprecations (#50343)
* Change type of deprecated 'decorators' property

* fix 'Invalid Arguments' error for create/update constructor in factory

* Update deprecation comments

* Make 'decorators' optional and 'undefined'

* Rename '_decorators' to 'illegalDecorators'

* Update baselines
2022-08-19 14:27:26 -04:00
Ron Buckton 1592210673 Add a jump-table for visitEachChild (#50266)
* Add a jump-table for visitEachChild

* Name each visitor function for better stack traces

* Fix node tests and some minor cleanup
2022-08-18 15:03:17 -04:00
Ron Buckton 6bbe6d67d1 Fix return value and error reporting for getIterationTypesOfMethod (#50146) 2022-08-03 19:07:29 -04:00
Ron Buckton d6d26430c7 Add rule to auto-paren optional chain in normal prop or element access (#50156) 2022-08-03 17:17:26 -04:00
Ron Buckton 55f2c0cb49 No synthetic Awaited for unconstrained type when not a type variable (#50100) 2022-08-01 17:19:15 -04:00
Ron Buckton 88a1e3a1dd Transform decorators that reference private names into a 'static {}' block (#50074) 2022-07-29 15:29:48 -04:00
Ron Buckton 12dbdf03b1 Parse parameter decorators outside of Await context when appropriate (#50040) 2022-07-25 17:17:27 -04:00
Ron Buckton c6ff5f3b52 Fix for Awaited<T> inference (#49748) 2022-07-01 15:00:54 -07:00
Ron Buckton b3a79dbe04 fix missing 'internal' comment 2022-06-09 18:39:05 -07:00
Ron Buckton 1e65b330a7 Merge 'decorators' into 'modifiers' on various nodes (#49089)
* Merge 'decorators' into 'modifiers' on various Nodes

* Drop RESERVED argument in favor of removing parameter

* Ignore grammar error nodes when asserting invariants

* Revert 'illegalX' property renames

* PR Feedback
2022-06-09 17:24:02 -07:00
Ron Buckton cb1bc6169b Move legacy decorators into separate transform (#48669) 2022-06-03 09:36:29 -07:00
Ron Buckton ba4525202e More specific inference for constrained 'infer' types in template literal types (#48094)
* More specific inference for constrained 'infer' types in template literal types

* PR feedback

* Add inference priority for template type placeholders

* Infer to a preferred constraint instead of a union

* Add reduceType

* Switch tests to use infer..extends

* Add missing primitive constraint cases

* Update .types tests

* Remove TemplateTypePlaceholderPriority

* Remove reduceType
2022-05-27 11:05:24 -07:00
Ron Buckton e2bd89b309 Report error for invalid 'this' type during 'await' (#48946) 2022-05-09 13:58:36 -07:00
Ron Buckton b975dfa102 Write more useful types in .types test outputs (#48578) 2022-04-07 09:51:17 -07:00
Ron Buckton 7da80d79e2 Add 'extends' clause to 'infer' type (#48112)
* Add 'extends' clause to 'infer' type

* Revise parse for infer..extends, improve parenthesizer

* More aggressive parens to match existing DT tests

* tests 'infer' constraint using outer type parameter

* Adds a test showing 'infer' cannot reference other 'infer' in same 'extends'

* Emit extends clause for synthetic infer typesduring declaration emit
2022-04-05 12:35:28 -07:00
Ron Buckton 3328feb799 Use 'static {}' for static fields when available and useDefineForClassFields is false (#47707) 2022-02-04 12:34:29 -08:00
Ron Buckton 21bbb576ad Fix captured const in downlevel for-await (#47680) 2022-02-01 11:47:29 -08:00
Ron Buckton 63d9d4c8bf Transform param patterns/initializers after object rest (#47095) 2022-02-01 11:46:29 -08:00
Ron Buckton 7183b14831 Fix captured let/const in 'for' condition or incrementer (#47681) 2022-02-01 09:48:15 -08:00
Ron Buckton c8f1a874a3 Exempt tslib from indirect call transform (#47070) 2021-12-08 15:42:37 -08:00
Ron Buckton 67f84ef771 Fix Awaited<T> for onfulfilled callbacks with more than one argument (#46951) 2021-12-07 15:21:11 -08:00
Ron Buckton c792a66065 Pin chalk to ^4.1 (#46985)
* Pin chalk to ^4.1

* Revert #46931
2021-12-02 11:05:17 -08:00
Ron Buckton 4c0a51e14b Avoid Promise<Awaited<T>> in return type inference (#45925) 2021-09-22 16:29:07 -07:00
Ron Buckton b23f44aee5 Simplify a branch of the Awaited type and clean up comments (#45918) 2021-09-16 15:04:09 -07:00
Ron Buckton ea521d45e9 Adds 'Awaited' type alias and updates to Promise.all/race/allSettled/any (#45350)
* Adds 'Awaited' type alias and updates to Promise.all/race/allSettled/any

* Use Awaited<T> with 'await'

* Clean up overloads

* Further restrict 'Awaited<T>' auto-wrapping for 'await'
2021-09-09 18:23:17 -07:00
Ron Buckton cf787e9bcf Fix name resolution in typedef and allow defaults for template tags (#45483)
* Fix name resolution in typedef and allow defaults for template tags

* Inline parseBracketNameInTemplateTag

* Update baselines

* Add js declaration emit tests
2021-09-08 17:05:07 -07:00
Ron Buckton 6f7f3b1775 Minor fixes to "Convert To Async" refactor (#45536)
* Minor fixes to convertToAsync

* Back out on nested return in inner continuation

* Baseline update

* Verify type argument for call can be used, add a few more early exit shortcuts
2021-09-01 13:13:12 -07:00
Ron Buckton 107c556fe4 Fix 'as const'-like behavior in JSDoc type cast (#45464) 2021-08-27 18:22:02 -07:00
Ron Buckton d8e830d132 Fix __spreadArray for non-concat-spreadables (#45386) 2021-08-09 17:08:07 -07:00
Ron Buckton 4fc4c18299 Fix completions in return when in function with contextual 'this' (#45340) 2021-08-05 22:40:20 -07:00
Ron Buckton 365b25693c Fix and validate post-increment/decrement in module emit (#44968) 2021-07-19 13:34:42 -07:00
Ron Buckton 66c3063b06 Add collision check for 'Reflect' when using super in static initializers (#44876)
* Add collision check for 'Reflect' when using super in static initializers

* PR feedback

* Accept baseline for new failing test
2021-07-10 12:48:54 -07:00
Ron Buckton 8590f0db40 Fix decorator emit regression for static fields (#44933) 2021-07-07 16:58:36 -07:00
Ron Buckton 069650f602 Change PerformanceObserver to be compatible with new Node types (#44884) 2021-07-03 21:26:56 -07:00
Ron Buckton 09406524b3 Add evaluation tests for class static initializers (#44878) 2021-07-03 18:30:42 -07:00
Ron Buckton 8b496ed34c Fix class name reference in class expr (#44877) 2021-07-02 18:37:23 -07:00
Ron Buckton 711b4e778b Indirect calls for imported functions (#44624)
* Indirect calls for imported functions

* Fix unit tests
2021-06-21 19:51:13 -07:00
Ron Buckton a0c44b26b7 Improve __spreadArray perf, and other fixes related to SpreadElement (#44527)
* Improve __spreadArray perf, fix array packing and trailing omitted expressions

* Ensure __spreadArray is backwards-compatible

* Add signature restriction for __spreadArray

* Added reusable true/false literals
2021-06-11 16:21:55 -07:00
Ron Buckton 4ce12f9f65 Move class name capture for private state until after declaration evaluates (#44186) 2021-05-20 14:35:40 -07:00
Ron Buckton cb9cd898d1 Revert #35877 - fix receiver on calls of imported and exported functions (#43993) 2021-05-07 13:42:12 -07:00
Ron Buckton e0d551606f Remove preprinter, add parenthesizer callback to emit (#43652) 2021-04-19 09:34:46 -07:00
Ron Buckton e10a32591c Use 'abstract new' in InstanceType and ConstructorParameters (#43380) 2021-03-25 15:27:06 -07:00
Ron Buckton fbd7f7db20 Update typescript-eslint to latest (#43381) 2021-03-25 14:46:16 -07:00
Ron Buckton 03bf732f73 Accepts baseline change caused by #43035 (#43322) 2021-03-21 13:42:20 -07:00
Ron Buckton 9af313db77 Use shared binary trampoline in checker (#43035) 2021-03-19 18:54:51 -07:00
Ron Buckton ec4863cc0e Fix37991 (#43166)
* Add failing test

* Fix tslib check errors for commonjs imports
2021-03-09 11:43:19 -08:00
Ron Buckton 38fdce9440 Expose 'reservedInNestedScopes' option when creating temp and loop variables (#43083) 2021-03-04 15:37:45 -08:00
Ron Buckton 68b0323b72 Refactor emit substitution into transform (#42676)
* Refactor emit substitution into transform

* Add reusable state machine for binary expressions

* Allow emitBinary to use state machine for comments/sourcemaps

* Switch core trampoline state back to arrays

* Switch binder to parallel stacks, temporarily partially revert emitBinary

* Add link to benchmark when posting perf results

* Ensure work stacks are per-execution

* Reenable comments and sourcemaps
2021-02-25 23:01:41 -08:00
Ron Buckton c953969698 Switched 'ts.performance' to a mixed mode only uses native performance APIs when necessary (#42586)
* Partially revert native performance

* Fix bug in measure

* Conditionally enable native perf events
2021-02-01 15:33:34 -08:00
Ron Bucktonandtypescript-bot 786a7e86ef Update user baselines (#42451)
* Update user baselines +cc @sandersn

* Update user baselines

Co-authored-by: typescript-bot <typescript@microsoft.com>
2021-01-22 18:44:25 -08:00
Ron Buckton ee3fe472d7 Fix broken user and docker tests (#42431)
* Add --force to npm install script for user tests

* Migrate prettier to docker

* Fix vscode Dockerfile

* Fix stack space issue in isJSLiteralType

* Use --legacy-peer-deps based on npm version

* Fix xterm.js Dockerfile
2021-01-22 13:23:41 -08:00
Ron Buckton 0d284e6c26 Add support for abstract constructor types (#36392)
* Add support for abstract constructor types

* Add backwards-compatible overloads for creating/updating constructor types

* Reverting use of 'abstract' in lib/es5.d.ts due to eslint issues

* Update baseline due to reverting lib

* Add error for failing to mark an mixin class as abstract

* Fix declaration/quick info for abstract construct signatures
2021-01-07 17:11:14 -08:00
Ron Buckton 44ec8ddaee Fix array spread with sideeffects (#41523)
* Fix array spread with sideeffects

* Minor cleanup, ensure multiple emit helpers for outfile tests
2021-01-05 17:24:21 -08:00