980b273 | TypeScript Bot | 10 February 2021, 00:52:29 UTC | Bump version to 4.2.1-rc and LKG | 10 February 2021, 00:52:29 UTC |
12e7691 | TypeScript Bot | 10 February 2021, 00:13:56 UTC | Merge remote-tracking branch 'origin/master' into release-4.2 | 10 February 2021, 00:13:56 UTC |
5280ba4 | Sheetal Nandi | 09 February 2021, 23:23:29 UTC | Handle if plugin doesnt specify name (#42717) Fixes microsoft/vscode#116219 | 09 February 2021, 23:23:29 UTC |
8c5fa5c | Orta Therox | 09 February 2021, 23:03:11 UTC | Revert assignability cases in getNarrowedType (#42231) * Revert subtype narrowing changes from readonly array PRs * Adds a test for the change * More baselines | 09 February 2021, 23:03:11 UTC |
1b19af0 | Jesse Trinity | 09 February 2021, 21:30:31 UTC | Refactor params for interface (#42652) * apply refactor to interface methods * handle calls * no available refactors for union type * add tests * Update src/services/refactors/convertParamsToDestructuredObject.ts Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com> * address comments * Update src/services/refactors/convertParamsToDestructuredObject.ts Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com> * Update src/services/refactors/convertParamsToDestructuredObject.ts Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> Co-authored-by: Daniel Rosenwasser <DanielRosenwasser@users.noreply.github.com> Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> | 09 February 2021, 21:30:31 UTC |
664ed17 | Daniel Rosenwasser | 09 February 2021, 19:30:09 UTC | Allow only package names as plugin names (#42713) * Allow only package names as plugin names * Remove extra argument following merge from master branch. * kipped -> Skipped Co-authored-by: Sheetal Nandi <shkamat@microsoft.com> | 09 February 2021, 19:30:09 UTC |
fe2899c | Eli Barzilay | 08 February 2021, 20:54:35 UTC | Use a 10ms sampling frequency to filter tracing dumps Currently hard-wired to 10ms, can be made configurable if needed later. | 08 February 2021, 22:01:45 UTC |
f462576 | Eli Barzilay | 13 January 2021, 21:01:53 UTC | Re-do tracing initialization and tests around calls Make `tracing` either `undefined` or the same namespace as before. Switching all calls to `tracing?.___` means that there is no cost for a call or the arguments when tracing is not used. Comparing two runs without tracing (27 runs, drop 5+5, avg rest) I get: master: 42.59s user 1.00s system 165% cpu 26.372 total changed: 42.01s user 0.982 system 165% cpu 26.039 total (Makes it all private, so no api changes.) | 08 February 2021, 20:41:35 UTC |
7de5d0b | TypeScript Bot | 07 February 2021, 06:22:44 UTC | Update package-lock.json | 07 February 2021, 06:22:44 UTC |
60a6240 | Oleksandr T | 05 February 2021, 23:24:48 UTC | feat(42637): add generateReturn option to UserPreferences (#42642) | 05 February 2021, 23:24:48 UTC |
4c43e09 | Wesley Wigham | 05 February 2021, 20:07:14 UTC | Add fallback error locations for nameless declarations, better class error locations (#42585) | 05 February 2021, 20:07:14 UTC |
aba932a | Nathan Shively-Sanders | 05 February 2021, 18:56:03 UTC | Create synthetic `exports` symbol for commonjs `module` (#42655) * Commonjs module:create synthetic exports symbol Previously, the `module` identifier in commonjs modules got a synthetic type with a single property `exports`. The exports property reused the file's symbol, which, for a module file, gives the correct exported properties. However, the name of this symbol was still the filename of the file, not `exports`. This PR creates a synthetic symbol for `exports` by copying in a similar way to esModuleInterop's `default` symbol in `resolveESModuleSymbol` (although the intent there is to strip off signatures from the symbol). * correct parent of synthetic symbol | 05 February 2021, 18:56:03 UTC |
79ed041 | Andrew Branch | 05 February 2021, 18:37:47 UTC | Fix Format Selection on JSDoc comments (#42411) | 05 February 2021, 18:37:47 UTC |
f1583f0 | Nathan Shively-Sanders | 05 February 2021, 17:37:28 UTC | Signature help turns off current-parameter display for non-trailing rest parameters (#42592) * Signature help: support non-trailing rest parameters In signature help, the first rest parameter will always be the *last* 'current' parameter (disregarding types). Previously, the signature help current-parameter highlight was only correct for trailing rest parameters. However, with tuple types, you can now create non-trailing rest parameters. This PR now correctly highlights non-trailing rest parameters as the last 'current' parameter. For example, `names` should be the current parameter in all the calls below: ```ts declare function loading(...args: [...names: string[], allCaps: boolean, extra: boolean]): void; leading(/**/ leading('one', /**/ leading('one', 'two', /**/ ``` And, because signature help doesn't do real overload resolution, `names` is also the current parameter for other calls: ```ts leading(1, 2, 3, 'ill-typed', /**/ leading('fine', true, /**/ ``` * Change 'variadic' to 'rest' * fix missed rename * use single, original tuple instead * Revert "use single, original tuple instead" This reverts commit f0896f32ea3d523f1186e9bea2446f75f3a182de. * Improve sig help of trailing rest too 1. Trailing rest keeps highlight at end instead of going off the end. 2. Non-trailing rest disable highlight entirely (by putting the index one past the end). * update API baselines | 05 February 2021, 17:37:28 UTC |
215ee40 | TypeScript Bot | 05 February 2021, 06:23:09 UTC | Update package-lock.json | 05 February 2021, 06:23:09 UTC |
19db9ad | Wesley Wigham | 04 February 2021, 21:56:34 UTC | Swapping the quote style of a string for completions should swap _all_ quotes in the string (#42650) | 04 February 2021, 21:56:34 UTC |
f569aa3 | Wesley Wigham | 04 February 2021, 21:53:05 UTC | Use a (hopefully) more efficient regex for matching jquery in the safelist (#42653) | 04 February 2021, 21:53:05 UTC |
62bc8be | Wesley Wigham | 04 February 2021, 21:25:53 UTC | Replace _all_ tabs in pretty output, not just the first on each line (#42649) | 04 February 2021, 21:25:53 UTC |
be18057 | Wesley Wigham | 04 February 2021, 21:20:38 UTC | Add check for no match into fs watch rename event handler (#42651) | 04 February 2021, 21:20:38 UTC |
ab2729a | Anders Hejlsberg | 04 February 2021, 21:18:30 UTC | Smarter subtype reduction in union types (#42353) * Exclude primitive types from union subtype reduction in most cases * Accept new baselines * Minor fixes * Less aggressive checking of assertion function calls that don't affect control flow * Accept new baselines | 04 February 2021, 21:18:30 UTC |
258be21 | Andrew Branch | 04 February 2021, 18:22:15 UTC | Fix completions crash on transient exported property named 'default' (#42583) * Fix completions crash on transient exported property named default * Revert simplification, both conditions were needed | 04 February 2021, 18:22:15 UTC |
05e2f74 | TypeScript Bot | 04 February 2021, 06:22:59 UTC | Update package-lock.json | 04 February 2021, 06:22:59 UTC |
4c118ae | Oleksandr T | 04 February 2021, 02:26:33 UTC | fix(39022): wrap export references UnaryExpression to ParenthesizedExpression (#41156) | 04 February 2021, 02:26:33 UTC |
e231821 | Anders Hejlsberg | 03 February 2021, 23:50:23 UTC | Strip nullable types from 'this' type in inference with optional chain calls (#42536) * Properly strip nullable types from this type in optional chain calls * Add regression test | 03 February 2021, 23:50:23 UTC |
cce4bfb | Daniel Rosenwasser | 03 February 2021, 22:49:03 UTC | Revert changes for template literal types, keeping tests. (#42588) * Revert changes for template literal types, keeping tests. * Update Baselines and/or Applied Lint Fixes Co-authored-by: TypeScript Bot <typescriptbot@microsoft.com> | 03 February 2021, 22:49:03 UTC |
6549754 | Daniel Rosenwasser | 03 February 2021, 22:29:42 UTC | Use spaces instead of non-breaking spaces, narrow non-breaking spaces. (#42500) | 03 February 2021, 22:29:42 UTC |
c3e132d | Sheetal Nandi | 03 February 2021, 19:09:06 UTC | Keep extended config's raw file, include, exclude relative to itself and correct it when setting extending options (#42544) * Test when config file extends is incorrectly computed Test for #40720 * Keep extended config's raw file, include, exclude relative to itself and correct it when setting extending options Fixes #40720 | 03 February 2021, 19:09:06 UTC |
1c25b00 | Andrew Branch | 03 February 2021, 18:42:13 UTC | Sort import fixes by number of directory separators (#42614) * Add failing test * Sort all import fixes by number of directory separators | 03 February 2021, 18:42:13 UTC |
bfc55b5 | TypeScript Bot | 03 February 2021, 06:25:50 UTC | Update package-lock.json | 03 February 2021, 06:25:50 UTC |
96cc9b9 | Andrew Branch | 03 February 2021, 00:17:55 UTC | Make object literal properties new identifier locations when not contextually typed (#42612) * Make object literal properties new identifier locations when not contextually typed * Fix completions after comma in object literal * Update other test | 03 February 2021, 00:17:55 UTC |
71de94a | Andrew Branch | 02 February 2021, 22:02:35 UTC | Limit tuple size resulting from spread (#42448) * Limit tuple size resulting from spread * Update limit to 10k * Update baseline after merge conflict | 02 February 2021, 22:02:35 UTC |
fd6178b | TypeScript Bot | 02 February 2021, 16:39:34 UTC | Update user baselines +cc @sandersn (#42420) Co-authored-by: typescript-bot <typescript@microsoft.com> | 02 February 2021, 16:39:34 UTC |
60bde2d | TypeScript Bot | 02 February 2021, 06:28:14 UTC | Update package-lock.json | 02 February 2021, 06:28:14 UTC |
3e28e29 | Song Gao | 02 February 2021, 02:34:46 UTC | fix 38503. (#39716) * fix 38503. * trigger test. * trigger test. * Move isCallChain Co-authored-by: Ron Buckton <ron.buckton@microsoft.com> | 02 February 2021, 02:34:46 UTC |
c953969 | Ron Buckton | 01 February 2021, 23:33:34 UTC | 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 | 01 February 2021, 23:33:34 UTC |
66ecfcb | TypeScript Bot | 01 February 2021, 06:28:00 UTC | Update package-lock.json | 01 February 2021, 06:28:00 UTC |
8523ca4 | Andrew Branch | 29 January 2021, 22:10:29 UTC | Don’t create missing nodes for identifiers that would be valid in a newer script target (#42520) * Add test * Don’t create missing nodes for identifiers that would be valid in a newer script target * Add to test * Remove unnecessary assignment | 29 January 2021, 22:10:29 UTC |
d7d7b88 | Andrew Branch | 29 January 2021, 20:38:26 UTC | Remove Travis CI (#42507) * Remove Travis CI * Revert deletion of cron stuff * Fix formatting | 29 January 2021, 20:38:26 UTC |
9d21a5b | Andrew Branch | 29 January 2021, 20:07:57 UTC | Fix indentation of multiline conditional expressions (#42484) * Fix indentation of multiline conditional expressions * Add more comment * Fix comment typo Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> * Fix suggestion formatting Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> | 29 January 2021, 20:07:57 UTC |
c15f40a | Andrew Branch | 29 January 2021, 20:03:42 UTC | Fix discriminant property narrowing through optional chain with null (#42503) * Fix discriminant property narrowing through optional chain with null * Accept baselines * Add tests from Anders | 29 January 2021, 20:03:42 UTC |
65e4d60 | Andrew Branch | 29 January 2021, 17:49:47 UTC | Fix formatter determination of initial indentation of list items after the first (#42352) * Add failing test * Fix determination of initial indentation of list items after the first | 29 January 2021, 17:49:47 UTC |
2730cb2 | Wesley Wigham | 29 January 2021, 07:36:43 UTC | Only skip any checks for unwrapped tuples in conditionals, rather than all nondistributive conditionals for backcompat (#42447) | 29 January 2021, 07:36:43 UTC |
9dbfaee | Nathan Shively-Sanders | 28 January 2021, 23:19:01 UTC | Narrow QualifiedName inside typeof (#42540) Previously this wasn't narrowed at all. Now there is control flow and code in isMatchingReference. | 28 January 2021, 23:19:01 UTC |
5a21291 | Wesley Wigham | 28 January 2021, 17:24:54 UTC | Propegate contextual types through nonnull assertion operators (#42526) | 28 January 2021, 17:24:54 UTC |
d2443a5 | Nathan Shively-Sanders | 28 January 2021, 16:35:05 UTC | @typedef: Improve error spans from declaration emit (#42501) * @typedef: Improve error spans from declaration emit This is a proof-of-concept fix. I think it could be expanded for all of jsdoc, but I only set it up for jsdoc type aliases. It could use a lot of polish too. * track error node in isSymbolAccessible instead * Switch to using enclosingDeclaration Remove trueErrorNode * add test of @callback and @enum * Better error + fix @enum error Since enums don't have a name property, you *have* to call `getNameOfDeclaration` to go looking through the AST for one. | 28 January 2021, 16:35:05 UTC |
517f329 | Wesley Wigham | 27 January 2021, 23:30:59 UTC | Add regression test for #37314 (#42525) | 27 January 2021, 23:30:59 UTC |
203a5ce | Wesley Wigham | 27 January 2021, 21:32:46 UTC | Include all properties from the mapped modifier type when calculating index types for mapped types with name types (#41976) | 27 January 2021, 21:32:46 UTC |
cdd11e9 | TypeScript Bot | 27 January 2021, 06:27:40 UTC | Update package-lock.json | 27 January 2021, 06:27:40 UTC |
b8faaea | Sheetal Nandi | 27 January 2021, 01:43:37 UTC | Only look for file exists and read file on supported locale directories that we build (#42505) Fixes #42263 | 27 January 2021, 01:43:37 UTC |
6ed344f | TypeScript Bot | 26 January 2021, 06:27:09 UTC | Update package-lock.json | 26 January 2021, 06:27:09 UTC |
871096b | Armando Aguirre | 25 January 2021, 23:05:44 UTC | Merge pull request #42356 from armanio123/FixJSDocFormatting Fix double asterisk formatting in JSDoc | 25 January 2021, 23:05:44 UTC |
701493f | M.Yoshimura | 25 January 2021, 21:40:45 UTC | Support top level "for await of" (#37424) * Support Top Level "for await of". * Add test cases for top level "for await of". * Apply suggestions from code review * add test cases * remove redundant variables * fix test baselines * Update diagnostic message and tests Co-authored-by: Ron Buckton <ron.buckton@microsoft.com> | 25 January 2021, 21:40:45 UTC |
f529115 | AnyhowStep | 25 January 2021, 21:33:28 UTC | fixes microsoft/TypeScript#41286 (#41294) * fixes microsoft/TypeScript#41286 * Added period to end of deprecation message * Search Symbol.declarations for deprecated tag instead of Symbol.valueDeclaration * renamed arg0 to deprecatedEntity, narrowed param type * Added different deprecation message if signature is available * address PR comments Co-authored-by: Nathan Shively-Sanders <293473+sandersn@users.noreply.github.com> | 25 January 2021, 21:33:28 UTC |
d7d8f33 | Wesley Wigham | 25 January 2021, 19:16:59 UTC | In bundle declaration emit, refuse to rewrite nonrelative references to files outside the common source directory (#42306) | 25 January 2021, 19:16:59 UTC |
1b57a03 | Sheetal Nandi | 25 January 2021, 18:04:39 UTC | Fix incorrectly logging ts files instead of .js files as top files (#42463) Fixes #41071 | 25 January 2021, 18:04:39 UTC |
ca380af | Nathan Shively-Sanders | 25 January 2021, 17:42:24 UTC | At starts jsdoc tag only after whitespace (#42364) * Update tests * @ begins JSDoc tag only after whitespace Previously, inside a JSDoc tag's comment, @ would start a tag unless it was surrounded by backticks. However, looking at real code showed that only whitespace-preceded uses of @ were intended to start tags. | 25 January 2021, 17:42:24 UTC |
89c173f | Andrew Branch | 25 January 2021, 17:29:51 UTC | Narrow via discriminant property through optional chain (#42450) * Naive attempt at narrowing via discriminant property through optional chain * Clean up test | 25 January 2021, 17:29:51 UTC |
290af69 | Amin Pakseresht | 25 January 2021, 17:29:13 UTC | Filter out global keywords of UMD module export declarations in completion providing auto import suggestions (#42141) * Add AutoImportSuggestions for UMD module export declarations instead of global keywords * Add test for scripts * Add more comments * Provide auto import suggestion only for modules and not scripts * PR review #1 * PR review #1 | 25 January 2021, 17:29:13 UTC |
154f209 | Orta Therox | 23 January 2021, 13:13:56 UTC | WIP-semantic in session based TS (#42438) | 23 January 2021, 13:13:56 UTC |
63003eb | TypeScript Bot | 23 January 2021, 06:50:09 UTC | Update package-lock.json | 23 January 2021, 06:50:09 UTC |
786a7e8 | Ron Buckton | 23 January 2021, 02:44:25 UTC | Update user baselines (#42451) * Update user baselines +cc @sandersn * Update user baselines Co-authored-by: typescript-bot <typescript@microsoft.com> | 23 January 2021, 02:44:25 UTC |
ee3fe47 | Ron Buckton | 22 January 2021, 21:23:41 UTC | 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 | 22 January 2021, 21:23:41 UTC |
80dfc6a | Sheetal Nandi | 22 January 2021, 19:16:07 UTC | Only when typings file change for the project, schedule the update for the project (#42428) * Update and add test when typings dont change because of import name * Update project scheduling only when typings are set * Schedule update graph only if typings change Fixes #39326 | 22 January 2021, 19:16:07 UTC |
4c62f6e | TypeScript Bot | 22 January 2021, 06:51:52 UTC | Update package-lock.json | 22 January 2021, 06:51:52 UTC |
71d4ee5 | Wesley Wigham | 21 January 2021, 21:06:56 UTC | Preserve alias information where possible when looking up union and intersection base constraints (#42430) | 21 January 2021, 21:06:56 UTC |
2f47527 | TypeScript Bot | 21 January 2021, 06:51:56 UTC | Update package-lock.json | 21 January 2021, 06:51:56 UTC |
424b805 | Matt Kantor | 20 January 2021, 23:23:34 UTC | Fix "Cannot find name 'global'. Did you mean 'global'?" (#42262) * Add tests for "Cannot find name 'global'. Did you mean 'global'?" * Fix "Cannot find name 'global'. Did you mean 'global'?" * Add an additional test case for spelling suggestions of "global". * Name the boolean for suggestions being global scope augmentations. | 20 January 2021, 23:23:34 UTC |
0383b5c | Andrew Branch | 20 January 2021, 20:15:36 UTC | Optimize import fixes for projects with many symlinks (#42150) * Create symlink cache when a pnpm module is found * Keep pnpm-internal symlinks out of the symlink cache * Filter out pnpm path from realpath module specifier too * Optimize symlink module specifier generation * Add trailing directory separators * Remove unneeded change * Fix paths losing case in cache * Fix missing absolutification | 20 January 2021, 20:15:36 UTC |
9d286a2 | TypeScript Bot | 20 January 2021, 16:51:28 UTC | Update user baselines +cc @sandersn (#42366) Co-authored-by: typescript-bot <typescript@microsoft.com> | 20 January 2021, 16:51:28 UTC |
028f14c | Anders Hejlsberg | 20 January 2021, 16:37:02 UTC | Filter origin types when filtering union types (#42378) * When filtering a union type, also filter its origin type, if any * Accept new baselines | 20 January 2021, 16:37:02 UTC |
a231b23 | Armando Aguirre | 20 January 2021, 07:02:56 UTC | Fix start position on JSDoc parsin | 20 January 2021, 07:02:56 UTC |
1cef53f | TypeScript Bot | 20 January 2021, 06:52:39 UTC | Update package-lock.json | 20 January 2021, 06:52:39 UTC |
0d494ab | Wesley Wigham | 20 January 2021, 02:02:35 UTC | Add missing unwrap call for the inferredExtendsType (#42409) | 20 January 2021, 02:02:35 UTC |
98e9e77 | Armando Aguirre | 19 January 2021, 23:55:01 UTC | Fixed JSDoc with only one asterisk in comment | 19 January 2021, 23:55:01 UTC |
147384c | Zuckjet | 19 January 2021, 17:13:26 UTC | Fix typos in comments (#42396) | 19 January 2021, 17:13:26 UTC |
b34e680 | TypeScript Bot | 19 January 2021, 06:51:13 UTC | Update package-lock.json | 19 January 2021, 06:51:13 UTC |
621e0af | Wesley Wigham | 18 January 2021, 15:05:11 UTC | Accept merge-conflicted baseline (#42398) | 18 January 2021, 15:05:11 UTC |
852c702 | TypeScript Bot | 18 January 2021, 06:50:43 UTC | Update package-lock.json | 18 January 2021, 06:50:43 UTC |
b5bab16 | TypeScript Bot | 16 January 2021, 06:49:45 UTC | Update package-lock.json | 16 January 2021, 06:49:45 UTC |
70c82ca | Anders Hejlsberg | 16 January 2021, 02:00:55 UTC | Include alias type arguments in keys for aliased types (#42365) | 16 January 2021, 02:00:55 UTC |
ab32fca | Wesley Wigham | 16 January 2021, 01:23:01 UTC | Fix type parameter lookup for TypeAlias LibraryManagedAttributes (#42245) | 16 January 2021, 01:23:01 UTC |
d1e1e9d | chenjigeng | 15 January 2021, 23:57:18 UTC | Feat/exclude completions of variable initializers (#42087) * feat: exclude declared variable when Object literal completions * feat: check undeclareVariable when completion * feat: add completion test case * feat: code optimization * feat: support shorthand property assignment * feat: add shorthand property assignment test case * feat: update completionPropertyShorthandForObjectLiteral test cases * feat: exclude completions of variable initializers * feat: update test cases * feat: add completionListWithoutVariableinitializer test case * feat: perfect the completionListWithoutVariableinitializer test case * feat: remove isIdentifier limit * feat: update test cases * feat: code optimization and filter out some binding cases * feat: update test case * feat: handle arrow function expressions without braces * feat: add arrow function expressions without braces test case * feat: check node.parent exist first * feat: optimization name * feat: optimize test cases * chore: code formatting * feat: perfect type | 15 January 2021, 23:57:18 UTC |
0aa77fc | TypeScript Bot | 15 January 2021, 23:42:23 UTC | Update user baselines +cc @sandersn (#41496) Co-authored-by: typescript-bot <typescript@microsoft.com> | 15 January 2021, 23:42:23 UTC |
8324dec | Oleksandr T | 15 January 2021, 17:52:46 UTC | feat(33715): include methods of class defined in a property (#42164) | 15 January 2021, 17:52:46 UTC |
22f8fa4 | TypeScript Bot | 15 January 2021, 06:49:09 UTC | Update package-lock.json | 15 January 2021, 06:49:09 UTC |
995023c | Armando Aguirre | 15 January 2021, 05:38:55 UTC | Fix double asterisk formatting in JSDoc | 15 January 2021, 05:50:22 UTC |
c83f769 | Oleksandr T | 15 January 2021, 01:02:48 UTC | fix(41405): allow using property access as reference to function (#41429) | 15 January 2021, 01:02:48 UTC |
33ea6c5 | Andrew Branch | 14 January 2021, 22:48:40 UTC | Fix indentation for closing > of ExpressionWithTypeArguments (#42341) | 14 January 2021, 22:48:40 UTC |
368cdfd | Chris West | 13 January 2021, 23:51:08 UTC | fix: const enums + isolatedModules emit invalid code (#41933) * chore: failing test for const enums and isolatedModules * fix: const enums + isolatedModules emit invalid code In `isolatedModules` mode, the compiler does not inline const enums, but also decides not to `import` them, leaving invalid code that throws a `ReferenceError` at runtime. This code: ``` import { SomeEnum } from './bar'; sink(SomeEnum.VALUE); ``` ..should compile to either: ``` var { SomeEnum } = require('./bar'); sink(SomeEnum.VALUE); ``` ..or (with const enum inlining): ``` sink(1 /* VALUE */); ``` ..but actually compiles to: ``` sink(SomeEnum.VALUE); ``` ..with no imports, which throws a ReferenceError at runtime. --- The compiler has already realised that the symbol is a referenced const enum, it just doesn't use this information when it comes to deciding whether to emit an import. This commit additionally checks that information, if we are compiling in isolatedModules mode. --- In my opinion, this is not the correct fix, but it is the simplest. In `isolatedModules` mode, `const enum` should probably be a compile error (because there are no benefits and the complexity is high, and, apparently, buggy). If not, the compiler should not be checking whether something is a const enum, and should just be treating it as a regular enum, and checking as if it was? Fixes #40499. * chore: extra test for type-only * feat: explicitly ban --isolatedModules --preserveConstEnums false * feat: isolatedModules implies preserveConstEnum * Update src/compiler/diagnosticMessages.json Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com> * chore: compiler test for argument incompatibility * Add and fix test for namespace import of const enum * Fix additional bug with reexport of const-enum-only module Co-authored-by: Andrew Branch <andrewbranch@users.noreply.github.com> Co-authored-by: Andrew Branch <andrew@wheream.io> | 13 January 2021, 23:51:08 UTC |
9171aa5 | Klaus Meinhardt | 13 January 2021, 11:20:46 UTC | fix forEachChildRecursively (#42300) | 13 January 2021, 11:20:46 UTC |
33046e3 | Andrew Branch | 12 January 2021, 22:04:03 UTC | Do not suggest paths inside node_modules/.pnpm as module specifiers (#42095) * Create symlink cache when a pnpm module is found * Keep pnpm-internal symlinks out of the symlink cache * Filter out pnpm path from realpath module specifier too * Use ignoredPaths instead of pnpm-specific path | 12 January 2021, 22:04:03 UTC |
2f58637 | Nathan Shively-Sanders | 12 January 2021, 21:15:54 UTC | Improve naming of hasNonBindableDynamicName (#42297) hasNonBindableDynamicName 1. Has 'non' in the name, and is only ever used negated. 2. Is true for a case that's not reflected correctly in the name -- it's true for non-dynamic names as well. I considered hasEarlyOrLateBindableName, but decided to use hasBindableName for now. | 12 January 2021, 21:15:54 UTC |
c3dd845 | Wesley Wigham | 12 January 2021, 20:59:52 UTC | Better detect when typical nondistributive conditionals need to be defered by unwrapping their check and extends types (#42248) | 12 January 2021, 20:59:52 UTC |
a276a6d | Oleksandr T | 12 January 2021, 18:59:08 UTC | feat(31388): allow binding elements starting with an underscore (#41378) | 12 January 2021, 18:59:08 UTC |
a894f8a | TypeScript Bot | 12 January 2021, 06:43:39 UTC | Update package-lock.json | 12 January 2021, 06:43:39 UTC |
fd95fe9 | TypeScript Bot | 12 January 2021, 02:22:05 UTC | Update LKG | 12 January 2021, 02:22:05 UTC |
7484c40 | TypeScript Bot | 12 January 2021, 00:51:27 UTC | Merge remote-tracking branch 'origin/master' into release-4.2 | 12 January 2021, 00:51:27 UTC |
b0f5e35 | Andrew Branch | 12 January 2021, 00:46:08 UTC | 'in' should not operate on primitive types (#41928 + @andrewbranch) (#42288) * 'in' should not operate on primitive types * accept baselines of failing tests * review * update error message * check if constraint of right type is assignable to a non primitive or instantiable non primitive * do not throw errors where narrowing is impossible * accept baselines * fix test case failures * Add more accurate comment discussion and document failing edge case in test * Update baselines Co-authored-by: Jonas Hübotter <jonas.huebotter@gmail.com> | 12 January 2021, 00:46:08 UTC |
c456bbd | Anders Hejlsberg | 11 January 2021, 23:29:46 UTC | Support re-aliasing of type alias instantiations (#42284) * New aliases for type alias instantiations * New aliases for conditional, mapped, and anonymous object type instantiations * Accept new baselines * Fix issues with re-aliasing * Accept new baselines | 11 January 2021, 23:29:46 UTC |
1ecf228 | Oleksandr T | 11 January 2021, 17:25:51 UTC | fix(42166): allow assertion signature for private identifiers (#42176) | 11 January 2021, 17:25:51 UTC |