mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-04 12:32:08 -06:00
visitNodesWithoutCopyingPositions always makes a new NodeArray (#59137)
This commit is contained in:
parent
0206f9fa6e
commit
66a762f59d
@ -8966,7 +8966,7 @@ export function createTypeChecker(host: TypeCheckerHost): TypeChecker {
|
||||
if (result) {
|
||||
if (result.pos !== -1 || result.end !== -1) {
|
||||
if (result === nodes) {
|
||||
result = factory.createNodeArray(nodes, nodes.hasTrailingComma);
|
||||
result = factory.createNodeArray(nodes.slice(), nodes.hasTrailingComma);
|
||||
}
|
||||
setTextRangePosEnd(result, -1, -1);
|
||||
}
|
||||
|
||||
38
tests/cases/fourslash/nodeArrayCloneCrash.ts
Normal file
38
tests/cases/fourslash/nodeArrayCloneCrash.ts
Normal file
@ -0,0 +1,38 @@
|
||||
/// <reference path="fourslash.ts" />
|
||||
|
||||
// @module: preserve
|
||||
|
||||
// @Filename: /TLLineShape.ts
|
||||
//// import { createShapePropsMigrationIds } from "./TLShape";
|
||||
//// createShapePropsMigrationIds/**/
|
||||
|
||||
// @Filename: /TLShape.ts
|
||||
//// import { T } from "@tldraw/validate";
|
||||
////
|
||||
//// /**
|
||||
//// * @public
|
||||
//// */
|
||||
//// export function createShapePropsMigrationIds<T>(): { [k in keyof T]: any } {
|
||||
//// return;
|
||||
//// }
|
||||
|
||||
verify.completions({
|
||||
marker: "",
|
||||
includes: [
|
||||
{
|
||||
name: "createShapePropsMigrationIds",
|
||||
text: "(alias) function createShapePropsMigrationIds<T>(): { [k in keyof T]: any; }\nimport createShapePropsMigrationIds",
|
||||
tags: [{ name: "public", text: undefined }]
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
goTo.file("/TLShape.ts");
|
||||
verify.organizeImports(
|
||||
`
|
||||
/**
|
||||
* @public
|
||||
*/
|
||||
export function createShapePropsMigrationIds<T>(): { [k in keyof T]: any } {
|
||||
return;
|
||||
}`);
|
||||
Loading…
x
Reference in New Issue
Block a user