mirror of
https://github.com/microsoft/TypeScript.git
synced 2025-11-18 17:21:48 +00:00
Accepted baselines.
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
tests/cases/conformance/es6/modules/m2.ts(5,8): error TS2304: Cannot find name 'Entity'.
|
||||
tests/cases/conformance/es6/modules/m2.ts(6,8): error TS2503: Cannot find namespace 'Entity'.
|
||||
tests/cases/conformance/es6/modules/m2.ts(8,8): error TS2339: Property 'x' does not exist on type '() => number'.
|
||||
tests/cases/conformance/es6/modules/m2.ts(9,8): error TS2339: Property 'y' does not exist on type '() => number'.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/modules/m1.ts (0 errors) ====
|
||||
|
||||
export default function Decl() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
export interface Decl {
|
||||
p1: number;
|
||||
p2: number;
|
||||
}
|
||||
|
||||
export namespace Decl {
|
||||
export var x = 10;
|
||||
export var y = 20;
|
||||
|
||||
interface I {
|
||||
}
|
||||
}
|
||||
|
||||
==== tests/cases/conformance/es6/modules/m2.ts (4 errors) ====
|
||||
import Entity from "m1"
|
||||
|
||||
Entity();
|
||||
|
||||
var x: Entity;
|
||||
~~~~~~
|
||||
!!! error TS2304: Cannot find name 'Entity'.
|
||||
var y: Entity.I;
|
||||
~~~~~~
|
||||
!!! error TS2503: Cannot find namespace 'Entity'.
|
||||
|
||||
Entity.x;
|
||||
~
|
||||
!!! error TS2339: Property 'x' does not exist on type '() => number'.
|
||||
Entity.y;
|
||||
~
|
||||
!!! error TS2339: Property 'y' does not exist on type '() => number'.
|
||||
@@ -0,0 +1,49 @@
|
||||
//// [tests/cases/conformance/es6/modules/defaultExportsCannotMerge01.ts] ////
|
||||
|
||||
//// [m1.ts]
|
||||
|
||||
export default function Decl() {
|
||||
return 0;
|
||||
}
|
||||
|
||||
export interface Decl {
|
||||
p1: number;
|
||||
p2: number;
|
||||
}
|
||||
|
||||
export namespace Decl {
|
||||
export var x = 10;
|
||||
export var y = 20;
|
||||
|
||||
interface I {
|
||||
}
|
||||
}
|
||||
|
||||
//// [m2.ts]
|
||||
import Entity from "m1"
|
||||
|
||||
Entity();
|
||||
|
||||
var x: Entity;
|
||||
var y: Entity.I;
|
||||
|
||||
Entity.x;
|
||||
Entity.y;
|
||||
|
||||
//// [m1.js]
|
||||
function Decl() {
|
||||
return 0;
|
||||
}
|
||||
exports.default = Decl;
|
||||
var Decl;
|
||||
(function (Decl) {
|
||||
Decl.x = 10;
|
||||
Decl.y = 20;
|
||||
})(Decl = exports.Decl || (exports.Decl = {}));
|
||||
//// [m2.js]
|
||||
var m1_1 = require("m1");
|
||||
m1_1.default();
|
||||
var x;
|
||||
var y;
|
||||
m1_1.default.x;
|
||||
m1_1.default.y;
|
||||
@@ -0,0 +1,31 @@
|
||||
tests/cases/conformance/es6/modules/m1.ts(2,22): error TS2300: Duplicate identifier 'foo'.
|
||||
tests/cases/conformance/es6/modules/m1.ts(6,25): error TS2300: Duplicate identifier 'bar'.
|
||||
tests/cases/conformance/es6/modules/m1.ts(11,1): error TS2300: Duplicate identifier 'default'.
|
||||
tests/cases/conformance/es6/modules/m2.ts(3,1): error TS2348: Value of type 'typeof foo' is not callable. Did you mean to include 'new'?
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/modules/m1.ts (3 errors) ====
|
||||
|
||||
export default class foo {
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'foo'.
|
||||
|
||||
}
|
||||
|
||||
export default function bar() {
|
||||
~~~
|
||||
!!! error TS2300: Duplicate identifier 'bar'.
|
||||
|
||||
}
|
||||
|
||||
var x = 10;
|
||||
export default x;
|
||||
~~~~~~~~~~~~~~~~~
|
||||
!!! error TS2300: Duplicate identifier 'default'.
|
||||
|
||||
==== tests/cases/conformance/es6/modules/m2.ts (1 errors) ====
|
||||
import Entity from "m1"
|
||||
|
||||
Entity();
|
||||
~~~~~~~~
|
||||
!!! error TS2348: Value of type 'typeof foo' is not callable. Did you mean to include 'new'?
|
||||
@@ -0,0 +1,35 @@
|
||||
//// [tests/cases/conformance/es6/modules/defaultExportsCannotMerge02.ts] ////
|
||||
|
||||
//// [m1.ts]
|
||||
|
||||
export default class foo {
|
||||
|
||||
}
|
||||
|
||||
export default function bar() {
|
||||
|
||||
}
|
||||
|
||||
var x = 10;
|
||||
export default x;
|
||||
|
||||
//// [m2.ts]
|
||||
import Entity from "m1"
|
||||
|
||||
Entity();
|
||||
|
||||
//// [m1.js]
|
||||
var foo = (function () {
|
||||
function foo() {
|
||||
}
|
||||
return foo;
|
||||
})();
|
||||
exports.default = foo;
|
||||
function bar() {
|
||||
}
|
||||
exports.default = bar;
|
||||
var x = 10;
|
||||
exports.default = x;
|
||||
//// [m2.js]
|
||||
var m1_1 = require("m1");
|
||||
m1_1.default();
|
||||
@@ -0,0 +1,22 @@
|
||||
tests/cases/conformance/es6/modules/m1.ts(2,25): error TS2393: Duplicate function implementation.
|
||||
tests/cases/conformance/es6/modules/m1.ts(6,25): error TS2393: Duplicate function implementation.
|
||||
|
||||
|
||||
==== tests/cases/conformance/es6/modules/m1.ts (2 errors) ====
|
||||
|
||||
export default function foo() {
|
||||
~~~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
|
||||
}
|
||||
|
||||
export default function bar() {
|
||||
~~~
|
||||
!!! error TS2393: Duplicate function implementation.
|
||||
|
||||
}
|
||||
|
||||
==== tests/cases/conformance/es6/modules/m2.ts (0 errors) ====
|
||||
import Entity from "m1"
|
||||
|
||||
Entity();
|
||||
@@ -0,0 +1,27 @@
|
||||
//// [tests/cases/conformance/es6/modules/defaultExportsCannotMerge03.ts] ////
|
||||
|
||||
//// [m1.ts]
|
||||
|
||||
export default function foo() {
|
||||
|
||||
}
|
||||
|
||||
export default function bar() {
|
||||
|
||||
}
|
||||
|
||||
//// [m2.ts]
|
||||
import Entity from "m1"
|
||||
|
||||
Entity();
|
||||
|
||||
//// [m1.js]
|
||||
function foo() {
|
||||
}
|
||||
exports.default = foo;
|
||||
function bar() {
|
||||
}
|
||||
exports.default = bar;
|
||||
//// [m2.js]
|
||||
var m1_1 = require("m1");
|
||||
m1_1.default();
|
||||
Reference in New Issue
Block a user