mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-12-11 09:24:19 -06:00
Remove deprecated originalKeywordKind and isInJSDocNamespace (#58228)
This commit is contained in:
parent
23e99c2b76
commit
72f413cea0
@ -1,51 +0,0 @@
|
||||
import {
|
||||
addObjectAllocatorPatcher,
|
||||
hasProperty,
|
||||
Identifier,
|
||||
identifierToKeywordKind,
|
||||
NodeFlags,
|
||||
} from "../_namespaces/ts";
|
||||
import { deprecate } from "../deprecate";
|
||||
|
||||
declare module "../../compiler/types" {
|
||||
export interface Identifier {
|
||||
/** @deprecated Use `idKeyword(identifier)` instead. */
|
||||
readonly originalKeywordKind?: SyntaxKind;
|
||||
|
||||
/** @deprecated Use `.parent` or the surrounding context to determine this instead. */
|
||||
readonly isInJSDocNamespace?: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
addObjectAllocatorPatcher(objectAllocator => {
|
||||
const Identifier = objectAllocator.getIdentifierConstructor();
|
||||
|
||||
if (!hasProperty(Identifier.prototype, "originalKeywordKind")) {
|
||||
Object.defineProperty(Identifier.prototype, "originalKeywordKind", {
|
||||
get: deprecate(function (this: Identifier) {
|
||||
return identifierToKeywordKind(this);
|
||||
}, {
|
||||
name: "originalKeywordKind",
|
||||
since: "5.0",
|
||||
warnAfter: "5.1",
|
||||
errorAfter: "5.2",
|
||||
message: "Use 'identifierToKeywordKind(identifier)' instead.",
|
||||
}),
|
||||
});
|
||||
}
|
||||
|
||||
if (!hasProperty(Identifier.prototype, "isInJSDocNamespace")) {
|
||||
Object.defineProperty(Identifier.prototype, "isInJSDocNamespace", {
|
||||
get: deprecate(function (this: Identifier) {
|
||||
// NOTE: Returns `true` or `undefined` to match previous possible values.
|
||||
return this.flags & NodeFlags.IdentifierIsInJSDocNamespace ? true : undefined;
|
||||
}, {
|
||||
name: "isInJSDocNamespace",
|
||||
since: "5.0",
|
||||
warnAfter: "5.1",
|
||||
errorAfter: "5.2",
|
||||
message: "Use '.parent' or the surrounding context to determine this instead.",
|
||||
}),
|
||||
});
|
||||
}
|
||||
});
|
||||
@ -2,4 +2,3 @@
|
||||
|
||||
export * from "../../compiler/_namespaces/ts";
|
||||
export * from "../deprecations";
|
||||
export * from "../5.0/identifierProperties";
|
||||
|
||||
@ -205,10 +205,6 @@ export function sourceFileToJSON(file: ts.Node): string {
|
||||
}
|
||||
break;
|
||||
|
||||
case "originalKeywordKind":
|
||||
o[propertyName] = getKindName((n as any)[propertyName]);
|
||||
break;
|
||||
|
||||
case "flags":
|
||||
// Clear the flags that are produced by aggregating child values. That is ephemeral
|
||||
// data we don't care about in the dump. We only care what the parser set directly
|
||||
|
||||
@ -4378,12 +4378,6 @@ declare namespace ts {
|
||||
interface Identifier {
|
||||
readonly text: string;
|
||||
}
|
||||
interface Identifier {
|
||||
/** @deprecated Use `idKeyword(identifier)` instead. */
|
||||
readonly originalKeywordKind?: SyntaxKind;
|
||||
/** @deprecated Use `.parent` or the surrounding context to determine this instead. */
|
||||
readonly isInJSDocNamespace?: boolean;
|
||||
}
|
||||
interface TransientIdentifier extends Identifier {
|
||||
resolvedSymbol: Symbol;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user