Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/compiler/checker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6333,7 +6333,7 @@ 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) {
Expand Down
Original file line number Diff line number Diff line change
@@ -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 {
export function method(): void;
export namespace method {
export const prop: number;
}
}
Original file line number Diff line number Diff line change
@@ -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))

Original file line number Diff line number Diff line change
@@ -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

Original file line number Diff line number Diff line change
@@ -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;