Update additional test files with comprehensive module-to-namespace replacement

Co-authored-by: RyanCavanaugh <6685088+RyanCavanaugh@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot] 2025-09-04 16:03:05 +00:00
parent e6ee96d357
commit 8387013e7e
369 changed files with 712 additions and 712 deletions

View File

@ -1,5 +1,5 @@
namespace M {
export module N {
export namespace N {
}
export import X = N;
}

View File

@ -1,6 +1,6 @@
// @target: es5
declare module M {
declare namespace M {
class C {
get X() { return 1; }
set X(v) { }

View File

@ -4,7 +4,7 @@ namespace foo {
export class Provide {
}
export module bar { export module baz {export class boo {}}}
export namespace bar { export module baz {export class boo {}}}
}
import provide = foo;

View File

@ -1,7 +1,7 @@
namespace foo {
export class Provide {
}
export module bar { export module baz {export class boo {}}}
export namespace bar { export module baz {export class boo {}}}
}
import provide = foo;

View File

@ -2,7 +2,7 @@
// @Filename: aliasOnMergedModuleInterface_0.ts
declare module "foo"
{
module B {
namespace B {
export interface A {
}
}

View File

@ -1,4 +1,4 @@
declare module M {
declare namespace M {
enum E {
e = 3
}

View File

@ -1,3 +1,3 @@
declare function f();
declare module f { var x }
declare namespace f { var x }
declare function f(x);

View File

@ -1,4 +1,4 @@
declare module Foo {
declare namespace Foo {
function a():void;
var b:number;
class C {}
@ -8,7 +8,7 @@ Foo.a();
Foo.b;
var c = new Foo.C();
declare module Foo2 {
declare namespace Foo2 {
export function a(): void;
export var b: number;
export class C { }

View File

@ -1,4 +1,4 @@
declare module foo {
declare namespace foo {
class A { }
class B extends A { }
}

View File

@ -1,4 +1,4 @@
declare module Foo {
declare namespace Foo {
enum Bar {
a = `1`,
b = '2',

View File

@ -1,4 +1,4 @@
declare module M1 {
declare namespace M1 {
while(true);
export var v1 = () => false;

View File

@ -1,4 +1,4 @@
declare module M {
declare namespace M {
break;
continue;
debugger;

View File

@ -1,4 +1,4 @@
declare module M {
declare namespace M {
interface iBar { t: any; }
interface iFoo extends iBar {
s: any;

View File

@ -1,9 +1,9 @@
declare module WinJS {
declare namespace WinJS {
class Promise<T> {
then<U>(success?: (value: T) => Promise<U>, error?: (error: any) => Promise<U>, progress?: (progress: any) => void): Promise<U>;
}
}
declare module Data {
declare namespace Data {
export interface IListItem<T> {
itemIndex: number;
key: any;

View File

@ -1,4 +1,4 @@
declare module m {
declare namespace m {
var f;
var prototype; // This should be error since prototype would be static property on class m
}

View File

@ -108,7 +108,7 @@ export declare class Promise<R> implements Promise.Thenable<R> {
static filter<R>(dit: typeof Promise, values: R[], filterer: (item: R, index: number, arrayLength: number) => boolean): Promise<R[]>;
}
export declare module Promise {
export declare namespace Promise {
export interface Thenable<R> {
then<U>(onFulfilled: (value: R) => Thenable<U>, onRejected: (error: any) => Thenable<U>): Thenable<U>;
then<U>(onFulfilled: (value: R) => Thenable<U>, onRejected?: (error: any) => U): Thenable<U>;

View File

@ -1,6 +1,6 @@
// @module: commonjs
// @Filename: chainedImportAlias_file0.ts
export module m {
export namespace m {
export function foo() { }
}

View File

@ -1,6 +1,6 @@
namespace M {
export class N { }
export module N {
export namespace N {
export var v = 0;
}
}

View File

@ -51,7 +51,7 @@ namespace m1 {
namespace m2 {
export module m3 {
export namespace m3 {
export class c extends b {
}
export class ib2 implements m1.ib {

View File

@ -6,7 +6,7 @@ namespace A {
}
namespace A {
export module B {
export namespace B {
export var x = 1;
}
}

View File

@ -1,7 +1,7 @@
namespace M
{
export class C { }
export module C {
export namespace C {
export var C = M.C
}
}

View File

@ -4,7 +4,7 @@ export declare class require {
}
export declare class exports {
}
declare module m1 {
declare namespace m1 {
class require {
}
class exports {
@ -22,7 +22,7 @@ declare class require {
}
declare class exports {
}
declare module m3 {
declare namespace m3 {
class require {
}
class exports {

View File

@ -8,7 +8,7 @@ export declare enum exports {
_thisVal1,
_thisVal2,
}
declare module m1 {
declare namespace m1 {
enum require {
_thisVal1,
_thisVal2,
@ -38,7 +38,7 @@ declare enum exports {
_thisVal1,
_thisVal2,
}
declare module m3 {
declare namespace m3 {
enum require {
_thisVal1,
_thisVal2,

View File

@ -3,7 +3,7 @@ export declare function exports(): number;
export declare function require(): string[];
declare module m1 {
declare namespace m1 {
function exports(): string;
function require(): number;
}

View File

@ -1,6 +1,6 @@
declare function exports(): number;
declare function require(): string;
declare module m3 {
declare namespace m3 {
function exports(): string[];
function require(): number[];
}

View File

@ -1,6 +1,6 @@
//@module: amd
//@filename: collisionExportsRequireAndAmbientModule_externalmodule.ts
export declare module require {
export declare namespace require {
export interface I {
}
export class C {
@ -9,7 +9,7 @@ export declare module require {
export function foo(): require.I {
return null;
}
export declare module exports {
export declare namespace exports {
export interface I {
}
export class C {
@ -18,7 +18,7 @@ export declare module exports {
export function foo2(): exports.I {
return null;
}
declare module m1 {
declare namespace m1 {
namespace require {
export interface I {
}
@ -33,13 +33,13 @@ declare module m1 {
}
}
namespace m2 {
export declare module require {
export declare namespace require {
export interface I {
}
export class C {
}
}
export declare module exports {
export declare namespace exports {
export interface I {
}
export class C {
@ -49,19 +49,19 @@ namespace m2 {
}
//@filename: collisionExportsRequireAndAmbientModule_globalFile.ts
declare module require {
declare namespace require {
export interface I {
}
export class C {
}
}
declare module exports {
declare namespace exports {
export interface I {
}
export class C {
}
}
declare module m3 {
declare namespace m3 {
namespace require {
export interface I {
}
@ -76,13 +76,13 @@ declare module m3 {
}
}
namespace m4 {
export declare module require {
export declare namespace require {
export interface I {
}
export class C {
}
}
export declare module exports {
export declare namespace exports {
export interface I {
}
export class C {

View File

@ -2,7 +2,7 @@
//@filename: collisionExportsRequireAndAmbientVar_externalmodule.ts
export declare var exports: number;
export declare var require: string;
declare module m1 {
declare namespace m1 {
var exports: string;
var require: number;
}
@ -15,7 +15,7 @@ namespace m2 {
//@filename: collisionExportsRequireAndAmbientVar_globalFile.ts
declare var exports: number;
declare var require: string;
declare module m3 {
declare namespace m3 {
var exports: string;
var require: number;
}

View File

@ -1,5 +1,5 @@
//@module: amd
export module m {
export namespace m {
export class c {
}
}

View File

@ -1,6 +1,6 @@
//@module: amd
//@filename: collisionExportsRequireAndModule_externalmodule.ts
export module require {
export namespace require {
export interface I {
}
export class C {
@ -9,7 +9,7 @@ export module require {
export function foo(): require.I {
return null;
}
export module exports {
export namespace exports {
export interface I {
}
export class C {
@ -33,13 +33,13 @@ namespace m1 {
}
}
namespace m2 {
export module require {
export namespace require {
export interface I {
}
export class C {
}
}
export module exports {
export namespace exports {
export interface I {
}
export class C {
@ -75,13 +75,13 @@ namespace m3 {
}
}
namespace m4 {
export module require {
export namespace require {
export interface I {
}
export class C {
}
}
export module exports {
export namespace exports {
export interface I {
}
export class C {

View File

@ -1,12 +1,12 @@
//@module: amd
export module require { // no error
export namespace require { // no error
export interface I {
}
}
export function foo(): require.I {
return null;
}
export module exports { // no error
export namespace exports { // no error
export interface I {
}
}

View File

@ -5,18 +5,18 @@
*/
/*! Don't keep this pinned comment */
declare module C {
declare namespace C {
function foo();
}
// Don't keep this comment.
declare module D {
declare namespace D {
class bar { }
}
//@filename: b.ts
///<reference path="a.ts"/>
declare module E {
declare namespace E {
class foobar extends D.bar {
foo();
}

View File

@ -5,7 +5,7 @@
// @Filename: commentsExternalModules_0.ts
/** Module comment*/
export module m1 {
export namespace m1 {
/** b's comment*/
export var b: number;
/** foo's comment*/
@ -13,7 +13,7 @@ export module m1 {
return b;
}
/** m2 comments*/
export module m2 {
export namespace m2 {
/** class comment;*/
export class c {
};
@ -29,7 +29,7 @@ m1.fooExport();
var myvar = new m1.m2.c();
/** Module comment */
export module m4 {
export namespace m4 {
/** b's comment */
export var b: number;
/** foo's comment
@ -39,7 +39,7 @@ export module m4 {
}
/** m2 comments
*/
export module m2 {
export namespace m2 {
/** class comment; */
export class c {
};

View File

@ -5,7 +5,7 @@
// @Filename: commentsExternalModules2_0.ts
/** Module comment*/
export module m1 {
export namespace m1 {
/** b's comment*/
export var b: number;
/** foo's comment*/
@ -13,7 +13,7 @@ export module m1 {
return b;
}
/** m2 comments*/
export module m2 {
export namespace m2 {
/** class comment;*/
export class c {
};
@ -29,7 +29,7 @@ m1.fooExport();
var myvar = new m1.m2.c();
/** Module comment */
export module m4 {
export namespace m4 {
/** b's comment */
export var b: number;
/** foo's comment
@ -39,7 +39,7 @@ export module m4 {
}
/** m2 comments
*/
export module m2 {
export namespace m2 {
/** class comment; */
export class c {
};

View File

@ -5,7 +5,7 @@
// @Filename: commentsExternalModules2_0.ts
/** Module comment*/
export module m1 {
export namespace m1 {
/** b's comment*/
export var b: number;
/** foo's comment*/
@ -13,7 +13,7 @@ export module m1 {
return b;
}
/** m2 comments*/
export module m2 {
export namespace m2 {
/** class comment;*/
export class c {
};
@ -29,7 +29,7 @@ m1.fooExport();
var myvar = new m1.m2.c();
/** Module comment */
export module m4 {
export namespace m4 {
/** b's comment */
export var b: number;
/** foo's comment
@ -39,7 +39,7 @@ export module m4 {
}
/** m2 comments
*/
export module m2 {
export namespace m2 {
/** class comment; */
export class c {
};

View File

@ -10,7 +10,7 @@ namespace m1 {
return b;
}
/** m2 comments*/
export module m2 {
export namespace m2 {
/** class comment;*/
export class c {
};
@ -56,7 +56,7 @@ module m3.m4.m5 {
new m3.m4.m5.c();
/** module comment of m4.m5.m6*/
module m4.m5.m6 {
export module m7 {
export namespace m7 {
/** Exported class comment*/
export class c {
}
@ -66,7 +66,7 @@ new m4.m5.m6.m7.c();
/** module comment of m5.m6.m7*/
module m5.m6.m7 {
/** module m8 comment*/
export module m8 {
export namespace m8 {
/** Exported class comment*/
export class c {
}
@ -74,7 +74,7 @@ module m5.m6.m7 {
}
new m5.m6.m7.m8.c();
module m6.m7 {
export module m8 {
export namespace m8 {
/** Exported class comment*/
export class c {
}
@ -83,7 +83,7 @@ module m6.m7 {
new m6.m7.m8.c();
module m7.m8 {
/** module m9 comment*/
export module m9 {
export namespace m9 {
/** Exported class comment*/
export class c {
}

View File

@ -5,13 +5,13 @@
// @Filename: commentsMultiModuleMultiFile_0.ts
/** this is multi declare module*/
export module multiM {
export namespace multiM {
/// class b comment
export class b {
}
}
/** thi is multi module 2*/
export module multiM {
export namespace multiM {
/** class c comment*/
export class c {
}
@ -27,7 +27,7 @@ new multiM.c();
// @Filename: commentsMultiModuleMultiFile_1.ts
import m = require('commentsMultiModuleMultiFile_0');
/** this is multi module 3 comment*/
export module multiM {
export namespace multiM {
/** class d comment*/
export class d {
}

View File

@ -82,7 +82,7 @@ namespace m1 {
}
/// module m2
export module m2 {
export namespace m2 {
}
}

View File

@ -82,7 +82,7 @@ namespace m1 {
}
/// module m2
export module m2 {
export namespace m2 {
}
}

View File

@ -25,7 +25,7 @@ interface N2<T> extends N1<T> {
// Test that complex recursive collections can pass the `extends` assignability check without
// running out of memory. This bug was exposed in Typescript 2.4 when more generic signatures
// started being checked.
declare module Immutable {
declare namespace Immutable {
export function fromJS(jsValue: any, reviver?: (key: string | number, sequence: Collection.Keyed<string, any> | Collection.Indexed<any>, path?: Array<string | number>) => any): any;
export function is(first: any, second: any): boolean;
export function hash(value: any): number;
@ -40,7 +40,7 @@ declare module Immutable {
equals(other: any): boolean;
hashCode(): number;
}
export module List {
export namespace List {
function isList(maybeList: any): maybeList is List<any>;
function of<T>(...values: Array<T>): List<T>;
}
@ -85,7 +85,7 @@ declare module Immutable {
filter<F extends T>(predicate: (value: T, index: number, iter: this) => value is F, context?: any): List<F>;
filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this;
}
export module Map {
export namespace Map {
function isMap(maybeMap: any): maybeMap is Map<any, any>;
function of(...keyValues: Array<any>): Map<any, any>;
}
@ -131,7 +131,7 @@ declare module Immutable {
filter<F extends V>(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Map<K, F>;
filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this;
}
export module OrderedMap {
export namespace OrderedMap {
function isOrderedMap(maybeOrderedMap: any): maybeOrderedMap is OrderedMap<any, any>;
}
export function OrderedMap<K, V>(collection: Iterable<[K, V]>): OrderedMap<K, V>;
@ -150,7 +150,7 @@ declare module Immutable {
filter<F extends V>(predicate: (value: V, key: K, iter: this) => value is F, context?: any): OrderedMap<K, F>;
filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this;
}
export module Set {
export namespace Set {
function isSet(maybeSet: any): maybeSet is Set<any>;
function of<T>(...values: Array<T>): Set<T>;
function fromKeys<T>(iter: Collection<T, any>): Set<T>;
@ -182,7 +182,7 @@ declare module Immutable {
filter<F extends T>(predicate: (value: T, key: never, iter: this) => value is F, context?: any): Set<F>;
filter(predicate: (value: T, key: never, iter: this) => any, context?: any): this;
}
export module OrderedSet {
export namespace OrderedSet {
function isOrderedSet(maybeOrderedSet: any): boolean;
function of<T>(...values: Array<T>): OrderedSet<T>;
function fromKeys<T>(iter: Collection<T, any>): OrderedSet<T>;
@ -203,7 +203,7 @@ declare module Immutable {
zipWith<U, V, Z>(zipper: (value: T, otherValue: U, thirdValue: V) => Z, otherCollection: Collection<any, U>, thirdCollection: Collection<any, V>): OrderedSet<Z>;
zipWith<Z>(zipper: (...any: Array<any>) => Z, ...collections: Array<Collection<any, any>>): OrderedSet<Z>;
}
export module Stack {
export namespace Stack {
function isStack(maybeStack: any): maybeStack is Stack<any>;
function of<T>(...values: Array<T>): Stack<T>;
}
@ -234,7 +234,7 @@ declare module Immutable {
}
export function Range(start?: number, end?: number, step?: number): Seq.Indexed<number>;
export function Repeat<T>(value: T, times?: number): Seq.Indexed<T>;
export module Record {
export namespace Record {
export function isRecord(maybeRecord: any): maybeRecord is Record.Instance<any>;
export function getDescriptiveName(record: Instance<any>): string;
export interface Class<T extends Object> {
@ -283,10 +283,10 @@ declare module Immutable {
}
}
export function Record<T>(defaultValues: T, name?: string): Record.Class<T>;
export module Seq {
export namespace Seq {
function isSeq(maybeSeq: any): maybeSeq is Seq.Indexed<any> | Seq.Keyed<any, any>;
function of<T>(...values: Array<T>): Seq.Indexed<T>;
export module Keyed {}
export namespace Keyed {}
export function Keyed<K, V>(collection: Iterable<[K, V]>): Seq.Keyed<K, V>;
export function Keyed<V>(obj: {[key: string]: V}): Seq.Keyed<string, V>;
export function Keyed<K, V>(): Seq.Keyed<K, V>;
@ -304,7 +304,7 @@ declare module Immutable {
filter<F extends V>(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Seq.Keyed<K, F>;
filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this;
}
module Indexed {
namespace Indexed {
function of<T>(...values: Array<T>): Seq.Indexed<T>;
}
export function Indexed(): Seq.Indexed<any>;
@ -320,7 +320,7 @@ declare module Immutable {
filter<F extends T>(predicate: (value: T, index: number, iter: this) => value is F, context?: any): Seq.Indexed<F>;
filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this;
}
export module Set {
export namespace Set {
function of<T>(...values: Array<T>): Seq.Set<T>;
}
export function Set(): Seq.Set<any>;
@ -354,12 +354,12 @@ declare module Immutable {
filter<F extends V>(predicate: (value: V, key: K, iter: this) => value is F, context?: any): Seq<K, F>;
filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this;
}
export module Collection {
export namespace Collection {
function isKeyed(maybeKeyed: any): maybeKeyed is Collection.Keyed<any, any>;
function isIndexed(maybeIndexed: any): maybeIndexed is Collection.Indexed<any>;
function isAssociative(maybeAssociative: any): maybeAssociative is Collection.Keyed<any, any> | Collection.Indexed<any>;
function isOrdered(maybeOrdered: any): boolean;
export module Keyed {}
export namespace Keyed {}
export function Keyed<K, V>(collection: Iterable<[K, V]>): Collection.Keyed<K, V>;
export function Keyed<V>(obj: {[key: string]: V}): Collection.Keyed<string, V>;
export interface Keyed<K, V> extends Collection<K, V> {
@ -378,7 +378,7 @@ declare module Immutable {
filter(predicate: (value: V, key: K, iter: this) => any, context?: any): this;
[Symbol.iterator](): IterableIterator<[K, V]>;
}
export module Indexed {}
export namespace Indexed {}
export function Indexed<T>(collection: Iterable<T>): Collection.Indexed<T>;
export interface Indexed<T> extends Collection<number, T> {
toJS(): Array<any>;
@ -410,7 +410,7 @@ declare module Immutable {
filter(predicate: (value: T, index: number, iter: this) => any, context?: any): this;
[Symbol.iterator](): IterableIterator<T>;
}
export module Set {}
export namespace Set {}
export function Set<T>(collection: Iterable<T>): Collection.Set<T>;
export interface Set<T> extends Collection<never, T> {
toJS(): Array<any>;

View File

@ -1,6 +1,6 @@
// @target: es5
namespace m1 {
export module m2 {
export namespace m2 {
export function f1(c1: C1) {
@ -69,7 +69,7 @@ class C2 {
}
namespace m2 {
export module m3 {
export namespace m3 {
export class c_pr implements mglo5.i5, mglo5.i6 {
f1() {
@ -82,7 +82,7 @@ namespace m2 {
}
namespace m5 {
export module m6 {
export namespace m6 {
function f1() {
return new C();
}

View File

@ -1,7 +1,7 @@
// @target: ES6
declare module M {
declare namespace M {
const x: number;
}

View File

@ -5,7 +5,7 @@ declare const c1: boolean = true;
declare const c2: number = 0;
declare const c3 = null, c4 :string = "", c5: any = 0;
declare module M {
declare namespace M {
const c6 = 0;
const c7: number = 7;
}

View File

@ -5,7 +5,7 @@ declare const c1: boolean;
declare const c2: number;
declare const c3, c4 :string, c5: any;
declare module M {
declare namespace M {
const c6;
const c7: number;
}

View File

@ -2,7 +2,7 @@
// @noTypesAndSymbols: true
// @filename: foo.ts
export module ConstEnumOnlyModule {
export namespace ConstEnumOnlyModule {
export const enum ConstFooEnum {
Some,
Values,

View File

@ -48,8 +48,8 @@ const enum Comments {
}
namespace A {
export module B {
export module C {
export namespace B {
export namespace C {
export const enum E {
V1 = 1,
V2 = A.B.C.E.V1 | 100
@ -59,8 +59,8 @@ namespace A {
}
namespace A {
export module B {
export module C {
export namespace B {
export namespace C {
export const enum E {
V3 = A.B.C.E["V2"] & 200,
V4 = A.B.C.E[`V1`] << 1,
@ -70,8 +70,8 @@ namespace A {
}
namespace A1 {
export module B {
export module C {
export namespace B {
export namespace C {
export const enum E {
V1 = 10,
V2 = 110,
@ -81,15 +81,15 @@ namespace A1 {
}
namespace A2 {
export module B {
export module C {
export namespace B {
export namespace C {
export const enum E {
V1 = 10,
V2 = 110,
}
}
// module C will be classified as value
export module C {
export namespace C {
var x = 1
}
}

View File

@ -1,4 +1,4 @@
declare module M {
declare namespace M {
export class Function {
constructor(...args: string[]);
}

View File

@ -1,6 +1,6 @@
interface IArguments {}
declare module M {
declare namespace M {
export function RegExp(pattern: string): RegExp;
export function RegExp(pattern: string, flags: string): RegExp;
export class RegExp {

View File

@ -14,7 +14,7 @@ declare module "fs" {
import fs = module("fs");
module TypeScriptAllInOne {
namespace TypeScriptAllInOne {
export class Program {
static Main(...args: string[]) {
try {

View File

@ -2,7 +2,7 @@
//@declaration: true
declare module "test" {
module A {
namespace A {
class C {
}
}

View File

@ -1,7 +1,7 @@
//@module: commonjs
// @declaration: true
namespace m3 {
export module m2 {
export namespace m2 {
export interface connectModule {
(res, req, next): void;
}

View File

@ -3,7 +3,7 @@
// @Filename: declFileExportImportChain_a.ts
namespace m1 {
export module m2 {
export namespace m2 {
export class c1 {
}
}

View File

@ -3,7 +3,7 @@
// @Filename: declFileExportImportChain2_a.ts
namespace m1 {
export module m2 {
export namespace m2 {
export class c1 {
}
}

View File

@ -1,6 +1,6 @@
//@module: commonjs
// @declaration: true
export module C {
export namespace C {
export class A<T>{ }
export class B { }

View File

@ -1,7 +1,7 @@
// @declaration: true
// @module: commonjs
namespace m {
export module c {
export namespace c {
export class c {
}
}

View File

@ -11,7 +11,7 @@ namespace M {
export type C = c;
export module m {
export namespace m {
export class c {
}
}
@ -27,7 +27,7 @@ interface Window {
namespace M {
export type W = Window | string;
export module N {
export namespace N {
export class Window { }
export var p: W;
}

View File

@ -8,7 +8,7 @@ interface Window {
namespace M {
type W = Window | string;
export module N {
export namespace N {
export class Window { }
export var p: W; // Should report error that W is private
}
@ -16,7 +16,7 @@ namespace M {
namespace M1 {
export type W = Window | string;
export module N {
export namespace N {
export class Window { }
export var p: W; // No error
}

View File

@ -1,11 +1,11 @@
// @declaration: true
// @Filename: declFile.d.ts
declare module M {
declare namespace M {
declare var x;
declare function f();
declare module N { }
declare namespace N { }
declare class C { }
}

View File

@ -2,11 +2,11 @@
// @outFile: out.js
// @Filename: declFile.d.ts
declare module M {
declare namespace M {
declare var x;
declare function f();
declare module N { }
declare namespace N { }
declare class C { }
}

View File

@ -10,6 +10,6 @@ module X.A.B.C {
}
module X.A.B.C {
export module A {
export namespace A {
}
}

View File

@ -2,7 +2,7 @@
// @module: commonjs
namespace m {
export module c {
export namespace c {
export class c {
}
}

View File

@ -6,10 +6,10 @@ export = f;
// @Filename: declarationEmit_nameConflicts_0.ts
import im = require('./declarationEmit_nameConflicts_1');
export module M {
export namespace M {
export function f() { }
export class C { }
export module N {
export namespace N {
export function g() { };
export interface I { }
}
@ -23,7 +23,7 @@ export module M {
export module M.P {
export function f() { }
export class C { }
export module N {
export namespace N {
export function g() { };
export interface I { }
}
@ -38,13 +38,13 @@ export module M.P {
export module M.Q {
export function f() { }
export class C { }
export module N {
export namespace N {
export function g() { };
export interface I { }
}
export interface b extends M.b { } // ok
export interface I extends M.c.I { } // ok
export module c {
export namespace c {
export interface I extends M.c.I { } // ok
}
}

View File

@ -2,7 +2,7 @@
module X.Y.base {
export function f() { }
export class C { }
export module M {
export namespace M {
export var v;
}
export enum E { }

View File

@ -2,13 +2,13 @@
// @module: commonjs
namespace M {
export interface D { }
export module D {
export namespace D {
export function f() { }
}
export module C {
export namespace C {
export function f() { }
}
export module E {
export namespace E {
export function f() { }
}
}

View File

@ -1,8 +1,8 @@
// @declaration: true
// @module: commonjs
export module C { export interface I { } }
export namespace C { export interface I { } }
export import v = C;
export module M {
export module C { export interface I { } }
export namespace M {
export namespace C { export interface I { } }
export var w: v.I; // Gets emitted as C.I, which is the wrong interface
}

View File

@ -4,7 +4,7 @@ declare module "express" {
function express(): express.ExpressServer;
module express {
namespace express {
export interface ExpressServer {

View File

@ -1,5 +1,5 @@
namespace M {
export module N {
export namespace N {
export function f(x:number)=>2*x;
export module X.Y.Z {
export var v2=f(v);
@ -10,7 +10,7 @@ namespace M {
module M.N {
export module X {
export namespace X {
export module Y.Z {
export var v=f(10);
}

View File

@ -11,7 +11,7 @@ export const [bar2] = [2];
export let {a: bar3} = { a: 1 };
export const {a: bar4} = { a: 1 };
export module M {
export namespace M {
export let baz = 100;
export const baz2 = true;
export let [bar5] = [1];

View File

@ -2,7 +2,7 @@
// @FileName: duplicateIdentifierShouldNotShortCircuitBaseTypeBinding_0.ts
export interface IPoint {}
export module Shapes {
export namespace Shapes {
export class Point implements IPoint {}

View File

@ -42,10 +42,10 @@ namespace Foo {
}
namespace N {
export module F {
export namespace F {
var t;
}
}
declare module N {
declare namespace N {
export function F(); // no error because function is ambient
}

View File

@ -12,7 +12,7 @@ class Foo {
}
namespace N {
export module F {
export namespace F {
var t;
}
}
@ -28,6 +28,6 @@ namespace Foo {
export var x: number; // error for redeclaring var in a different parent
}
declare module N {
declare namespace N {
export function F(); // no error because function is ambient
}

View File

@ -33,7 +33,7 @@ namespace M {
namespace inst {
var t;
}
export module inst { // one error
export namespace inst { // one error
var t;
}
}
@ -56,7 +56,7 @@ namespace M {
namespace M {
class C { }
namespace C { }
export module C { // Two visibility errors (one for the clodule symbol, and one for the merged container symbol)
export namespace C { // Two visibility errors (one for the clodule symbol, and one for the merged container symbol)
var t;
}
}

View File

@ -49,7 +49,7 @@ namespace Merged2 {
export enum E {
a, b, c
}
export module E {
export namespace E {
export let d = 5;
}
}

View File

@ -1,6 +1,6 @@
// @declaration: true
declare module mAmbient {
declare namespace mAmbient {
enum e {
x,
y,

View File

@ -1,7 +1,7 @@
// @target: ES5
// @module: AMD
export module M {
export namespace M {
// variable
export var M_V = 0;
// interface
@ -9,9 +9,9 @@ export module M {
//calss
export class M_C { }
// instantiated module
export module M_M { var x; }
export namespace M_M { var x; }
// uninstantiated module
export module M_MU { }
export namespace M_MU { }
// function
export function M_F() { }
// enum

View File

@ -31,7 +31,7 @@ class Foo extends Bar {
var f = new Foo();
declare module AmbientMod {
declare namespace AmbientMod {
export class Provide {
foo:number;
zoo:string;

View File

@ -1,4 +1,4 @@
declare module M {
declare namespace M {
export class Foo {
}
}

View File

@ -6,11 +6,11 @@ export class c {
}
export interface i {
}
export module m {
export namespace m {
export var x = 10;
}
export var x = 10;
export module uninstantiated {
export namespace uninstantiated {
}
// @filename: client.ts

View File

@ -7,11 +7,11 @@ export class c {
}
export interface i {
}
export module m {
export namespace m {
export var x = 10;
}
export var x = 10;
export module uninstantiated {
export namespace uninstantiated {
}
// @filename: client.ts

View File

@ -6,11 +6,11 @@ export class c {
}
export interface i {
}
export module m {
export namespace m {
export var x = 10;
}
export var x = 10;
export module uninstantiated {
export namespace uninstantiated {
}
// @filename: client.ts

View File

@ -7,11 +7,11 @@ export class c {
}
export interface i {
}
export module m {
export namespace m {
export var x = 10;
}
export var x = 10;
export module uninstantiated {
export namespace uninstantiated {
}
// @filename: client.ts

View File

@ -30,7 +30,7 @@ declare module "interface-variable" {
}
declare module "module" {
module Foo {
namespace Foo {
export var a: number;
export var b: number;
}
@ -42,7 +42,7 @@ declare module "interface-module" {
x: number;
y: number;
}
module Foo {
namespace Foo {
export var a: number;
export var b: number;
}
@ -50,7 +50,7 @@ declare module "interface-module" {
}
declare module "variable-module" {
module Foo {
namespace Foo {
interface Bar {
x: number;
y: number;
@ -70,7 +70,7 @@ declare module "function" {
declare module "function-module" {
function foo();
module foo {
namespace foo {
export var a: number;
export var b: number;
}
@ -90,7 +90,7 @@ declare module "class-module" {
x: number;
y: number;
}
module Foo {
namespace Foo {
export var a: number;
export var b: number;
}

View File

@ -8,7 +8,7 @@ declare module "other" {
declare module "server" {
import events = require("other"); // Ambient declaration, no error expected.
module S {
namespace S {
export var a: number;
}

View File

@ -2,7 +2,7 @@
// @declaration: true
// @filename: es6ImportNamedImportInIndirectExportAssignment_0.ts
export module a {
export namespace a {
export class c {
}
}

View File

@ -34,7 +34,7 @@ class c2 {
new c();
new c2();
export module m1 {
export namespace m1 {
export class c3 {
constructor() {
}

View File

@ -3,7 +3,7 @@ export const a = "hello";
export const x: string = a, y = x;
const b = y;
const c: string = b, d = c;
export module m1 {
export namespace m1 {
export const k = a;
export const l: string = b, m = k;
const n = m1.k;

View File

@ -11,7 +11,7 @@ const enum e2 {
}
var x = e1.a;
var y = e2.x;
export module m1 {
export namespace m1 {
export const enum e3 {
a,
b,

View File

@ -13,7 +13,7 @@ const enum e2 {
}
var x = e1.a;
var y = e2.x;
export module m1 {
export namespace m1 {
export const enum e3 {
a,
b,

View File

@ -11,7 +11,7 @@ enum e2 {
}
var x = e1.a;
var y = e2.x;
export module m1 {
export namespace m1 {
export enum e3 {
a,
b,

View File

@ -6,7 +6,7 @@ function foo2() {
foo();
foo2();
export module m1 {
export namespace m1 {
export function foo3() {
}
function foo4() {

View File

@ -1,11 +1,11 @@
// @target: ES6
export module m {
export namespace m {
export var a = 10;
}
export import a1 = m.a;
import a2 = m.a;
var x = a1 + a2;
export module m1 {
export namespace m1 {
export import a3 = m.a;
import a4 = m.a;
var x = a1 + a2;

View File

@ -1,6 +1,6 @@
// @target: ES6
export module M {
export namespace M {
// variable
export var M_V = 0;
// interface
@ -8,9 +8,9 @@ export module M {
//calss
export class M_C { }
// instantiated module
export module M_M { var x; }
export namespace M_M { var x; }
// uninstantiated module
export module M_MU { }
export namespace M_MU { }
// function
export function M_F() { }
// enum

View File

@ -1,6 +1,6 @@
// @target: ES6
export module M {
export namespace M {
// variable
export var M_V = 0;
// interface
@ -8,9 +8,9 @@ export module M {
//calss
export class M_C { }
// instantiated module
export module M_M { var x; }
export namespace M_M { var x; }
// uninstantiated module
export module M_MU { }
export namespace M_MU { }
// function
export function M_F() { }
// enum
@ -21,7 +21,7 @@ export module M {
export import M_A = M_M;
}
export module M {
export namespace M {
// Reexports
export {M_V as v};
export {M_I as i};

View File

@ -3,7 +3,7 @@ export let a = "hello";
export let x: string = a, y = x;
let b = y;
let c: string = b, d = c;
export module m1 {
export namespace m1 {
export let k = a;
export let l: string = b, m = k;
let n = m1.k;

View File

@ -1,12 +1,12 @@
// @target: ES6
export module m1 {
export namespace m1 {
export var a = 10;
var b = 10;
export module innerExportedModule {
export namespace innerExportedModule {
export var k = 10;
var l = 10;
}
export module innerNonExportedModule {
export namespace innerNonExportedModule {
export var x = 10;
var y = 10;
}
@ -14,11 +14,11 @@ export module m1 {
namespace m2 {
export var a = 10;
var b = 10;
export module innerExportedModule {
export namespace innerExportedModule {
export var k = 10;
var l = 10;
}
export module innerNonExportedModule {
export namespace innerNonExportedModule {
export var x = 10;
var y = 10;
}

View File

@ -3,7 +3,7 @@ export var a = "hello";
export var x: string = a, y = x;
var b = y;
var c: string = b, d = c;
export module m1 {
export namespace m1 {
export var k = a;
export var l: string = b, m = k;
var n = m1.k;

View File

@ -8,7 +8,7 @@ namespace M {
}
}
declare module A {
declare namespace A {
export export var x;
export export function f()

View File

@ -1,5 +1,5 @@
//@module: commonjs
declare module http {
declare namespace http {
export interface Server { openPort: number; }
}

View File

@ -1,5 +1,5 @@
//@module: amd
declare module server {
declare namespace server {
interface Server extends Object { }
}

View File

@ -2,7 +2,7 @@ namespace K {
export class L {
constructor(public name: string) { }
}
export module L {
export namespace L {
export var y = 12;
export interface Point {
x: number;

View File

@ -1,5 +1,5 @@
declare module "m2" {
module X {
namespace X {
interface I { }
}
function Y();

Some files were not shown because too many files have changed in this diff Show More