Code review comments

This commit is contained in:
Mohamed Hegazy 2016-06-09 15:52:17 -07:00
parent 3492542ebb
commit f0a430aef8
11 changed files with 146 additions and 13 deletions

View File

@ -5,6 +5,7 @@ export class C {
p = 1;
method() { }
}
export { C as C2 };
declare function foo(...args: any[]): any;
@foo
@ -13,9 +14,11 @@ export class D {
p = 1;
method() { }
}
export { D as D2 };
class E { }
export {E};
export {E};
//// [es6modulekindWithES5Target.js]
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
@ -32,6 +35,7 @@ export var C = (function () {
C.s = 0;
return C;
}());
export { C as C2 };
export var D = (function () {
function D() {
this.p = 1;
@ -43,6 +47,7 @@ export var D = (function () {
], D);
return D;
}());
export { D as D2 };
var E = (function () {
function E() {
}

View File

@ -12,30 +12,36 @@ export class C {
method() { }
>method : Symbol(C.method, Decl(es6modulekindWithES5Target.ts, 3, 10))
}
export { C as C2 };
>C : Symbol(C2, Decl(es6modulekindWithES5Target.ts, 6, 8))
>C2 : Symbol(C2, Decl(es6modulekindWithES5Target.ts, 6, 8))
declare function foo(...args: any[]): any;
>foo : Symbol(foo, Decl(es6modulekindWithES5Target.ts, 5, 1))
>args : Symbol(args, Decl(es6modulekindWithES5Target.ts, 7, 21))
>foo : Symbol(foo, Decl(es6modulekindWithES5Target.ts, 6, 19))
>args : Symbol(args, Decl(es6modulekindWithES5Target.ts, 8, 21))
@foo
>foo : Symbol(foo, Decl(es6modulekindWithES5Target.ts, 5, 1))
>foo : Symbol(foo, Decl(es6modulekindWithES5Target.ts, 6, 19))
export class D {
>D : Symbol(D, Decl(es6modulekindWithES5Target.ts, 7, 42))
>D : Symbol(D, Decl(es6modulekindWithES5Target.ts, 8, 42))
static s = 0;
>s : Symbol(D.s, Decl(es6modulekindWithES5Target.ts, 9, 16))
>s : Symbol(D.s, Decl(es6modulekindWithES5Target.ts, 10, 16))
p = 1;
>p : Symbol(D.p, Decl(es6modulekindWithES5Target.ts, 10, 17))
>p : Symbol(D.p, Decl(es6modulekindWithES5Target.ts, 11, 17))
method() { }
>method : Symbol(D.method, Decl(es6modulekindWithES5Target.ts, 11, 10))
>method : Symbol(D.method, Decl(es6modulekindWithES5Target.ts, 12, 10))
}
export { D as D2 };
>D : Symbol(D2, Decl(es6modulekindWithES5Target.ts, 15, 8))
>D2 : Symbol(D2, Decl(es6modulekindWithES5Target.ts, 15, 8))
class E { }
>E : Symbol(E, Decl(es6modulekindWithES5Target.ts, 13, 1))
>E : Symbol(E, Decl(es6modulekindWithES5Target.ts, 15, 19))
export {E};
>E : Symbol(E, Decl(es6modulekindWithES5Target.ts, 16, 8))
>E : Symbol(E, Decl(es6modulekindWithES5Target.ts, 18, 8))

View File

@ -14,6 +14,9 @@ export class C {
method() { }
>method : () => void
}
export { C as C2 };
>C : typeof C
>C2 : typeof C
declare function foo(...args: any[]): any;
>foo : (...args: any[]) => any
@ -36,6 +39,9 @@ export class D {
method() { }
>method : () => void
}
export { D as D2 };
>D : typeof D
>D2 : typeof D
class E { }
>E : E

View File

@ -0,0 +1,31 @@
//// [es6modulekindWithES5Target11.ts]
declare function foo(...args: any[]): any;
@foo
export default class C {
static x() { return C.y; }
static y = 1
p = 1;
method() { }
}
//// [es6modulekindWithES5Target11.js]
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
return c > 3 && r && Object.defineProperty(target, key, r), r;
};
var C = (function () {
function C() {
this.p = 1;
}
C.x = function () { return C.y; };
C.prototype.method = function () { };
C.y = 1;
C = __decorate([
foo
], C);
return C;
}());
export default C;

View File

@ -0,0 +1,27 @@
=== tests/cases/compiler/es6modulekindWithES5Target11.ts ===
declare function foo(...args: any[]): any;
>foo : Symbol(foo, Decl(es6modulekindWithES5Target11.ts, 0, 0))
>args : Symbol(args, Decl(es6modulekindWithES5Target11.ts, 1, 21))
@foo
>foo : Symbol(foo, Decl(es6modulekindWithES5Target11.ts, 0, 0))
export default class C {
>C : Symbol(C, Decl(es6modulekindWithES5Target11.ts, 1, 42))
static x() { return C.y; }
>x : Symbol(C.x, Decl(es6modulekindWithES5Target11.ts, 3, 24))
>C.y : Symbol(C.y, Decl(es6modulekindWithES5Target11.ts, 4, 30))
>C : Symbol(C, Decl(es6modulekindWithES5Target11.ts, 1, 42))
>y : Symbol(C.y, Decl(es6modulekindWithES5Target11.ts, 4, 30))
static y = 1
>y : Symbol(C.y, Decl(es6modulekindWithES5Target11.ts, 4, 30))
p = 1;
>p : Symbol(C.p, Decl(es6modulekindWithES5Target11.ts, 5, 16))
method() { }
>method : Symbol(C.method, Decl(es6modulekindWithES5Target11.ts, 6, 10))
}

View File

@ -0,0 +1,29 @@
=== tests/cases/compiler/es6modulekindWithES5Target11.ts ===
declare function foo(...args: any[]): any;
>foo : (...args: any[]) => any
>args : any[]
@foo
>foo : (...args: any[]) => any
export default class C {
>C : C
static x() { return C.y; }
>x : () => number
>C.y : number
>C : typeof C
>y : number
static y = 1
>y : number
>1 : number
p = 1;
>p : number
>1 : number
method() { }
>method : () => void
}

View File

@ -1,8 +1,8 @@
tests/cases/compiler/es6modulekindWithES5Target9.ts(2,15): error TS2307: Cannot find module 'mod'.
tests/cases/compiler/es6modulekindWithES5Target9.ts(4,17): error TS2307: Cannot find module 'mod'.
tests/cases/compiler/es6modulekindWithES5Target9.ts(6,20): error TS2307: Cannot find module 'mod'.
tests/cases/compiler/es6modulekindWithES5Target9.ts(10,15): error TS2307: Cannot find module 'mod'.
tests/cases/compiler/es6modulekindWithES5Target9.ts(12,17): error TS2307: Cannot find module 'mod'.
tests/cases/compiler/es6modulekindWithES5Target9.ts(14,15): error TS2307: Cannot find module 'mod'.
tests/cases/compiler/es6modulekindWithES5Target9.ts(16,17): error TS2307: Cannot find module 'mod'.
==== tests/cases/compiler/es6modulekindWithES5Target9.ts (5 errors) ====
@ -21,6 +21,10 @@ tests/cases/compiler/es6modulekindWithES5Target9.ts(12,17): error TS2307: Cannot
export {a};
export {M};
export {d};
export * from "mod";
~~~~~
!!! error TS2307: Cannot find module 'mod'.

View File

@ -8,6 +8,10 @@ import * as M from "mod";
export {a};
export {M};
export {d};
export * from "mod";
export {b} from "mod"
@ -18,7 +22,10 @@ export default d;
//// [es6modulekindWithES5Target9.js]
import d from "mod";
import { a } from "mod";
import * as M from "mod";
export { a };
export { M };
export { d };
export * from "mod";
export { b } from "mod";
export default d;

View File

@ -7,6 +7,7 @@ export class C {
p = 1;
method() { }
}
export { C as C2 };
declare function foo(...args: any[]): any;
@foo
@ -15,6 +16,7 @@ export class D {
p = 1;
method() { }
}
export { D as D2 };
class E { }
export {E};
export {E};

View File

@ -0,0 +1,12 @@
// @target: es5
// @module: es2015
// @experimentalDecorators: true
declare function foo(...args: any[]): any;
@foo
export default class C {
static x() { return C.y; }
static y = 1
p = 1;
method() { }
}

View File

@ -9,6 +9,10 @@ import * as M from "mod";
export {a};
export {M};
export {d};
export * from "mod";
export {b} from "mod"