Merge branch 'master' into forwardRefsInEnumInitializers

This commit is contained in:
Vladimir Matveev committed 2015-07-27 17:51:20 -07:00
commit e1708e7e2f
40 files changed
+1223 -185

No files matched your search

@@ -0,0 +1,22 @@
tests/cases/compiler/aliasesInSystemModule1.ts(2,24): error TS2307: Cannot find module 'foo'.
==== tests/cases/compiler/aliasesInSystemModule1.ts (1 errors) ====
import alias = require('foo');
~~~~~
!!! error TS2307: Cannot find module 'foo'.
import cls = alias.Class;
export import cls2 = alias.Class;
let x = new alias.Class();
let y = new cls();
let z = new cls2();
module M {
export import cls = alias.Class;
let x = new alias.Class();
let y = new cls();
let z = new cls2();
}
@@ -0,0 +1,42 @@
//// [aliasesInSystemModule1.ts]
import alias = require('foo');
import cls = alias.Class;
export import cls2 = alias.Class;
let x = new alias.Class();
let y = new cls();
let z = new cls2();
module M {
export import cls = alias.Class;
let x = new alias.Class();
let y = new cls();
let z = new cls2();
}
//// [aliasesInSystemModule1.js]
System.register(['foo'], function(exports_1) {
var alias;
var cls, cls2, x, y, z, M;
return {
setters:[
function (_alias) {
alias = _alias;
}],
execute: function() {
cls = alias.Class;
exports_1("cls2", cls2 = alias.Class);
x = new alias.Class();
y = new cls();
z = new cls2();
(function (M) {
M.cls = alias.Class;
var x = new alias.Class();
var y = new M.cls();
var z = new cls2();
})(M || (M = {}));
}
}
});
@@ -0,0 +1,21 @@
tests/cases/compiler/aliasesInSystemModule2.ts(2,21): error TS2307: Cannot find module 'foo'.
==== tests/cases/compiler/aliasesInSystemModule2.ts (1 errors) ====
import {alias} from "foo";
~~~~~
!!! error TS2307: Cannot find module 'foo'.
import cls = alias.Class;
export import cls2 = alias.Class;
let x = new alias.Class();
let y = new cls();
let z = new cls2();
module M {
export import cls = alias.Class;
let x = new alias.Class();
let y = new cls();
let z = new cls2();
}
@@ -0,0 +1,41 @@
//// [aliasesInSystemModule2.ts]
import {alias} from "foo";
import cls = alias.Class;
export import cls2 = alias.Class;
let x = new alias.Class();
let y = new cls();
let z = new cls2();
module M {
export import cls = alias.Class;
let x = new alias.Class();
let y = new cls();
let z = new cls2();
}
//// [aliasesInSystemModule2.js]
System.register(["foo"], function(exports_1) {
var foo_1;
var cls, cls2, x, y, z, M;
return {
setters:[
function (_foo_1) {
foo_1 = _foo_1;
}],
execute: function() {
cls = foo_1.alias.Class;
exports_1("cls2", cls2 = foo_1.alias.Class);
x = new foo_1.alias.Class();
y = new cls();
z = new cls2();
(function (M) {
M.cls = foo_1.alias.Class;
var x = new foo_1.alias.Class();
var y = new M.cls();
var z = new cls2();
})(M || (M = {}));
}
}
});
@@ -1,7 +0,0 @@
error TS5043: Option 'sourceMap' cannot be specified with option 'isolatedModules'.
!!! error TS5043: Option 'sourceMap' cannot be specified with option 'isolatedModules'.
==== tests/cases/compiler/isolatedModulesSourceMap.ts (0 errors) ====
export var x;
@@ -1,7 +1,7 @@
//// [isolatedModulesSourceMap.ts]
export var x;
export var x = 1;
//// [isolatedModulesSourceMap.js]
export var x;
export var x = 1;
//# sourceMappingURL=isolatedModulesSourceMap.js.map
@@ -1,2 +1,2 @@
//// [isolatedModulesSourceMap.js.map]
{"version":3,"file":"isolatedModulesSourceMap.js","sourceRoot":"","sources":["isolatedModulesSourceMap.ts"],"names":[],"mappings":"AACA,WAAW,CAAC,CAAC"}
{"version":3,"file":"isolatedModulesSourceMap.js","sourceRoot":"","sources":["isolatedModulesSourceMap.ts"],"names":[],"mappings":"AACA,WAAW,CAAC,GAAG,CAAC,CAAC"}
@@ -8,20 +8,26 @@ sources: isolatedModulesSourceMap.ts
emittedFile:tests/cases/compiler/isolatedModulesSourceMap.js
sourceFile:isolatedModulesSourceMap.ts
-------------------------------------------------------------------
>>>export var x;
>>>export var x = 1;
1 >
2 >^^^^^^^^^^^
3 > ^
4 > ^
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
4 > ^^^
5 > ^
6 > ^
7 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>
2 >export var
3 > x
4 > ;
4 > =
5 > 1
6 > ;
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0)
2 >Emitted(1, 12) Source(2, 12) + SourceIndex(0)
3 >Emitted(1, 13) Source(2, 13) + SourceIndex(0)
4 >Emitted(1, 14) Source(2, 14) + SourceIndex(0)
4 >Emitted(1, 16) Source(2, 16) + SourceIndex(0)
5 >Emitted(1, 17) Source(2, 17) + SourceIndex(0)
6 >Emitted(1, 18) Source(2, 18) + SourceIndex(0)
---
>>>//# sourceMappingURL=isolatedModulesSourceMap.js.map
@@ -0,0 +1,5 @@
=== tests/cases/compiler/isolatedModulesSourceMap.ts ===
export var x = 1;
>x : Symbol(x, Decl(isolatedModulesSourceMap.ts, 1, 10))
@@ -0,0 +1,6 @@
=== tests/cases/compiler/isolatedModulesSourceMap.ts ===
export var x = 1;
>x : number
>1 : number
@@ -0,0 +1,21 @@
//// [tests/cases/compiler/jsxImportInAttribute.tsx] ////
//// [component.d.ts]
declare module "Test" {
export default class Text { }
}
//// [consumer.tsx]
/// <reference path="component.d.ts" />
import Test from 'Test';
let x = Test; // emit test_1.default
<anything attr={Test} />; // ?
//// [consumer.jsx]
/// <reference path="component.d.ts" />
var Test_1 = require('Test');
var x = Test_1["default"]; // emit test_1.default
<anything attr={Test_1["default"]}/>; // ?
@@ -0,0 +1,19 @@
=== tests/cases/compiler/consumer.tsx ===
/// <reference path="component.d.ts" />
import Test from 'Test';
>Test : Symbol(Test, Decl(consumer.tsx, 1, 6))
let x = Test; // emit test_1.default
>x : Symbol(x, Decl(consumer.tsx, 3, 3))
>Test : Symbol(Test, Decl(consumer.tsx, 1, 6))
<anything attr={Test} />; // ?
>attr : Symbol(unknown)
=== tests/cases/compiler/component.d.ts ===
declare module "Test" {
export default class Text { }
>Text : Symbol(Text, Decl(component.d.ts, 1, 23))
}
@@ -0,0 +1,22 @@
=== tests/cases/compiler/consumer.tsx ===
/// <reference path="component.d.ts" />
import Test from 'Test';
>Test : typeof Test
let x = Test; // emit test_1.default
>x : typeof Test
>Test : typeof Test
<anything attr={Test} />; // ?
><anything attr={Test} /> : any
>anything : any
>attr : any
>Test : any
=== tests/cases/compiler/component.d.ts ===
declare module "Test" {
export default class Text { }
>Text : Text
}
@@ -1,8 +1,7 @@
tests/cases/compiler/strictModeInConstructor.ts(9,5): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
tests/cases/compiler/strictModeInConstructor.ts(27,5): error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
==== tests/cases/compiler/strictModeInConstructor.ts (2 errors) ====
==== tests/cases/compiler/strictModeInConstructor.ts (1 errors) ====
class A {
}
@@ -12,14 +11,9 @@ tests/cases/compiler/strictModeInConstructor.ts(27,5): error TS2376: A 'super' c
public s: number = 9;
constructor () {
~~~~~~~~~~~~~~~~
"use strict"; // No error
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
super();
~~~~~~~~~~~~~~~~
}
~~~~~
!!! error TS2376: A 'super' call must be the first statement in the constructor when a class contains initialized properties or has parameter properties.
}
class C extends A {