mirror of
https://github.com/microsoft/TypeScript.git
synced 2026-02-05 16:38:05 -06:00
[Transforms] Update baselines from merging with master (#8898)
* Update baselines from merging with master * Update sourcemap baselines Update sourcemap baselines * Update error baselines * Update baselines as the test-cases already include --module flag with amd * Fix baselines * Update baselines from merging with master. This is a fix in master (issue #8507) and the baselines was udpated in transforms before losing in merging master
This commit is contained in:
parent
c9ec4e22e7
commit
5853aad4ae
@ -7,14 +7,16 @@ function foo2(y = class {[x] = x}, x = 1) {
|
||||
|
||||
//// [capturedParametersInInitializers2.js]
|
||||
function foo(y, x) {
|
||||
if (y === void 0) { y = (function () {
|
||||
function class_1() {
|
||||
}
|
||||
class_1.c = x;
|
||||
return class_1;
|
||||
}()); }
|
||||
if (y === void 0) { y = (_a = (function () {
|
||||
function class_1() {
|
||||
}
|
||||
return class_1;
|
||||
}()),
|
||||
_a.c = x,
|
||||
_a); }
|
||||
if (x === void 0) { x = 1; }
|
||||
y.c;
|
||||
var _a;
|
||||
}
|
||||
function foo2(y, x) {
|
||||
if (y === void 0) { y = (function () {
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
//// [computedPropertyNamesSourceMap1_ES5.js.map]
|
||||
{"version":3,"file":"computedPropertyNamesSourceMap1_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES5.ts"],"names":[],"mappings":"AAAA;IAAA;IAOA,CAAC;IANG,YAAC,OAAO,CAAC,GAAT;QACI,QAAQ,CAAC;IACb,CAAC;IACD,sBAAI,aAAC,SAAU;aAAf;YACF,MAAM,CAAC,CAAC,CAAC;QACP,CAAC;;;OAAA;IACL,QAAC;AAAD,CAAC,AAPD,IAOC"}
|
||||
{"version":3,"file":"computedPropertyNamesSourceMap1_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES5.ts"],"names":[],"mappings":"AAAA;IAAA;IAOA,CAAC;IANG,YAAC,OAAO,CAAC,GAAT;QACI,QAAQ,CAAC;IACb,CAAC;IACD,sBAAI,sBAAW;aAAf;YACF,MAAM,CAAC,CAAC,CAAC;QACP,CAAC;;;OAAA;IACL,QAAC;AAAD,CAAC,AAPD,IAOC"}
|
||||
@ -78,17 +78,14 @@ sourceFile:computedPropertyNamesSourceMap1_ES5.ts
|
||||
>>> Object.defineProperty(C.prototype, "goodbye", {
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^
|
||||
4 > ^^^^^^^^^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^^^^
|
||||
1->
|
||||
>
|
||||
2 > get
|
||||
3 > [
|
||||
4 > "goodbye"]
|
||||
3 > ["goodbye"]
|
||||
1->Emitted(7, 5) Source(5, 5) + SourceIndex(0)
|
||||
2 >Emitted(7, 27) Source(5, 9) + SourceIndex(0)
|
||||
3 >Emitted(7, 40) Source(5, 10) + SourceIndex(0)
|
||||
4 >Emitted(7, 49) Source(5, 20) + SourceIndex(0)
|
||||
3 >Emitted(7, 49) Source(5, 20) + SourceIndex(0)
|
||||
---
|
||||
>>> get: function () {
|
||||
1 >^^^^^^^^^^^^^
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
//// [computedPropertyNamesSourceMap1_ES6.js.map]
|
||||
{"version":3,"file":"computedPropertyNamesSourceMap1_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES6.ts"],"names":[],"mappings":"AAAA;IACI,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,SAAS,CAAC;QACd,MAAM,CAAC,CAAC,CAAC;IACV,CAAC;AACF,CAAC;AAAA"}
|
||||
{"version":3,"file":"computedPropertyNamesSourceMap1_ES6.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap1_ES6.ts"],"names":[],"mappings":"AAAA;IACI,CAAC,OAAO,CAAC;QACL,QAAQ,CAAC;IAChB,CAAC;IACD,IAAI,CAAC,SAAS,CAAC;QACd,MAAM,CAAC,CAAC,CAAC;IACV,CAAC;CACD"}
|
||||
@ -20,7 +20,7 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts
|
||||
3 > ^^^^^^^
|
||||
4 > ^
|
||||
5 > ^^^^^->
|
||||
1->class C {
|
||||
1->class C {
|
||||
>
|
||||
2 > [
|
||||
3 > "hello"
|
||||
@ -34,7 +34,7 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts
|
||||
1->^^^^^^^^
|
||||
2 > ^^^^^^^^
|
||||
3 > ^
|
||||
1->() {
|
||||
1->() {
|
||||
>
|
||||
2 > debugger
|
||||
3 > ;
|
||||
@ -46,7 +46,7 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts
|
||||
1 >^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
1 >
|
||||
>
|
||||
2 > }
|
||||
1 >Emitted(4, 5) Source(4, 2) + SourceIndex(0)
|
||||
@ -58,7 +58,7 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts
|
||||
3 > ^
|
||||
4 > ^^^^^^^^^
|
||||
5 > ^
|
||||
1->
|
||||
1->
|
||||
>
|
||||
2 > get
|
||||
3 > [
|
||||
@ -76,7 +76,7 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts
|
||||
3 > ^
|
||||
4 > ^
|
||||
5 > ^
|
||||
1 >() {
|
||||
1 >() {
|
||||
>
|
||||
2 > return
|
||||
3 >
|
||||
@ -91,24 +91,17 @@ sourceFile:computedPropertyNamesSourceMap1_ES6.ts
|
||||
>>> }
|
||||
1 >^^^^
|
||||
2 > ^
|
||||
1 >
|
||||
1 >
|
||||
>
|
||||
2 > }
|
||||
1 >Emitted(7, 5) Source(7, 2) + SourceIndex(0)
|
||||
2 >Emitted(7, 6) Source(7, 3) + SourceIndex(0)
|
||||
---
|
||||
>>>}
|
||||
1 >
|
||||
2 >^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>
|
||||
2 >}
|
||||
1 >Emitted(8, 1) Source(8, 1) + SourceIndex(0)
|
||||
2 >Emitted(8, 2) Source(8, 2) + SourceIndex(0)
|
||||
1 >^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
>}
|
||||
1 >Emitted(8, 2) Source(8, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=computedPropertyNamesSourceMap1_ES6.js.map1->
|
||||
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1->
|
||||
1->Emitted(9, 1) Source(8, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>//# sourceMappingURL=computedPropertyNamesSourceMap1_ES6.js.map
|
||||
@ -1,11 +1,11 @@
|
||||
//// [computedPropertyNamesSourceMap2_ES5.ts]
|
||||
var v = {
|
||||
["hello"]() {
|
||||
debugger;
|
||||
},
|
||||
get ["goodbye"]() {
|
||||
return 0;
|
||||
}
|
||||
var v = {
|
||||
["hello"]() {
|
||||
debugger;
|
||||
},
|
||||
get ["goodbye"]() {
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
//// [computedPropertyNamesSourceMap2_ES5.js]
|
||||
|
||||
@ -1,2 +1,2 @@
|
||||
//// [computedPropertyNamesSourceMap2_ES5.js.map]
|
||||
{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC,GAAG;IACJ,GAAC,OAAO,CAAC,GAAT;QACI,QAAQ,CAAC;IAChB,CAAC;IACE,0BAAK,SAAU;aAAf;YACF,MAAM,CAAC,CAAC,CAAC;QACV,CAAC;;;MAAA;;CACD,CAAA"}
|
||||
{"version":3,"file":"computedPropertyNamesSourceMap2_ES5.js","sourceRoot":"","sources":["computedPropertyNamesSourceMap2_ES5.ts"],"names":[],"mappings":"AAAA,IAAI,CAAC;IACD,GAAC,OAAO,IAAR;QACI,QAAQ,CAAC;IAChB,CAAC;0BACM,aAAW;aAAf;YACF,MAAM,CAAC,CAAC,CAAC;QACV,CAAC;;;;OACD,CAAA"}
|
||||
@ -12,40 +12,34 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts
|
||||
1 >
|
||||
2 >^^^^
|
||||
3 > ^
|
||||
4 > ^^^
|
||||
5 > ^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
4 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
2 >var
|
||||
3 > v
|
||||
4 > =
|
||||
1 >Emitted(1, 1) Source(1, 1) + SourceIndex(0)
|
||||
2 >Emitted(1, 5) Source(1, 5) + SourceIndex(0)
|
||||
3 >Emitted(1, 6) Source(1, 6) + SourceIndex(0)
|
||||
4 >Emitted(1, 9) Source(1, 9) + SourceIndex(0)
|
||||
---
|
||||
>>> _a["hello"] = function () {
|
||||
1->^^^^
|
||||
2 > ^^^
|
||||
3 > ^^^^^^^
|
||||
4 > ^
|
||||
5 > ^^^
|
||||
1->{
|
||||
4 > ^^^^
|
||||
1-> = {
|
||||
>
|
||||
2 > [
|
||||
3 > "hello"
|
||||
4 > ]
|
||||
5 >
|
||||
4 >
|
||||
1->Emitted(2, 5) Source(2, 5) + SourceIndex(0)
|
||||
2 >Emitted(2, 8) Source(2, 6) + SourceIndex(0)
|
||||
3 >Emitted(2, 15) Source(2, 13) + SourceIndex(0)
|
||||
4 >Emitted(2, 16) Source(2, 14) + SourceIndex(0)
|
||||
5 >Emitted(2, 19) Source(2, 5) + SourceIndex(0)
|
||||
4 >Emitted(2, 19) Source(2, 5) + SourceIndex(0)
|
||||
---
|
||||
>>> debugger;
|
||||
1 >^^^^^^^^
|
||||
2 > ^^^^^^^^
|
||||
3 > ^
|
||||
1 >["hello"]() {
|
||||
1 >["hello"]() {
|
||||
>
|
||||
2 > debugger
|
||||
3 > ;
|
||||
@ -57,23 +51,20 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts
|
||||
1 >^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
1 >
|
||||
>
|
||||
2 > }
|
||||
1 >Emitted(4, 5) Source(4, 2) + SourceIndex(0)
|
||||
2 >Emitted(4, 6) Source(4, 3) + SourceIndex(0)
|
||||
---
|
||||
>>> Object.defineProperty(_a, "goodbye", {
|
||||
1->^^^^
|
||||
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
3 > ^^^^^^^^^
|
||||
1->,
|
||||
>
|
||||
2 > get [
|
||||
3 > "goodbye"]
|
||||
1->Emitted(5, 5) Source(5, 5) + SourceIndex(0)
|
||||
2 >Emitted(5, 31) Source(5, 10) + SourceIndex(0)
|
||||
3 >Emitted(5, 40) Source(5, 20) + SourceIndex(0)
|
||||
1->^^^^^^^^^^^^^^^^^^^^^^^^^^
|
||||
2 > ^^^^^^^^^^^^^
|
||||
1->,
|
||||
> get
|
||||
2 > ["goodbye"]
|
||||
1->Emitted(5, 27) Source(5, 9) + SourceIndex(0)
|
||||
2 >Emitted(5, 40) Source(5, 20) + SourceIndex(0)
|
||||
---
|
||||
>>> get: function () {
|
||||
1 >^^^^^^^^^^^^^
|
||||
@ -87,7 +78,7 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts
|
||||
3 > ^
|
||||
4 > ^
|
||||
5 > ^
|
||||
1->get ["goodbye"]() {
|
||||
1->get ["goodbye"]() {
|
||||
>
|
||||
2 > return
|
||||
3 >
|
||||
@ -103,7 +94,7 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts
|
||||
1 >^^^^^^^^
|
||||
2 > ^
|
||||
3 > ^^^^^^^^^^^^^^^^^->
|
||||
1 >
|
||||
1 >
|
||||
>
|
||||
2 > }
|
||||
1 >Emitted(8, 9) Source(7, 2) + SourceIndex(0)
|
||||
@ -112,21 +103,14 @@ sourceFile:computedPropertyNamesSourceMap2_ES5.ts
|
||||
>>> enumerable: true,
|
||||
>>> configurable: true
|
||||
>>> }),
|
||||
1->^^^^^^
|
||||
2 > ^->
|
||||
1->
|
||||
1->Emitted(11, 7) Source(7, 3) + SourceIndex(0)
|
||||
---
|
||||
>>> _a
|
||||
>>>);
|
||||
1->^
|
||||
2 > ^
|
||||
3 > ^^^^^^->
|
||||
1->
|
||||
>>> _a);
|
||||
1->^^^^^^^
|
||||
2 > ^
|
||||
1->
|
||||
>}
|
||||
2 >
|
||||
1->Emitted(13, 2) Source(8, 2) + SourceIndex(0)
|
||||
2 >Emitted(13, 3) Source(8, 2) + SourceIndex(0)
|
||||
2 >
|
||||
1->Emitted(12, 8) Source(8, 2) + SourceIndex(0)
|
||||
2 >Emitted(12, 9) Source(8, 2) + SourceIndex(0)
|
||||
---
|
||||
>>>var _a;
|
||||
>>>//# sourceMappingURL=computedPropertyNamesSourceMap2_ES5.js.map
|
||||
@ -1,6 +1,6 @@
|
||||
//// [declarationEmit_UnknownImport2.ts]
|
||||
|
||||
import Foo From './Foo'; // Syntax error
|
||||
|
||||
import Foo From './Foo'; // Syntax error
|
||||
export default Foo
|
||||
|
||||
//// [declarationEmit_UnknownImport2.js]
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
//// [tests/cases/conformance/es6/modules/defaultExportInAwaitExpression01.ts] ////
|
||||
|
||||
//// [a.ts]
|
||||
const x = new Promise( ( resolve, reject ) => { resolve( {} ); } );
|
||||
export default x;
|
||||
const x = new Promise( ( resolve, reject ) => { resolve( {} ); } );
|
||||
export default x;
|
||||
|
||||
//// [b.ts]
|
||||
import x from './a';
|
||||
|
||||
( async function() {
|
||||
const value = await x;
|
||||
}() );
|
||||
import x from './a';
|
||||
|
||||
( async function() {
|
||||
const value = await x;
|
||||
}() );
|
||||
|
||||
|
||||
//// [a.js]
|
||||
|
||||
@ -1,15 +1,15 @@
|
||||
//// [tests/cases/conformance/es6/modules/defaultExportInAwaitExpression02.ts] ////
|
||||
|
||||
//// [a.ts]
|
||||
const x = new Promise( ( resolve, reject ) => { resolve( {} ); } );
|
||||
export default x;
|
||||
const x = new Promise( ( resolve, reject ) => { resolve( {} ); } );
|
||||
export default x;
|
||||
|
||||
//// [b.ts]
|
||||
import x from './a';
|
||||
|
||||
( async function() {
|
||||
const value = await x;
|
||||
}() );
|
||||
import x from './a';
|
||||
|
||||
( async function() {
|
||||
const value = await x;
|
||||
}() );
|
||||
|
||||
|
||||
//// [a.js]
|
||||
|
||||
@ -1,210 +1,210 @@
|
||||
//// [tests/cases/compiler/es6ExportEqualsInterop.ts] ////
|
||||
|
||||
//// [modules.d.ts]
|
||||
|
||||
declare module "interface" {
|
||||
interface Foo {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
export = Foo;
|
||||
}
|
||||
|
||||
declare module "variable" {
|
||||
var Foo: {
|
||||
a: number;
|
||||
b: number;
|
||||
}
|
||||
export = Foo;
|
||||
}
|
||||
|
||||
declare module "interface-variable" {
|
||||
interface Foo {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
var Foo: {
|
||||
a: number;
|
||||
b: number;
|
||||
}
|
||||
export = Foo;
|
||||
}
|
||||
|
||||
declare module "module" {
|
||||
module Foo {
|
||||
export var a: number;
|
||||
export var b: number;
|
||||
}
|
||||
export = Foo;
|
||||
}
|
||||
|
||||
declare module "interface-module" {
|
||||
interface Foo {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
module Foo {
|
||||
export var a: number;
|
||||
export var b: number;
|
||||
}
|
||||
export = Foo;
|
||||
}
|
||||
|
||||
declare module "variable-module" {
|
||||
module Foo {
|
||||
interface Bar {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
}
|
||||
var Foo: {
|
||||
a: number;
|
||||
b: number;
|
||||
}
|
||||
export = Foo;
|
||||
}
|
||||
|
||||
declare module "function" {
|
||||
function foo();
|
||||
export = foo;
|
||||
}
|
||||
|
||||
declare module "function-module" {
|
||||
function foo();
|
||||
module foo {
|
||||
export var a: number;
|
||||
export var b: number;
|
||||
}
|
||||
export = foo;
|
||||
}
|
||||
|
||||
declare module "class" {
|
||||
class Foo {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
export = Foo;
|
||||
}
|
||||
|
||||
declare module "class-module" {
|
||||
class Foo {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
module Foo {
|
||||
export var a: number;
|
||||
export var b: number;
|
||||
}
|
||||
export = Foo;
|
||||
}
|
||||
|
||||
declare module "interface" {
|
||||
interface Foo {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
export = Foo;
|
||||
}
|
||||
|
||||
declare module "variable" {
|
||||
var Foo: {
|
||||
a: number;
|
||||
b: number;
|
||||
}
|
||||
export = Foo;
|
||||
}
|
||||
|
||||
declare module "interface-variable" {
|
||||
interface Foo {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
var Foo: {
|
||||
a: number;
|
||||
b: number;
|
||||
}
|
||||
export = Foo;
|
||||
}
|
||||
|
||||
declare module "module" {
|
||||
module Foo {
|
||||
export var a: number;
|
||||
export var b: number;
|
||||
}
|
||||
export = Foo;
|
||||
}
|
||||
|
||||
declare module "interface-module" {
|
||||
interface Foo {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
module Foo {
|
||||
export var a: number;
|
||||
export var b: number;
|
||||
}
|
||||
export = Foo;
|
||||
}
|
||||
|
||||
declare module "variable-module" {
|
||||
module Foo {
|
||||
interface Bar {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
}
|
||||
var Foo: {
|
||||
a: number;
|
||||
b: number;
|
||||
}
|
||||
export = Foo;
|
||||
}
|
||||
|
||||
declare module "function" {
|
||||
function foo();
|
||||
export = foo;
|
||||
}
|
||||
|
||||
declare module "function-module" {
|
||||
function foo();
|
||||
module foo {
|
||||
export var a: number;
|
||||
export var b: number;
|
||||
}
|
||||
export = foo;
|
||||
}
|
||||
|
||||
declare module "class" {
|
||||
class Foo {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
export = Foo;
|
||||
}
|
||||
|
||||
declare module "class-module" {
|
||||
class Foo {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
module Foo {
|
||||
export var a: number;
|
||||
export var b: number;
|
||||
}
|
||||
export = Foo;
|
||||
}
|
||||
|
||||
//// [main.ts]
|
||||
/// <reference path="modules.d.ts"/>
|
||||
|
||||
// import-equals
|
||||
import z1 = require("interface");
|
||||
import z2 = require("variable");
|
||||
import z3 = require("interface-variable");
|
||||
import z4 = require("module");
|
||||
import z5 = require("interface-module");
|
||||
import z6 = require("variable-module");
|
||||
import z7 = require("function");
|
||||
import z8 = require("function-module");
|
||||
import z9 = require("class");
|
||||
import z0 = require("class-module");
|
||||
|
||||
z1.a;
|
||||
z2.a;
|
||||
z3.a;
|
||||
z4.a;
|
||||
z5.a;
|
||||
z6.a;
|
||||
z7.a;
|
||||
z8.a;
|
||||
z9.a;
|
||||
z0.a;
|
||||
|
||||
// default import
|
||||
import x1 from "interface";
|
||||
import x2 from "variable";
|
||||
import x3 from "interface-variable";
|
||||
import x4 from "module";
|
||||
import x5 from "interface-module";
|
||||
import x6 from "variable-module";
|
||||
import x7 from "function";
|
||||
import x8 from "function-module";
|
||||
import x9 from "class";
|
||||
import x0 from "class-module";
|
||||
|
||||
// namespace import
|
||||
import * as y1 from "interface";
|
||||
import * as y2 from "variable";
|
||||
import * as y3 from "interface-variable";
|
||||
import * as y4 from "module";
|
||||
import * as y5 from "interface-module";
|
||||
import * as y6 from "variable-module";
|
||||
import * as y7 from "function";
|
||||
import * as y8 from "function-module";
|
||||
import * as y9 from "class";
|
||||
import * as y0 from "class-module";
|
||||
|
||||
y1.a;
|
||||
y2.a;
|
||||
y3.a;
|
||||
y4.a;
|
||||
y5.a;
|
||||
y6.a;
|
||||
y7.a;
|
||||
y8.a;
|
||||
y9.a;
|
||||
y0.a;
|
||||
|
||||
// named import
|
||||
import { a as a1 } from "interface";
|
||||
import { a as a2 } from "variable";
|
||||
import { a as a3 } from "interface-variable";
|
||||
import { a as a4 } from "module";
|
||||
import { a as a5 } from "interface-module";
|
||||
import { a as a6 } from "variable-module";
|
||||
import { a as a7 } from "function";
|
||||
import { a as a8 } from "function-module";
|
||||
import { a as a9 } from "class";
|
||||
import { a as a0 } from "class-module";
|
||||
|
||||
a1;
|
||||
a2;
|
||||
a3;
|
||||
a4;
|
||||
a5;
|
||||
a6;
|
||||
a7;
|
||||
a8;
|
||||
a9;
|
||||
a0;
|
||||
|
||||
// named export
|
||||
export { a as a1 } from "interface";
|
||||
export { a as a2 } from "variable";
|
||||
export { a as a3 } from "interface-variable";
|
||||
export { a as a4 } from "module";
|
||||
export { a as a5 } from "interface-module";
|
||||
export { a as a6 } from "variable-module";
|
||||
export { a as a7 } from "function";
|
||||
export { a as a8 } from "function-module";
|
||||
export { a as a9 } from "class";
|
||||
export { a as a0 } from "class-module";
|
||||
|
||||
// export-star
|
||||
export * from "interface";
|
||||
export * from "variable";
|
||||
export * from "interface-variable";
|
||||
export * from "module";
|
||||
export * from "interface-module";
|
||||
export * from "variable-module";
|
||||
export * from "function";
|
||||
export * from "function-module";
|
||||
export * from "class";
|
||||
export * from "class-module";
|
||||
/// <reference path="modules.d.ts"/>
|
||||
|
||||
// import-equals
|
||||
import z1 = require("interface");
|
||||
import z2 = require("variable");
|
||||
import z3 = require("interface-variable");
|
||||
import z4 = require("module");
|
||||
import z5 = require("interface-module");
|
||||
import z6 = require("variable-module");
|
||||
import z7 = require("function");
|
||||
import z8 = require("function-module");
|
||||
import z9 = require("class");
|
||||
import z0 = require("class-module");
|
||||
|
||||
z1.a;
|
||||
z2.a;
|
||||
z3.a;
|
||||
z4.a;
|
||||
z5.a;
|
||||
z6.a;
|
||||
z7.a;
|
||||
z8.a;
|
||||
z9.a;
|
||||
z0.a;
|
||||
|
||||
// default import
|
||||
import x1 from "interface";
|
||||
import x2 from "variable";
|
||||
import x3 from "interface-variable";
|
||||
import x4 from "module";
|
||||
import x5 from "interface-module";
|
||||
import x6 from "variable-module";
|
||||
import x7 from "function";
|
||||
import x8 from "function-module";
|
||||
import x9 from "class";
|
||||
import x0 from "class-module";
|
||||
|
||||
// namespace import
|
||||
import * as y1 from "interface";
|
||||
import * as y2 from "variable";
|
||||
import * as y3 from "interface-variable";
|
||||
import * as y4 from "module";
|
||||
import * as y5 from "interface-module";
|
||||
import * as y6 from "variable-module";
|
||||
import * as y7 from "function";
|
||||
import * as y8 from "function-module";
|
||||
import * as y9 from "class";
|
||||
import * as y0 from "class-module";
|
||||
|
||||
y1.a;
|
||||
y2.a;
|
||||
y3.a;
|
||||
y4.a;
|
||||
y5.a;
|
||||
y6.a;
|
||||
y7.a;
|
||||
y8.a;
|
||||
y9.a;
|
||||
y0.a;
|
||||
|
||||
// named import
|
||||
import { a as a1 } from "interface";
|
||||
import { a as a2 } from "variable";
|
||||
import { a as a3 } from "interface-variable";
|
||||
import { a as a4 } from "module";
|
||||
import { a as a5 } from "interface-module";
|
||||
import { a as a6 } from "variable-module";
|
||||
import { a as a7 } from "function";
|
||||
import { a as a8 } from "function-module";
|
||||
import { a as a9 } from "class";
|
||||
import { a as a0 } from "class-module";
|
||||
|
||||
a1;
|
||||
a2;
|
||||
a3;
|
||||
a4;
|
||||
a5;
|
||||
a6;
|
||||
a7;
|
||||
a8;
|
||||
a9;
|
||||
a0;
|
||||
|
||||
// named export
|
||||
export { a as a1 } from "interface";
|
||||
export { a as a2 } from "variable";
|
||||
export { a as a3 } from "interface-variable";
|
||||
export { a as a4 } from "module";
|
||||
export { a as a5 } from "interface-module";
|
||||
export { a as a6 } from "variable-module";
|
||||
export { a as a7 } from "function";
|
||||
export { a as a8 } from "function-module";
|
||||
export { a as a9 } from "class";
|
||||
export { a as a0 } from "class-module";
|
||||
|
||||
// export-star
|
||||
export * from "interface";
|
||||
export * from "variable";
|
||||
export * from "interface-variable";
|
||||
export * from "module";
|
||||
export * from "interface-module";
|
||||
export * from "variable-module";
|
||||
export * from "function";
|
||||
export * from "function-module";
|
||||
export * from "class";
|
||||
export * from "class-module";
|
||||
|
||||
|
||||
//// [main.js]
|
||||
@ -274,6 +274,9 @@ function_1.a;
|
||||
function_module_1.a;
|
||||
class_1.a;
|
||||
class_module_1.a;
|
||||
// named export
|
||||
var interface_2 = require("interface");
|
||||
exports.a1 = interface_2.a;
|
||||
var variable_2 = require("variable");
|
||||
exports.a2 = variable_2.a;
|
||||
var interface_variable_2 = require("interface-variable");
|
||||
@ -284,8 +287,12 @@ var interface_module_2 = require("interface-module");
|
||||
exports.a5 = interface_module_2.a;
|
||||
var variable_module_2 = require("variable-module");
|
||||
exports.a6 = variable_module_2.a;
|
||||
var function_2 = require("function");
|
||||
exports.a7 = function_2.a;
|
||||
var function_module_2 = require("function-module");
|
||||
exports.a8 = function_module_2.a;
|
||||
var class_2 = require("class");
|
||||
exports.a9 = class_2.a;
|
||||
var class_module_2 = require("class-module");
|
||||
exports.a0 = class_module_2.a;
|
||||
__export(require("variable"));
|
||||
|
||||
@ -1,48 +1,53 @@
|
||||
//// [moduleElementsInWrongContext.ts]
|
||||
{
|
||||
module M { }
|
||||
export namespace N {
|
||||
export interface I { }
|
||||
}
|
||||
|
||||
namespace Q.K { }
|
||||
|
||||
declare module "ambient" {
|
||||
|
||||
}
|
||||
|
||||
export = M;
|
||||
|
||||
var v;
|
||||
function foo() { }
|
||||
export * from "ambient";
|
||||
export { foo };
|
||||
export { baz as b } from "ambient";
|
||||
export default v;
|
||||
export default class C { }
|
||||
export function bee() { }
|
||||
import I = M;
|
||||
import I2 = require("foo");
|
||||
import * as Foo from "ambient";
|
||||
import bar from "ambient";
|
||||
import { baz } from "ambient";
|
||||
import "ambient";
|
||||
}
|
||||
|
||||
|
||||
//// [moduleElementsInWrongContext.js]
|
||||
{
|
||||
module M { }
|
||||
export namespace N {
|
||||
export interface I { }
|
||||
}
|
||||
|
||||
namespace Q.K { }
|
||||
|
||||
declare module "ambient" {
|
||||
|
||||
}
|
||||
|
||||
export = M;
|
||||
|
||||
var v;
|
||||
function foo() { }
|
||||
export * from "ambient";
|
||||
export { foo };
|
||||
export { baz as b } from "ambient";
|
||||
export default v;
|
||||
export default class C { }
|
||||
export function bee() { }
|
||||
import I = M;
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
return C;
|
||||
}());
|
||||
function bee() { }
|
||||
import I2 = require("foo");
|
||||
import * as Foo from "ambient";
|
||||
import bar from "ambient";
|
||||
import { baz } from "ambient";
|
||||
import "ambient";
|
||||
}
|
||||
|
||||
|
||||
//// [moduleElementsInWrongContext.js]
|
||||
{
|
||||
var v;
|
||||
function foo() { }
|
||||
var ambient_2 = require("ambient");
|
||||
exports.b = ambient_2.baz;
|
||||
exports["default"] = v;
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
return C;
|
||||
}());
|
||||
exports["default"] = C;
|
||||
function bee() { }
|
||||
exports.bee = bee;
|
||||
}
|
||||
|
||||
@ -1,48 +1,53 @@
|
||||
//// [moduleElementsInWrongContext2.ts]
|
||||
function blah () {
|
||||
module M { }
|
||||
export namespace N {
|
||||
export interface I { }
|
||||
}
|
||||
function blah () {
|
||||
module M { }
|
||||
export namespace N {
|
||||
export interface I { }
|
||||
}
|
||||
|
||||
namespace Q.K { }
|
||||
|
||||
declare module "ambient" {
|
||||
|
||||
}
|
||||
|
||||
export = M;
|
||||
|
||||
var v;
|
||||
function foo() { }
|
||||
export * from "ambient";
|
||||
export { foo };
|
||||
export { baz as b } from "ambient";
|
||||
export default v;
|
||||
export default class C { }
|
||||
export function bee() { }
|
||||
import I = M;
|
||||
import I2 = require("foo");
|
||||
import * as Foo from "ambient";
|
||||
import bar from "ambient";
|
||||
import { baz } from "ambient";
|
||||
import "ambient";
|
||||
}
|
||||
|
||||
namespace Q.K { }
|
||||
|
||||
declare module "ambient" {
|
||||
|
||||
}
|
||||
|
||||
//// [moduleElementsInWrongContext2.js]
|
||||
function blah() {
|
||||
export = M;
|
||||
|
||||
var v;
|
||||
function foo() { }
|
||||
export * from "ambient";
|
||||
export { foo };
|
||||
export { baz as b } from "ambient";
|
||||
export default v;
|
||||
export default class C { }
|
||||
export function bee() { }
|
||||
import I = M;
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
return C;
|
||||
}());
|
||||
function bee() { }
|
||||
import I2 = require("foo");
|
||||
import * as Foo from "ambient";
|
||||
import bar from "ambient";
|
||||
import { baz } from "ambient";
|
||||
import "ambient";
|
||||
}
|
||||
|
||||
|
||||
//// [moduleElementsInWrongContext2.js]
|
||||
function blah() {
|
||||
var v;
|
||||
function foo() { }
|
||||
var ambient_2 = require("ambient");
|
||||
exports.b = ambient_2.baz;
|
||||
exports["default"] = v;
|
||||
var C = (function () {
|
||||
function C() {
|
||||
}
|
||||
return C;
|
||||
}());
|
||||
exports["default"] = C;
|
||||
function bee() { }
|
||||
exports.bee = bee;
|
||||
}
|
||||
|
||||
@ -1,34 +1,34 @@
|
||||
//// [moduleElementsInWrongContext3.ts]
|
||||
module P {
|
||||
{
|
||||
module M { }
|
||||
export namespace N {
|
||||
export interface I { }
|
||||
}
|
||||
|
||||
namespace Q.K { }
|
||||
|
||||
declare module "ambient" {
|
||||
|
||||
}
|
||||
|
||||
export = M;
|
||||
|
||||
var v;
|
||||
function foo() { }
|
||||
export * from "ambient";
|
||||
export { foo };
|
||||
export { baz as b } from "ambient";
|
||||
export default v;
|
||||
export default class C { }
|
||||
export function bee() { }
|
||||
import I = M;
|
||||
import I2 = require("foo");
|
||||
import * as Foo from "ambient";
|
||||
import bar from "ambient";
|
||||
import { baz } from "ambient";
|
||||
import "ambient";
|
||||
}
|
||||
module P {
|
||||
{
|
||||
module M { }
|
||||
export namespace N {
|
||||
export interface I { }
|
||||
}
|
||||
|
||||
namespace Q.K { }
|
||||
|
||||
declare module "ambient" {
|
||||
|
||||
}
|
||||
|
||||
export = M;
|
||||
|
||||
var v;
|
||||
function foo() { }
|
||||
export * from "ambient";
|
||||
export { foo };
|
||||
export { baz as b } from "ambient";
|
||||
export default v;
|
||||
export default class C { }
|
||||
export function bee() { }
|
||||
import I = M;
|
||||
import I2 = require("foo");
|
||||
import * as Foo from "ambient";
|
||||
import bar from "ambient";
|
||||
import { baz } from "ambient";
|
||||
import "ambient";
|
||||
}
|
||||
}
|
||||
|
||||
//// [moduleElementsInWrongContext3.js]
|
||||
|
||||
@ -1,7 +1,8 @@
|
||||
error TS6082: Only 'amd' and 'system' modules are supported alongside --out.
|
||||
tests/cases/compiler/optionsOutAndNoModuleGen.ts(2,1): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'.
|
||||
|
||||
|
||||
!!! error TS6082: Only 'amd' and 'system' modules are supported alongside --out.
|
||||
==== tests/cases/compiler/optionsOutAndNoModuleGen.ts (0 errors) ====
|
||||
==== tests/cases/compiler/optionsOutAndNoModuleGen.ts (1 errors) ====
|
||||
|
||||
export var x = 10;
|
||||
export var x = 10;
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
!!! error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'.
|
||||
@ -18,7 +18,7 @@ function fn(y, set) {
|
||||
}
|
||||
var C = (function () {
|
||||
function C(y, x // expected to work, but actually doesn't
|
||||
) {
|
||||
) {
|
||||
if (x === void 0) { x = fn(y, function (y, x) { return y.x = x; }); }
|
||||
this.x = x;
|
||||
}
|
||||
|
||||
@ -31,7 +31,7 @@ var __extends = (this && this.__extends) || function (d, b) {
|
||||
function __() { this.constructor = d; }
|
||||
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
||||
};
|
||||
var React = require('react');
|
||||
var React = require("react");
|
||||
var MyComponent = (function (_super) {
|
||||
__extends(MyComponent, _super);
|
||||
function MyComponent() {
|
||||
@ -44,7 +44,7 @@ var MyComponent = (function (_super) {
|
||||
return MyComponent;
|
||||
}(React.Component));
|
||||
// Stateless Component As Props
|
||||
React.createElement(MyComponent, {AnyComponent: function () { return React.createElement("button", null, "test"); }});
|
||||
React.createElement(MyComponent, { AnyComponent: function () { return React.createElement("button", null, "test"); } });
|
||||
// Component Class as Props
|
||||
var MyButtonComponent = (function (_super) {
|
||||
__extends(MyButtonComponent, _super);
|
||||
@ -53,4 +53,4 @@ var MyButtonComponent = (function (_super) {
|
||||
}
|
||||
return MyButtonComponent;
|
||||
}(React.Component));
|
||||
React.createElement(MyComponent, {AnyComponent: MyButtonComponent});
|
||||
React.createElement(MyComponent, { AnyComponent: MyButtonComponent });
|
||||
|
||||
@ -13,6 +13,6 @@ const X: Invalid1 = "Should fail to construct";
|
||||
|
||||
//// [file.js]
|
||||
"use strict";
|
||||
var React = require('react');
|
||||
var React = require("react");
|
||||
var X = "Should fail to construct";
|
||||
React.createElement(X, null);
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
/mod1.ts(2,17): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'.
|
||||
|
||||
|
||||
==== /mod2.ts (0 errors) ====
|
||||
|
||||
import {foo} from "./mod1";
|
||||
export const bar = foo();
|
||||
==== /types/lib/index.d.ts (0 errors) ====
|
||||
|
||||
|
||||
interface Lib { x }
|
||||
|
||||
==== /mod1.ts (1 errors) ====
|
||||
|
||||
export function foo(): Lib { return {x: 1} }
|
||||
~~~
|
||||
!!! error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'.
|
||||
|
||||
23
tests/baselines/reference/typeReferenceDirectives11.symbols
Normal file
23
tests/baselines/reference/typeReferenceDirectives11.symbols
Normal file
@ -0,0 +1,23 @@
|
||||
=== /mod2.ts ===
|
||||
|
||||
import {foo} from "./mod1";
|
||||
>foo : Symbol(foo, Decl(mod2.ts, 1, 8))
|
||||
|
||||
export const bar = foo();
|
||||
>bar : Symbol(bar, Decl(mod2.ts, 2, 12))
|
||||
>foo : Symbol(foo, Decl(mod2.ts, 1, 8))
|
||||
|
||||
=== /types/lib/index.d.ts ===
|
||||
|
||||
|
||||
interface Lib { x }
|
||||
>Lib : Symbol(Lib, Decl(index.d.ts, 0, 0))
|
||||
>x : Symbol(Lib.x, Decl(index.d.ts, 2, 15))
|
||||
|
||||
=== /mod1.ts ===
|
||||
|
||||
export function foo(): Lib { return {x: 1} }
|
||||
>foo : Symbol(foo, Decl(mod1.ts, 0, 0))
|
||||
>Lib : Symbol(Lib, Decl(index.d.ts, 0, 0))
|
||||
>x : Symbol(x, Decl(mod1.ts, 1, 37))
|
||||
|
||||
26
tests/baselines/reference/typeReferenceDirectives11.types
Normal file
26
tests/baselines/reference/typeReferenceDirectives11.types
Normal file
@ -0,0 +1,26 @@
|
||||
=== /mod2.ts ===
|
||||
|
||||
import {foo} from "./mod1";
|
||||
>foo : () => Lib
|
||||
|
||||
export const bar = foo();
|
||||
>bar : Lib
|
||||
>foo() : Lib
|
||||
>foo : () => Lib
|
||||
|
||||
=== /types/lib/index.d.ts ===
|
||||
|
||||
|
||||
interface Lib { x }
|
||||
>Lib : Lib
|
||||
>x : any
|
||||
|
||||
=== /mod1.ts ===
|
||||
|
||||
export function foo(): Lib { return {x: 1} }
|
||||
>foo : () => Lib
|
||||
>Lib : Lib
|
||||
>{x: 1} : { x: number; }
|
||||
>x : number
|
||||
>1 : number
|
||||
|
||||
@ -1,37 +0,0 @@
|
||||
/main.ts(1,14): error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'.
|
||||
|
||||
|
||||
==== /mod2.ts (0 errors) ====
|
||||
import { Cls } from "./main";
|
||||
import "./mod1";
|
||||
|
||||
export const cls = Cls;
|
||||
export const foo = new Cls().foo();
|
||||
export const bar = Cls.bar();
|
||||
==== /types/lib/index.d.ts (0 errors) ====
|
||||
|
||||
|
||||
interface Lib { x }
|
||||
|
||||
==== /main.ts (1 errors) ====
|
||||
export class Cls {
|
||||
~~~
|
||||
!!! error TS6131: Cannot compile modules using option 'out' unless the '--module' flag is 'amd' or 'system'.
|
||||
x
|
||||
}
|
||||
|
||||
==== /mod1.ts (0 errors) ====
|
||||
/// <reference types="lib" />
|
||||
|
||||
import {Cls} from "./main";
|
||||
Cls.prototype.foo = function() { return undefined; }
|
||||
|
||||
declare module "./main" {
|
||||
interface Cls {
|
||||
foo(): Lib;
|
||||
}
|
||||
namespace Cls {
|
||||
function bar(): Lib;
|
||||
}
|
||||
}
|
||||
|
||||
68
tests/baselines/reference/typeReferenceDirectives12.symbols
Normal file
68
tests/baselines/reference/typeReferenceDirectives12.symbols
Normal file
@ -0,0 +1,68 @@
|
||||
=== /mod2.ts ===
|
||||
import { Cls } from "./main";
|
||||
>Cls : Symbol(Cls, Decl(mod2.ts, 0, 8))
|
||||
|
||||
import "./mod1";
|
||||
|
||||
export const cls = Cls;
|
||||
>cls : Symbol(cls, Decl(mod2.ts, 3, 12))
|
||||
>Cls : Symbol(Cls, Decl(mod2.ts, 0, 8))
|
||||
|
||||
export const foo = new Cls().foo();
|
||||
>foo : Symbol(foo, Decl(mod2.ts, 4, 12))
|
||||
>new Cls().foo : Symbol(Cls.foo, Decl(mod1.ts, 6, 19))
|
||||
>Cls : Symbol(Cls, Decl(mod2.ts, 0, 8))
|
||||
>foo : Symbol(Cls.foo, Decl(mod1.ts, 6, 19))
|
||||
|
||||
export const bar = Cls.bar();
|
||||
>bar : Symbol(bar, Decl(mod2.ts, 5, 12))
|
||||
>Cls.bar : Symbol(Cls.bar, Decl(mod1.ts, 9, 19))
|
||||
>Cls : Symbol(Cls, Decl(mod2.ts, 0, 8))
|
||||
>bar : Symbol(Cls.bar, Decl(mod1.ts, 9, 19))
|
||||
|
||||
=== /types/lib/index.d.ts ===
|
||||
|
||||
|
||||
interface Lib { x }
|
||||
>Lib : Symbol(Lib, Decl(index.d.ts, 0, 0))
|
||||
>x : Symbol(Lib.x, Decl(index.d.ts, 2, 15))
|
||||
|
||||
=== /main.ts ===
|
||||
export class Cls {
|
||||
>Cls : Symbol(Cls, Decl(main.ts, 0, 0), Decl(mod1.ts, 5, 25), Decl(mod1.ts, 8, 5))
|
||||
|
||||
x
|
||||
>x : Symbol(Cls.x, Decl(main.ts, 0, 18))
|
||||
}
|
||||
|
||||
=== /mod1.ts ===
|
||||
/// <reference types="lib" />
|
||||
|
||||
import {Cls} from "./main";
|
||||
>Cls : Symbol(Cls, Decl(mod1.ts, 2, 8))
|
||||
|
||||
Cls.prototype.foo = function() { return undefined; }
|
||||
>Cls.prototype.foo : Symbol(Cls.foo, Decl(mod1.ts, 6, 19))
|
||||
>Cls.prototype : Symbol(Cls.prototype)
|
||||
>Cls : Symbol(Cls, Decl(mod1.ts, 2, 8))
|
||||
>prototype : Symbol(Cls.prototype)
|
||||
>foo : Symbol(Cls.foo, Decl(mod1.ts, 6, 19))
|
||||
>undefined : Symbol(undefined)
|
||||
|
||||
declare module "./main" {
|
||||
interface Cls {
|
||||
>Cls : Symbol(Cls, Decl(main.ts, 0, 0), Decl(mod1.ts, 5, 25), Decl(mod1.ts, 8, 5))
|
||||
|
||||
foo(): Lib;
|
||||
>foo : Symbol(Cls.foo, Decl(mod1.ts, 6, 19))
|
||||
>Lib : Symbol(Lib, Decl(index.d.ts, 0, 0))
|
||||
}
|
||||
namespace Cls {
|
||||
>Cls : Symbol(Cls, Decl(main.ts, 0, 0), Decl(mod1.ts, 5, 25), Decl(mod1.ts, 8, 5))
|
||||
|
||||
function bar(): Lib;
|
||||
>bar : Symbol(bar, Decl(mod1.ts, 9, 19))
|
||||
>Lib : Symbol(Lib, Decl(index.d.ts, 0, 0))
|
||||
}
|
||||
}
|
||||
|
||||
73
tests/baselines/reference/typeReferenceDirectives12.types
Normal file
73
tests/baselines/reference/typeReferenceDirectives12.types
Normal file
@ -0,0 +1,73 @@
|
||||
=== /mod2.ts ===
|
||||
import { Cls } from "./main";
|
||||
>Cls : typeof Cls
|
||||
|
||||
import "./mod1";
|
||||
|
||||
export const cls = Cls;
|
||||
>cls : typeof Cls
|
||||
>Cls : typeof Cls
|
||||
|
||||
export const foo = new Cls().foo();
|
||||
>foo : Lib
|
||||
>new Cls().foo() : Lib
|
||||
>new Cls().foo : () => Lib
|
||||
>new Cls() : Cls
|
||||
>Cls : typeof Cls
|
||||
>foo : () => Lib
|
||||
|
||||
export const bar = Cls.bar();
|
||||
>bar : Lib
|
||||
>Cls.bar() : Lib
|
||||
>Cls.bar : () => Lib
|
||||
>Cls : typeof Cls
|
||||
>bar : () => Lib
|
||||
|
||||
=== /types/lib/index.d.ts ===
|
||||
|
||||
|
||||
interface Lib { x }
|
||||
>Lib : Lib
|
||||
>x : any
|
||||
|
||||
=== /main.ts ===
|
||||
export class Cls {
|
||||
>Cls : Cls
|
||||
|
||||
x
|
||||
>x : any
|
||||
}
|
||||
|
||||
=== /mod1.ts ===
|
||||
/// <reference types="lib" />
|
||||
|
||||
import {Cls} from "./main";
|
||||
>Cls : typeof Cls
|
||||
|
||||
Cls.prototype.foo = function() { return undefined; }
|
||||
>Cls.prototype.foo = function() { return undefined; } : () => any
|
||||
>Cls.prototype.foo : () => Lib
|
||||
>Cls.prototype : Cls
|
||||
>Cls : typeof Cls
|
||||
>prototype : Cls
|
||||
>foo : () => Lib
|
||||
>function() { return undefined; } : () => any
|
||||
>undefined : undefined
|
||||
|
||||
declare module "./main" {
|
||||
interface Cls {
|
||||
>Cls : Cls
|
||||
|
||||
foo(): Lib;
|
||||
>foo : () => Lib
|
||||
>Lib : Lib
|
||||
}
|
||||
namespace Cls {
|
||||
>Cls : typeof Cls
|
||||
|
||||
function bar(): Lib;
|
||||
>bar : () => Lib
|
||||
>Lib : Lib
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user