mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-05-19 01:33:15 -05:00
Ensure type/namespaceish statics are included in the list of namespace merge members (#38920)
* Ensure type/namespaceish statics are included in the list of namespace merge members * Simplit into two lines * Update baseline post-merge
This commit is contained in:
@@ -6510,7 +6510,8 @@ namespace ts {
|
||||
}
|
||||
|
||||
function isNamespaceMember(p: Symbol) {
|
||||
return !(p.flags & SymbolFlags.Prototype || p.escapedName === "prototype" || p.valueDeclaration && isClassLike(p.valueDeclaration.parent));
|
||||
return !!(p.flags & (SymbolFlags.Type | SymbolFlags.Namespace | SymbolFlags.Alias)) ||
|
||||
!(p.flags & SymbolFlags.Prototype || p.escapedName === "prototype" || p.valueDeclaration && isClassLike(p.valueDeclaration.parent));
|
||||
}
|
||||
|
||||
function serializeAsClass(symbol: Symbol, localName: string, modifierFlags: ModifierFlags) {
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
//// [source.js]
|
||||
export class Clazz {
|
||||
static method() { }
|
||||
}
|
||||
|
||||
Clazz.method.prop = 5;
|
||||
|
||||
//// [source.js]
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.Clazz = void 0;
|
||||
var Clazz = /** @class */ (function () {
|
||||
function Clazz() {
|
||||
}
|
||||
Clazz.method = function () { };
|
||||
return Clazz;
|
||||
}());
|
||||
exports.Clazz = Clazz;
|
||||
Clazz.method.prop = 5;
|
||||
|
||||
|
||||
//// [source.d.ts]
|
||||
export class Clazz {
|
||||
}
|
||||
export namespace Clazz {
|
||||
function method(): void;
|
||||
namespace method {
|
||||
const prop: number;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
=== tests/cases/conformance/jsdoc/declarations/source.js ===
|
||||
export class Clazz {
|
||||
>Clazz : Symbol(Clazz, Decl(source.js, 0, 0), Decl(source.js, 2, 1))
|
||||
|
||||
static method() { }
|
||||
>method : Symbol(Clazz.method, Decl(source.js, 0, 20), Decl(source.js, 4, 6))
|
||||
}
|
||||
|
||||
Clazz.method.prop = 5;
|
||||
>Clazz.method.prop : Symbol(Clazz.method.prop, Decl(source.js, 2, 1))
|
||||
>Clazz.method : Symbol(Clazz.method, Decl(source.js, 0, 20), Decl(source.js, 4, 6))
|
||||
>Clazz : Symbol(Clazz, Decl(source.js, 0, 0), Decl(source.js, 2, 1))
|
||||
>method : Symbol(Clazz.method, Decl(source.js, 0, 20), Decl(source.js, 4, 6))
|
||||
>prop : Symbol(Clazz.method.prop, Decl(source.js, 2, 1))
|
||||
|
||||
@@ -0,0 +1,17 @@
|
||||
=== tests/cases/conformance/jsdoc/declarations/source.js ===
|
||||
export class Clazz {
|
||||
>Clazz : Clazz
|
||||
|
||||
static method() { }
|
||||
>method : typeof Clazz.method
|
||||
}
|
||||
|
||||
Clazz.method.prop = 5;
|
||||
>Clazz.method.prop = 5 : 5
|
||||
>Clazz.method.prop : number
|
||||
>Clazz.method : typeof Clazz.method
|
||||
>Clazz : typeof Clazz
|
||||
>method : typeof Clazz.method
|
||||
>prop : number
|
||||
>5 : 5
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
// @allowJs: true
|
||||
// @checkJs: true
|
||||
// @target: es5
|
||||
// @outDir: ./out
|
||||
// @declaration: true
|
||||
// @filename: source.js
|
||||
export class Clazz {
|
||||
static method() { }
|
||||
}
|
||||
|
||||
Clazz.method.prop = 5;
|
||||
Reference in New Issue
Block a user