PR comment, sourcemap test

This commit is contained in:
Ron Buckton 2015-03-18 11:17:26 -07:00
parent ff356cef4c
commit 9761f4b783
6 changed files with 1201 additions and 1 deletions

View File

@ -363,7 +363,7 @@ module ts {
// Specific context the parser was in when this node was created. Normally undefined.
// Only set when the parser was in some interesting context (like async/yield).
parserContextFlags?: ParserContextFlags;
decorators?: NodeArray<Decorator>; // Array of decorators
decorators?: NodeArray<Decorator>; // Array of decorators (in document order)
modifiers?: ModifiersArray; // Array of modifiers
id?: number; // Unique id (used to look up NodeLinks)
parent?: Node; // Parent node (initialized by binding)

View File

@ -0,0 +1,107 @@
//// [sourceMapValidationDecorators.ts]
declare function ClassDecorator1(target: Function): void;
declare function ClassDecorator2(x: number): (target: Function) => void;
declare function PropertyDecorator1(target: Object, key: string | symbol, descriptor: PropertyDescriptor): void;
declare function PropertyDecorator2(x: number): (target: Object, key: string | symbol, descriptor: PropertyDescriptor) => void;
declare function ParameterDecorator1(target: Function, paramIndex: number): void;
declare function ParameterDecorator2(x: number): (target: Function, paramIndex: number) => void;
@ClassDecorator1
@ClassDecorator2(10)
class Greeter {
constructor(
@ParameterDecorator1
@ParameterDecorator2(20)
public greeting: string,
@ParameterDecorator1
@ParameterDecorator2(30)
...b: string[]) {
}
@PropertyDecorator1
@PropertyDecorator2(40)
greet() {
return "<h1>" + this.greeting + "</h1>";
}
@PropertyDecorator1
@PropertyDecorator2(50)
private x: string;
@PropertyDecorator1
@PropertyDecorator2(60)
private static x1: number = 10;
private fn(
@ParameterDecorator1
@ParameterDecorator2(70)
x: number) {
return this.greeting;
}
@PropertyDecorator1
@PropertyDecorator2(80)
get greetings() {
return this.greeting;
}
@PropertyDecorator1
@PropertyDecorator2(90)
set greetings(
@ParameterDecorator1
@ParameterDecorator2(90)
greetings: string) {
this.greeting = greetings;
}
}
//// [sourceMapValidationDecorators.js]
var __decorate = this.__decorate || function (decorators, target, key) {
var kind = key == null ? 0 : typeof key == "number" ? 1 : 2, result = target;
if (kind == 2) result = Object.getOwnPropertyDescriptor(target, typeof key == "symbol" ? key : key = String(key));
for (var i = decorators.length - 1; i >= 0; --i) {
var decorator = decorators[i];
result = (kind == 0 ? decorator(result) : kind == 1 ? decorator(target, key) : decorator(target, key, result)) || result;
}
if (kind == 2 && result) Object.defineProperty(target, key, result);
if (kind == 0) return result;
};
var Greeter = (function () {
function Greeter(greeting) {
var b = [];
for (var _i = 1; _i < arguments.length; _i++) {
b[_i - 1] = arguments[_i];
}
this.greeting = greeting;
}
Greeter.prototype.greet = function () {
return "<h1>" + this.greeting + "</h1>";
};
Greeter.prototype.fn = function (x) {
return this.greeting;
};
Object.defineProperty(Greeter.prototype, "greetings", {
get: function () {
return this.greeting;
},
set: _set_greetings = function (greetings) {
this.greeting = greetings;
},
enumerable: true,
configurable: true
});
Greeter.x1 = 10;
__decorate([PropertyDecorator1, PropertyDecorator2(40)], Greeter.prototype, "greet");
__decorate([PropertyDecorator1, PropertyDecorator2(50)], Greeter.prototype, "x");
__decorate([PropertyDecorator1, PropertyDecorator2(60)], Greeter, "x1");
__decorate([ParameterDecorator1, ParameterDecorator2(70)], Greeter.prototype.fn, 0);
__decorate([ParameterDecorator1, ParameterDecorator2(90)], _set_greetings, 0);
__decorate([PropertyDecorator1, PropertyDecorator2(80), PropertyDecorator1, PropertyDecorator2(90)], Greeter.prototype, "greetings");
__decorate([ParameterDecorator1, ParameterDecorator2(20)], Greeter, 0);
__decorate([ParameterDecorator1, ParameterDecorator2(30)], Greeter, 1);
Greeter = __decorate([ClassDecorator1, ClassDecorator2(10)], Greeter);
return Greeter;
var _set_greetings;
})();
//# sourceMappingURL=sourceMapValidationDecorators.js.map

View File

@ -0,0 +1,2 @@
//// [sourceMapValidationDecorators.js.map]
{"version":3,"file":"sourceMapValidationDecorators.js","sourceRoot":"","sources":["sourceMapValidationDecorators.ts"],"names":["Greeter","Greeter.constructor","Greeter.greet","Greeter.fn","Greeter.greetings"],"mappings":";;;;;;;;;;AAOA;IAGIA,iBAGSA,QAAgBA;QAEvBC,WAEcA;aAFdA,WAEcA,CAFdA,sBAEcA,CAFdA,IAEcA;YAFdA,0BAEcA;;QAJPA,aAAQA,GAARA,QAAQA,CAAQA;IAKzBA,CAACA;IAIDD,uBAAKA,GAFLA;QAGIE,MAAMA,CAACA,MAAMA,GAAGA,IAAIA,CAACA,QAAQA,GAAGA,OAAOA,CAACA;IAC5CA,CAACA;IAUOF,oBAAEA,GAAVA,UAGEA,CAASA;QACPG,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;IACzBA,CAACA;IAEDH,sBAEIA,8BAASA;aAFbA;YAGII,MAAMA,CAACA,IAAIA,CAACA,QAAQA,CAACA;QACzBA,CAACA;aAEDJ,2BAKEA,SAAiBA;YACfI,IAAIA,CAACA,QAAQA,GAAGA,SAASA,CAACA;QAC9BA,CAACA;;;OATAJ;IAbcA,UAAEA,GAAWA,EAAEA,CAACA;IAZ/BA,YAACA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,+BAGtBA;IAEDA,YAACA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,2BACLA;IAElBA,YAACA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,kBACQA;IAE/BA,YACGA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,4BAGzBA;IAQDA,YAGGA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,sBAGzBA;IAbDA,YAACA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,EAKtBA,kBAAkBA,EAClBA,kBAAkBA,CAACA,EAAEA,CAACA,mCAHtBA;IAnCDA,YACGA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,eAMzBA;IARDA,YAKGA,mBAAmBA,EACnBA,mBAAmBA,CAACA,EAAEA,CAACA,eAEzBA;IAXLA,sBAACA,eAAeA,EACfA,eAAeA,CAACA,EAAEA,CAACA,YA+CnBA;IAADA,cAACA;;AAADA,CAACA,AAhDD,IAgDC"}

View File

@ -0,0 +1,858 @@
===================================================================
JsFile: sourceMapValidationDecorators.js
mapUrl: sourceMapValidationDecorators.js.map
sourceRoot:
sources: sourceMapValidationDecorators.ts
===================================================================
-------------------------------------------------------------------
emittedFile:tests/cases/compiler/sourceMapValidationDecorators.js
sourceFile:sourceMapValidationDecorators.ts
-------------------------------------------------------------------
>>>var __decorate = this.__decorate || function (decorators, target, key) {
>>> var kind = key == null ? 0 : typeof key == "number" ? 1 : 2, result = target;
>>> if (kind == 2) result = Object.getOwnPropertyDescriptor(target, typeof key == "symbol" ? key : key = String(key));
>>> for (var i = decorators.length - 1; i >= 0; --i) {
>>> var decorator = decorators[i];
>>> result = (kind == 0 ? decorator(result) : kind == 1 ? decorator(target, key) : decorator(target, key, result)) || result;
>>> }
>>> if (kind == 2 && result) Object.defineProperty(target, key, result);
>>> if (kind == 0) return result;
>>>};
>>>var Greeter = (function () {
1 >
2 >^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >declare function ClassDecorator1(target: Function): void;
>declare function ClassDecorator2(x: number): (target: Function) => void;
>declare function PropertyDecorator1(target: Object, key: string | symbol, descriptor: PropertyDescriptor): void;
>declare function PropertyDecorator2(x: number): (target: Object, key: string | symbol, descriptor: PropertyDescriptor) => void;
>declare function ParameterDecorator1(target: Function, paramIndex: number): void;
>declare function ParameterDecorator2(x: number): (target: Function, paramIndex: number) => void;
>
>
1 >Emitted(11, 1) Source(8, 1) + SourceIndex(0)
---
>>> function Greeter(greeting) {
1->^^^^
2 > ^^^^^^^^^^^^^^^^^
3 > ^^^^^^^^
1->@ClassDecorator1
>@ClassDecorator2(10)
>class Greeter {
>
2 > constructor(
> @ParameterDecorator1
> @ParameterDecorator2(20)
> public
3 > greeting: string
1->Emitted(12, 5) Source(11, 5) + SourceIndex(0) name (Greeter)
2 >Emitted(12, 22) Source(14, 14) + SourceIndex(0) name (Greeter)
3 >Emitted(12, 30) Source(14, 30) + SourceIndex(0) name (Greeter)
---
>>> var b = [];
1 >^^^^^^^^
2 > ^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >,
>
>
2 > @ParameterDecorator1
> @ParameterDecorator2(30)
> ...b: string[]
1 >Emitted(13, 9) Source(16, 7) + SourceIndex(0) name (Greeter.constructor)
2 >Emitted(13, 20) Source(18, 21) + SourceIndex(0) name (Greeter.constructor)
---
>>> for (var _i = 1; _i < arguments.length; _i++) {
1->^^^^^^^^^^^^^
2 > ^^^^^^^^^^^
3 > ^
4 > ^^^^^^^^^^^^^^^^^^^^^^
5 > ^
6 > ^^^^
1->
2 > @ParameterDecorator1
> @ParameterDecorator2(30)
> ...b: string[]
3 >
4 > @ParameterDecorator1
> @ParameterDecorator2(30)
> ...b: string[]
5 >
6 > @ParameterDecorator1
> @ParameterDecorator2(30)
> ...b: string[]
1->Emitted(14, 14) Source(16, 7) + SourceIndex(0) name (Greeter.constructor)
2 >Emitted(14, 25) Source(18, 21) + SourceIndex(0) name (Greeter.constructor)
3 >Emitted(14, 26) Source(16, 7) + SourceIndex(0) name (Greeter.constructor)
4 >Emitted(14, 48) Source(18, 21) + SourceIndex(0) name (Greeter.constructor)
5 >Emitted(14, 49) Source(16, 7) + SourceIndex(0) name (Greeter.constructor)
6 >Emitted(14, 53) Source(18, 21) + SourceIndex(0) name (Greeter.constructor)
---
>>> b[_i - 1] = arguments[_i];
1 >^^^^^^^^^^^^
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >
2 > @ParameterDecorator1
> @ParameterDecorator2(30)
> ...b: string[]
1 >Emitted(15, 13) Source(16, 7) + SourceIndex(0) name (Greeter.constructor)
2 >Emitted(15, 39) Source(18, 21) + SourceIndex(0) name (Greeter.constructor)
---
>>> }
>>> this.greeting = greeting;
1 >^^^^^^^^
2 > ^^^^^^^^^^^^^
3 > ^^^
4 > ^^^^^^^^
5 > ^
1 >
2 > greeting
3 >
4 > greeting
5 > : string
1 >Emitted(17, 9) Source(14, 14) + SourceIndex(0) name (Greeter.constructor)
2 >Emitted(17, 22) Source(14, 22) + SourceIndex(0) name (Greeter.constructor)
3 >Emitted(17, 25) Source(14, 14) + SourceIndex(0) name (Greeter.constructor)
4 >Emitted(17, 33) Source(14, 22) + SourceIndex(0) name (Greeter.constructor)
5 >Emitted(17, 34) Source(14, 30) + SourceIndex(0) name (Greeter.constructor)
---
>>> }
1 >^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >,
>
> @ParameterDecorator1
> @ParameterDecorator2(30)
> ...b: string[]) {
>
2 > }
1 >Emitted(18, 5) Source(19, 5) + SourceIndex(0) name (Greeter.constructor)
2 >Emitted(18, 6) Source(19, 6) + SourceIndex(0) name (Greeter.constructor)
---
>>> Greeter.prototype.greet = function () {
1->^^^^
2 > ^^^^^^^^^^^^^^^^^^^^^^^
3 > ^^^
4 > ^^^^^^^^^^^^^^^^^^^->
1->
>
> @PropertyDecorator1
> @PropertyDecorator2(40)
>
2 > greet
3 >
1->Emitted(19, 5) Source(23, 5) + SourceIndex(0) name (Greeter)
2 >Emitted(19, 28) Source(23, 10) + SourceIndex(0) name (Greeter)
3 >Emitted(19, 31) Source(21, 5) + SourceIndex(0) name (Greeter)
---
>>> return "<h1>" + this.greeting + "</h1>";
1->^^^^^^^^
2 > ^^^^^^
3 > ^
4 > ^^^^^^
5 > ^^^
6 > ^^^^
7 > ^
8 > ^^^^^^^^
9 > ^^^
10> ^^^^^^^
11> ^
1->@PropertyDecorator1
> @PropertyDecorator2(40)
> greet() {
>
2 > return
3 >
4 > "<h1>"
5 > +
6 > this
7 > .
8 > greeting
9 > +
10> "</h1>"
11> ;
1->Emitted(20, 9) Source(24, 9) + SourceIndex(0) name (Greeter.greet)
2 >Emitted(20, 15) Source(24, 15) + SourceIndex(0) name (Greeter.greet)
3 >Emitted(20, 16) Source(24, 16) + SourceIndex(0) name (Greeter.greet)
4 >Emitted(20, 22) Source(24, 22) + SourceIndex(0) name (Greeter.greet)
5 >Emitted(20, 25) Source(24, 25) + SourceIndex(0) name (Greeter.greet)
6 >Emitted(20, 29) Source(24, 29) + SourceIndex(0) name (Greeter.greet)
7 >Emitted(20, 30) Source(24, 30) + SourceIndex(0) name (Greeter.greet)
8 >Emitted(20, 38) Source(24, 38) + SourceIndex(0) name (Greeter.greet)
9 >Emitted(20, 41) Source(24, 41) + SourceIndex(0) name (Greeter.greet)
10>Emitted(20, 48) Source(24, 48) + SourceIndex(0) name (Greeter.greet)
11>Emitted(20, 49) Source(24, 49) + SourceIndex(0) name (Greeter.greet)
---
>>> };
1 >^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>
2 > }
1 >Emitted(21, 5) Source(25, 5) + SourceIndex(0) name (Greeter.greet)
2 >Emitted(21, 6) Source(25, 6) + SourceIndex(0) name (Greeter.greet)
---
>>> Greeter.prototype.fn = function (x) {
1->^^^^
2 > ^^^^^^^^^^^^^^^^^^^^
3 > ^^^
4 > ^^^^^^^^^^
5 > ^
1->
>
> @PropertyDecorator1
> @PropertyDecorator2(50)
> private x: string;
>
> @PropertyDecorator1
> @PropertyDecorator2(60)
> private static x1: number = 10;
>
> private
2 > fn
3 >
4 > private fn(
> @ParameterDecorator1
> @ParameterDecorator2(70)
>
5 > x: number
1->Emitted(22, 5) Source(35, 13) + SourceIndex(0) name (Greeter)
2 >Emitted(22, 25) Source(35, 15) + SourceIndex(0) name (Greeter)
3 >Emitted(22, 28) Source(35, 5) + SourceIndex(0) name (Greeter)
4 >Emitted(22, 38) Source(38, 7) + SourceIndex(0) name (Greeter)
5 >Emitted(22, 39) Source(38, 16) + SourceIndex(0) name (Greeter)
---
>>> return this.greeting;
1 >^^^^^^^^
2 > ^^^^^^
3 > ^
4 > ^^^^
5 > ^
6 > ^^^^^^^^
7 > ^
1 >) {
>
2 > return
3 >
4 > this
5 > .
6 > greeting
7 > ;
1 >Emitted(23, 9) Source(39, 9) + SourceIndex(0) name (Greeter.fn)
2 >Emitted(23, 15) Source(39, 15) + SourceIndex(0) name (Greeter.fn)
3 >Emitted(23, 16) Source(39, 16) + SourceIndex(0) name (Greeter.fn)
4 >Emitted(23, 20) Source(39, 20) + SourceIndex(0) name (Greeter.fn)
5 >Emitted(23, 21) Source(39, 21) + SourceIndex(0) name (Greeter.fn)
6 >Emitted(23, 29) Source(39, 29) + SourceIndex(0) name (Greeter.fn)
7 >Emitted(23, 30) Source(39, 30) + SourceIndex(0) name (Greeter.fn)
---
>>> };
1 >^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>
2 > }
1 >Emitted(24, 5) Source(40, 5) + SourceIndex(0) name (Greeter.fn)
2 >Emitted(24, 6) Source(40, 6) + SourceIndex(0) name (Greeter.fn)
---
>>> Object.defineProperty(Greeter.prototype, "greetings", {
1->^^^^
2 > ^^^^^^^^^^^^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1->
>
>
2 > @PropertyDecorator1
> @PropertyDecorator2(80)
> get
3 > greetings
1->Emitted(25, 5) Source(42, 5) + SourceIndex(0) name (Greeter)
2 >Emitted(25, 27) Source(44, 9) + SourceIndex(0) name (Greeter)
3 >Emitted(25, 57) Source(44, 18) + SourceIndex(0) name (Greeter)
---
>>> get: function () {
1 >^^^^^^^^^^^^^
2 > ^^^^^^^^^^^^^^^^^^^^^->
1 >
1 >Emitted(26, 14) Source(42, 5) + SourceIndex(0) name (Greeter)
---
>>> return this.greeting;
1->^^^^^^^^^^^^
2 > ^^^^^^
3 > ^
4 > ^^^^
5 > ^
6 > ^^^^^^^^
7 > ^
1->@PropertyDecorator1
> @PropertyDecorator2(80)
> get greetings() {
>
2 > return
3 >
4 > this
5 > .
6 > greeting
7 > ;
1->Emitted(27, 13) Source(45, 9) + SourceIndex(0) name (Greeter.greetings)
2 >Emitted(27, 19) Source(45, 15) + SourceIndex(0) name (Greeter.greetings)
3 >Emitted(27, 20) Source(45, 16) + SourceIndex(0) name (Greeter.greetings)
4 >Emitted(27, 24) Source(45, 20) + SourceIndex(0) name (Greeter.greetings)
5 >Emitted(27, 25) Source(45, 21) + SourceIndex(0) name (Greeter.greetings)
6 >Emitted(27, 33) Source(45, 29) + SourceIndex(0) name (Greeter.greetings)
7 >Emitted(27, 34) Source(45, 30) + SourceIndex(0) name (Greeter.greetings)
---
>>> },
1 >^^^^^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>
2 > }
1 >Emitted(28, 9) Source(46, 5) + SourceIndex(0) name (Greeter.greetings)
2 >Emitted(28, 10) Source(46, 6) + SourceIndex(0) name (Greeter.greetings)
---
>>> set: _set_greetings = function (greetings) {
1->^^^^^^^^^^^^^
2 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^
3 > ^^^^^^^^^
1->
>
>
2 > @PropertyDecorator1
> @PropertyDecorator2(90)
> set greetings(
> @ParameterDecorator1
> @ParameterDecorator2(90)
>
3 > greetings: string
1->Emitted(29, 14) Source(48, 5) + SourceIndex(0) name (Greeter)
2 >Emitted(29, 41) Source(53, 7) + SourceIndex(0) name (Greeter)
3 >Emitted(29, 50) Source(53, 24) + SourceIndex(0) name (Greeter)
---
>>> this.greeting = greetings;
1 >^^^^^^^^^^^^
2 > ^^^^
3 > ^
4 > ^^^^^^^^
5 > ^^^
6 > ^^^^^^^^^
7 > ^
1 >) {
>
2 > this
3 > .
4 > greeting
5 > =
6 > greetings
7 > ;
1 >Emitted(30, 13) Source(54, 9) + SourceIndex(0) name (Greeter.greetings)
2 >Emitted(30, 17) Source(54, 13) + SourceIndex(0) name (Greeter.greetings)
3 >Emitted(30, 18) Source(54, 14) + SourceIndex(0) name (Greeter.greetings)
4 >Emitted(30, 26) Source(54, 22) + SourceIndex(0) name (Greeter.greetings)
5 >Emitted(30, 29) Source(54, 25) + SourceIndex(0) name (Greeter.greetings)
6 >Emitted(30, 38) Source(54, 34) + SourceIndex(0) name (Greeter.greetings)
7 >Emitted(30, 39) Source(54, 35) + SourceIndex(0) name (Greeter.greetings)
---
>>> },
1 >^^^^^^^^
2 > ^
3 > ^^^^^^^^^^^^^^^^^->
1 >
>
2 > }
1 >Emitted(31, 9) Source(55, 5) + SourceIndex(0) name (Greeter.greetings)
2 >Emitted(31, 10) Source(55, 6) + SourceIndex(0) name (Greeter.greetings)
---
>>> enumerable: true,
>>> configurable: true
>>> });
1->^^^^^^^
2 > ^^^^^^^^^^^^^^->
1->
1->Emitted(34, 8) Source(46, 6) + SourceIndex(0) name (Greeter)
---
>>> Greeter.x1 = 10;
1->^^^^
2 > ^^^^^^^^^^
3 > ^^^
4 > ^^
5 > ^
6 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1->
2 > x1
3 > : number =
4 > 10
5 > ;
1->Emitted(35, 5) Source(33, 20) + SourceIndex(0) name (Greeter)
2 >Emitted(35, 15) Source(33, 22) + SourceIndex(0) name (Greeter)
3 >Emitted(35, 18) Source(33, 33) + SourceIndex(0) name (Greeter)
4 >Emitted(35, 20) Source(33, 35) + SourceIndex(0) name (Greeter)
5 >Emitted(35, 21) Source(33, 36) + SourceIndex(0) name (Greeter)
---
>>> __decorate([PropertyDecorator1, PropertyDecorator2(40)], Greeter.prototype, "greet");
1->^^^^
2 > ^^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^
4 > ^^
5 > ^^^^^^^^^^^^^^^^^^
6 > ^
7 > ^^
8 > ^
9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1->
2 > @
3 > PropertyDecorator1
4 >
> @
5 > PropertyDecorator2
6 > (
7 > 40
8 > )
9 >
> greet() {
> return "<h1>" + this.greeting + "</h1>";
> }
1->Emitted(36, 5) Source(21, 5) + SourceIndex(0) name (Greeter)
2 >Emitted(36, 17) Source(21, 6) + SourceIndex(0) name (Greeter)
3 >Emitted(36, 35) Source(21, 24) + SourceIndex(0) name (Greeter)
4 >Emitted(36, 37) Source(22, 6) + SourceIndex(0) name (Greeter)
5 >Emitted(36, 55) Source(22, 24) + SourceIndex(0) name (Greeter)
6 >Emitted(36, 56) Source(22, 25) + SourceIndex(0) name (Greeter)
7 >Emitted(36, 58) Source(22, 27) + SourceIndex(0) name (Greeter)
8 >Emitted(36, 59) Source(22, 28) + SourceIndex(0) name (Greeter)
9 >Emitted(36, 90) Source(25, 6) + SourceIndex(0) name (Greeter)
---
>>> __decorate([PropertyDecorator1, PropertyDecorator2(50)], Greeter.prototype, "x");
1 >^^^^
2 > ^^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^
4 > ^^
5 > ^^^^^^^^^^^^^^^^^^
6 > ^
7 > ^^
8 > ^
9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^
1 >
>
>
2 > @
3 > PropertyDecorator1
4 >
> @
5 > PropertyDecorator2
6 > (
7 > 50
8 > )
9 >
> private x: string;
1 >Emitted(37, 5) Source(27, 5) + SourceIndex(0) name (Greeter)
2 >Emitted(37, 17) Source(27, 6) + SourceIndex(0) name (Greeter)
3 >Emitted(37, 35) Source(27, 24) + SourceIndex(0) name (Greeter)
4 >Emitted(37, 37) Source(28, 6) + SourceIndex(0) name (Greeter)
5 >Emitted(37, 55) Source(28, 24) + SourceIndex(0) name (Greeter)
6 >Emitted(37, 56) Source(28, 25) + SourceIndex(0) name (Greeter)
7 >Emitted(37, 58) Source(28, 27) + SourceIndex(0) name (Greeter)
8 >Emitted(37, 59) Source(28, 28) + SourceIndex(0) name (Greeter)
9 >Emitted(37, 86) Source(29, 23) + SourceIndex(0) name (Greeter)
---
>>> __decorate([PropertyDecorator1, PropertyDecorator2(60)], Greeter, "x1");
1 >^^^^
2 > ^^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^
4 > ^^
5 > ^^^^^^^^^^^^^^^^^^
6 > ^
7 > ^^
8 > ^
9 > ^^^^^^^^^^^^^^^^^^
10> ^^^^^^^^^^^^^->
1 >
>
>
2 > @
3 > PropertyDecorator1
4 >
> @
5 > PropertyDecorator2
6 > (
7 > 60
8 > )
9 >
> private static x1: number = 10;
1 >Emitted(38, 5) Source(31, 5) + SourceIndex(0) name (Greeter)
2 >Emitted(38, 17) Source(31, 6) + SourceIndex(0) name (Greeter)
3 >Emitted(38, 35) Source(31, 24) + SourceIndex(0) name (Greeter)
4 >Emitted(38, 37) Source(32, 6) + SourceIndex(0) name (Greeter)
5 >Emitted(38, 55) Source(32, 24) + SourceIndex(0) name (Greeter)
6 >Emitted(38, 56) Source(32, 25) + SourceIndex(0) name (Greeter)
7 >Emitted(38, 58) Source(32, 27) + SourceIndex(0) name (Greeter)
8 >Emitted(38, 59) Source(32, 28) + SourceIndex(0) name (Greeter)
9 >Emitted(38, 77) Source(33, 36) + SourceIndex(0) name (Greeter)
---
>>> __decorate([ParameterDecorator1, ParameterDecorator2(70)], Greeter.prototype.fn, 0);
1->^^^^
2 > ^^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^^
4 > ^^
5 > ^^^^^^^^^^^^^^^^^^^
6 > ^
7 > ^^
8 > ^
9 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1->
>
>
2 > private fn(
> @
3 > ParameterDecorator1
4 >
> @
5 > ParameterDecorator2
6 > (
7 > 70
8 > )
9 >
> x: number) {
> return this.greeting;
> }
1->Emitted(39, 5) Source(35, 5) + SourceIndex(0) name (Greeter)
2 >Emitted(39, 17) Source(36, 8) + SourceIndex(0) name (Greeter)
3 >Emitted(39, 36) Source(36, 27) + SourceIndex(0) name (Greeter)
4 >Emitted(39, 38) Source(37, 8) + SourceIndex(0) name (Greeter)
5 >Emitted(39, 57) Source(37, 27) + SourceIndex(0) name (Greeter)
6 >Emitted(39, 58) Source(37, 28) + SourceIndex(0) name (Greeter)
7 >Emitted(39, 60) Source(37, 30) + SourceIndex(0) name (Greeter)
8 >Emitted(39, 61) Source(37, 31) + SourceIndex(0) name (Greeter)
9 >Emitted(39, 89) Source(40, 6) + SourceIndex(0) name (Greeter)
---
>>> __decorate([ParameterDecorator1, ParameterDecorator2(90)], _set_greetings, 0);
1 >^^^^
2 > ^^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^^
4 > ^^
5 > ^^^^^^^^^^^^^^^^^^^
6 > ^
7 > ^^
8 > ^
9 > ^^^^^^^^^^^^^^^^^^^^^^
10> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1 >
>
> @PropertyDecorator1
> @PropertyDecorator2(80)
> get greetings() {
> return this.greeting;
> }
>
>
2 > @PropertyDecorator1
> @PropertyDecorator2(90)
> set greetings(
> @
3 > ParameterDecorator1
4 >
> @
5 > ParameterDecorator2
6 > (
7 > 90
8 > )
9 >
> greetings: string) {
> this.greeting = greetings;
> }
1 >Emitted(40, 5) Source(48, 5) + SourceIndex(0) name (Greeter)
2 >Emitted(40, 17) Source(51, 8) + SourceIndex(0) name (Greeter)
3 >Emitted(40, 36) Source(51, 27) + SourceIndex(0) name (Greeter)
4 >Emitted(40, 38) Source(52, 8) + SourceIndex(0) name (Greeter)
5 >Emitted(40, 57) Source(52, 27) + SourceIndex(0) name (Greeter)
6 >Emitted(40, 58) Source(52, 28) + SourceIndex(0) name (Greeter)
7 >Emitted(40, 60) Source(52, 30) + SourceIndex(0) name (Greeter)
8 >Emitted(40, 61) Source(52, 31) + SourceIndex(0) name (Greeter)
9 >Emitted(40, 83) Source(55, 6) + SourceIndex(0) name (Greeter)
---
>>> __decorate([PropertyDecorator1, PropertyDecorator2(80), PropertyDecorator1, PropertyDecorator2(90)], Greeter.prototype, "greetings");
1->^^^^
2 > ^^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^
4 > ^^
5 > ^^^^^^^^^^^^^^^^^^
6 > ^
7 > ^^
8 > ^
9 > ^^
10> ^^^^^^^^^^^^^^^^^^
11> ^^
12> ^^^^^^^^^^^^^^^^^^
13> ^
14> ^^
15> ^
16> ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1->
2 > @
3 > PropertyDecorator1
4 >
> @
5 > PropertyDecorator2
6 > (
7 > 80
8 > )
9 >
> get greetings() {
> return this.greeting;
> }
>
> @
10> PropertyDecorator1
11>
> @
12> PropertyDecorator2
13> (
14> 90
15> )
16>
1->Emitted(41, 5) Source(42, 5) + SourceIndex(0) name (Greeter)
2 >Emitted(41, 17) Source(42, 6) + SourceIndex(0) name (Greeter)
3 >Emitted(41, 35) Source(42, 24) + SourceIndex(0) name (Greeter)
4 >Emitted(41, 37) Source(43, 6) + SourceIndex(0) name (Greeter)
5 >Emitted(41, 55) Source(43, 24) + SourceIndex(0) name (Greeter)
6 >Emitted(41, 56) Source(43, 25) + SourceIndex(0) name (Greeter)
7 >Emitted(41, 58) Source(43, 27) + SourceIndex(0) name (Greeter)
8 >Emitted(41, 59) Source(43, 28) + SourceIndex(0) name (Greeter)
9 >Emitted(41, 61) Source(48, 6) + SourceIndex(0) name (Greeter)
10>Emitted(41, 79) Source(48, 24) + SourceIndex(0) name (Greeter)
11>Emitted(41, 81) Source(49, 6) + SourceIndex(0) name (Greeter)
12>Emitted(41, 99) Source(49, 24) + SourceIndex(0) name (Greeter)
13>Emitted(41, 100) Source(49, 25) + SourceIndex(0) name (Greeter)
14>Emitted(41, 102) Source(49, 27) + SourceIndex(0) name (Greeter)
15>Emitted(41, 103) Source(49, 28) + SourceIndex(0) name (Greeter)
16>Emitted(41, 138) Source(46, 6) + SourceIndex(0) name (Greeter)
---
>>> __decorate([ParameterDecorator1, ParameterDecorator2(20)], Greeter, 0);
1 >^^^^
2 > ^^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^^
4 > ^^
5 > ^^^^^^^^^^^^^^^^^^^
6 > ^
7 > ^^
8 > ^
9 > ^^^^^^^^^^^^^^^
10> ^->
1 >
2 > constructor(
> @
3 > ParameterDecorator1
4 >
> @
5 > ParameterDecorator2
6 > (
7 > 20
8 > )
9 >
> public greeting: string,
>
> @ParameterDecorator1
> @ParameterDecorator2(30)
> ...b: string[]) {
> }
1 >Emitted(42, 5) Source(11, 5) + SourceIndex(0) name (Greeter)
2 >Emitted(42, 17) Source(12, 8) + SourceIndex(0) name (Greeter)
3 >Emitted(42, 36) Source(12, 27) + SourceIndex(0) name (Greeter)
4 >Emitted(42, 38) Source(13, 8) + SourceIndex(0) name (Greeter)
5 >Emitted(42, 57) Source(13, 27) + SourceIndex(0) name (Greeter)
6 >Emitted(42, 58) Source(13, 28) + SourceIndex(0) name (Greeter)
7 >Emitted(42, 60) Source(13, 30) + SourceIndex(0) name (Greeter)
8 >Emitted(42, 61) Source(13, 31) + SourceIndex(0) name (Greeter)
9 >Emitted(42, 76) Source(19, 6) + SourceIndex(0) name (Greeter)
---
>>> __decorate([ParameterDecorator1, ParameterDecorator2(30)], Greeter, 1);
1->^^^^
2 > ^^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^^^^^
4 > ^^
5 > ^^^^^^^^^^^^^^^^^^^
6 > ^
7 > ^^
8 > ^
9 > ^^^^^^^^^^^^^^^
1->
2 > constructor(
> @ParameterDecorator1
> @ParameterDecorator2(20)
> public greeting: string,
>
> @
3 > ParameterDecorator1
4 >
> @
5 > ParameterDecorator2
6 > (
7 > 30
8 > )
9 >
> ...b: string[]) {
> }
1->Emitted(43, 5) Source(11, 5) + SourceIndex(0) name (Greeter)
2 >Emitted(43, 17) Source(16, 8) + SourceIndex(0) name (Greeter)
3 >Emitted(43, 36) Source(16, 27) + SourceIndex(0) name (Greeter)
4 >Emitted(43, 38) Source(17, 8) + SourceIndex(0) name (Greeter)
5 >Emitted(43, 57) Source(17, 27) + SourceIndex(0) name (Greeter)
6 >Emitted(43, 58) Source(17, 28) + SourceIndex(0) name (Greeter)
7 >Emitted(43, 60) Source(17, 30) + SourceIndex(0) name (Greeter)
8 >Emitted(43, 61) Source(17, 31) + SourceIndex(0) name (Greeter)
9 >Emitted(43, 76) Source(19, 6) + SourceIndex(0) name (Greeter)
---
>>> Greeter = __decorate([ClassDecorator1, ClassDecorator2(10)], Greeter);
1 >^^^^
2 > ^^^^^^^^^^^^^^^^^^^^^^
3 > ^^^^^^^^^^^^^^^
4 > ^^
5 > ^^^^^^^^^^^^^^^
6 > ^
7 > ^^
8 > ^
9 > ^^^^^^^^^^^^
1 >
2 > @
3 > ClassDecorator1
4 >
> @
5 > ClassDecorator2
6 > (
7 > 10
8 > )
9 >
> class Greeter {
> constructor(
> @ParameterDecorator1
> @ParameterDecorator2(20)
> public greeting: string,
>
> @ParameterDecorator1
> @ParameterDecorator2(30)
> ...b: string[]) {
> }
>
> @PropertyDecorator1
> @PropertyDecorator2(40)
> greet() {
> return "<h1>" + this.greeting + "</h1>";
> }
>
> @PropertyDecorator1
> @PropertyDecorator2(50)
> private x: string;
>
> @PropertyDecorator1
> @PropertyDecorator2(60)
> private static x1: number = 10;
>
> private fn(
> @ParameterDecorator1
> @ParameterDecorator2(70)
> x: number) {
> return this.greeting;
> }
>
> @PropertyDecorator1
> @PropertyDecorator2(80)
> get greetings() {
> return this.greeting;
> }
>
> @PropertyDecorator1
> @PropertyDecorator2(90)
> set greetings(
> @ParameterDecorator1
> @ParameterDecorator2(90)
> greetings: string) {
> this.greeting = greetings;
> }
> }
1 >Emitted(44, 5) Source(8, 1) + SourceIndex(0) name (Greeter)
2 >Emitted(44, 27) Source(8, 2) + SourceIndex(0) name (Greeter)
3 >Emitted(44, 42) Source(8, 17) + SourceIndex(0) name (Greeter)
4 >Emitted(44, 44) Source(9, 2) + SourceIndex(0) name (Greeter)
5 >Emitted(44, 59) Source(9, 17) + SourceIndex(0) name (Greeter)
6 >Emitted(44, 60) Source(9, 18) + SourceIndex(0) name (Greeter)
7 >Emitted(44, 62) Source(9, 20) + SourceIndex(0) name (Greeter)
8 >Emitted(44, 63) Source(9, 21) + SourceIndex(0) name (Greeter)
9 >Emitted(44, 75) Source(56, 2) + SourceIndex(0) name (Greeter)
---
>>> return Greeter;
1 >^^^^
2 > ^^^^^^^^^^^^^^
3 > ^^^^^^->
1 >
2 > }
1 >Emitted(45, 5) Source(56, 1) + SourceIndex(0) name (Greeter)
2 >Emitted(45, 19) Source(56, 2) + SourceIndex(0) name (Greeter)
---
>>> var _set_greetings;
>>>})();
1->
2 >^
3 >
4 > ^^^^
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^->
1->
2 >}
3 >
4 > @ClassDecorator1
> @ClassDecorator2(10)
> class Greeter {
> constructor(
> @ParameterDecorator1
> @ParameterDecorator2(20)
> public greeting: string,
>
> @ParameterDecorator1
> @ParameterDecorator2(30)
> ...b: string[]) {
> }
>
> @PropertyDecorator1
> @PropertyDecorator2(40)
> greet() {
> return "<h1>" + this.greeting + "</h1>";
> }
>
> @PropertyDecorator1
> @PropertyDecorator2(50)
> private x: string;
>
> @PropertyDecorator1
> @PropertyDecorator2(60)
> private static x1: number = 10;
>
> private fn(
> @ParameterDecorator1
> @ParameterDecorator2(70)
> x: number) {
> return this.greeting;
> }
>
> @PropertyDecorator1
> @PropertyDecorator2(80)
> get greetings() {
> return this.greeting;
> }
>
> @PropertyDecorator1
> @PropertyDecorator2(90)
> set greetings(
> @ParameterDecorator1
> @ParameterDecorator2(90)
> greetings: string) {
> this.greeting = greetings;
> }
> }
1->Emitted(47, 1) Source(56, 1) + SourceIndex(0) name (Greeter)
2 >Emitted(47, 2) Source(56, 2) + SourceIndex(0) name (Greeter)
3 >Emitted(47, 2) Source(8, 1) + SourceIndex(0)
4 >Emitted(47, 6) Source(56, 2) + SourceIndex(0)
---
>>>//# sourceMappingURL=sourceMapValidationDecorators.js.map

View File

@ -0,0 +1,175 @@
=== tests/cases/compiler/sourceMapValidationDecorators.ts ===
declare function ClassDecorator1(target: Function): void;
>ClassDecorator1 : (target: Function) => void
>target : Function
>Function : Function
declare function ClassDecorator2(x: number): (target: Function) => void;
>ClassDecorator2 : (x: number) => (target: Function) => void
>x : number
>target : Function
>Function : Function
declare function PropertyDecorator1(target: Object, key: string | symbol, descriptor: PropertyDescriptor): void;
>PropertyDecorator1 : (target: Object, key: string | symbol, descriptor: PropertyDescriptor) => void
>target : Object
>Object : Object
>key : string | symbol
>descriptor : PropertyDescriptor
>PropertyDescriptor : PropertyDescriptor
declare function PropertyDecorator2(x: number): (target: Object, key: string | symbol, descriptor: PropertyDescriptor) => void;
>PropertyDecorator2 : (x: number) => (target: Object, key: string | symbol, descriptor: PropertyDescriptor) => void
>x : number
>target : Object
>Object : Object
>key : string | symbol
>descriptor : PropertyDescriptor
>PropertyDescriptor : PropertyDescriptor
declare function ParameterDecorator1(target: Function, paramIndex: number): void;
>ParameterDecorator1 : (target: Function, paramIndex: number) => void
>target : Function
>Function : Function
>paramIndex : number
declare function ParameterDecorator2(x: number): (target: Function, paramIndex: number) => void;
>ParameterDecorator2 : (x: number) => (target: Function, paramIndex: number) => void
>x : number
>target : Function
>Function : Function
>paramIndex : number
@ClassDecorator1
>ClassDecorator1 : unknown
@ClassDecorator2(10)
>ClassDecorator2(10) : (target: Function) => void
>ClassDecorator2 : (x: number) => (target: Function) => void
class Greeter {
>Greeter : Greeter
constructor(
@ParameterDecorator1
>ParameterDecorator1 : unknown
@ParameterDecorator2(20)
>ParameterDecorator2(20) : (target: Function, paramIndex: number) => void
>ParameterDecorator2 : (x: number) => (target: Function, paramIndex: number) => void
public greeting: string,
>greeting : string
@ParameterDecorator1
>ParameterDecorator1 : unknown
@ParameterDecorator2(30)
>ParameterDecorator2(30) : (target: Function, paramIndex: number) => void
>ParameterDecorator2 : (x: number) => (target: Function, paramIndex: number) => void
...b: string[]) {
>b : string[]
}
@PropertyDecorator1
>PropertyDecorator1 : unknown
@PropertyDecorator2(40)
>PropertyDecorator2(40) : (target: Object, key: string | symbol, descriptor: PropertyDescriptor) => void
>PropertyDecorator2 : (x: number) => (target: Object, key: string | symbol, descriptor: PropertyDescriptor) => void
greet() {
>greet : () => string
return "<h1>" + this.greeting + "</h1>";
>"<h1>" + this.greeting + "</h1>" : string
>"<h1>" + this.greeting : string
>this.greeting : string
>this : Greeter
>greeting : string
}
@PropertyDecorator1
>PropertyDecorator1 : unknown
@PropertyDecorator2(50)
>PropertyDecorator2(50) : (target: Object, key: string | symbol, descriptor: PropertyDescriptor) => void
>PropertyDecorator2 : (x: number) => (target: Object, key: string | symbol, descriptor: PropertyDescriptor) => void
private x: string;
>x : string
@PropertyDecorator1
>PropertyDecorator1 : unknown
@PropertyDecorator2(60)
>PropertyDecorator2(60) : (target: Object, key: string | symbol, descriptor: PropertyDescriptor) => void
>PropertyDecorator2 : (x: number) => (target: Object, key: string | symbol, descriptor: PropertyDescriptor) => void
private static x1: number = 10;
>x1 : number
private fn(
>fn : (x: number) => string
@ParameterDecorator1
>ParameterDecorator1 : unknown
@ParameterDecorator2(70)
>ParameterDecorator2(70) : (target: Function, paramIndex: number) => void
>ParameterDecorator2 : (x: number) => (target: Function, paramIndex: number) => void
x: number) {
>x : number
return this.greeting;
>this.greeting : string
>this : Greeter
>greeting : string
}
@PropertyDecorator1
>PropertyDecorator1 : unknown
@PropertyDecorator2(80)
>PropertyDecorator2(80) : (target: Object, key: string | symbol, descriptor: PropertyDescriptor) => void
>PropertyDecorator2 : (x: number) => (target: Object, key: string | symbol, descriptor: PropertyDescriptor) => void
get greetings() {
>greetings : string
return this.greeting;
>this.greeting : string
>this : Greeter
>greeting : string
}
@PropertyDecorator1
>PropertyDecorator1 : unknown
@PropertyDecorator2(90)
>PropertyDecorator2(90) : (target: Object, key: string | symbol, descriptor: PropertyDescriptor) => void
>PropertyDecorator2 : (x: number) => (target: Object, key: string | symbol, descriptor: PropertyDescriptor) => void
set greetings(
>greetings : string
@ParameterDecorator1
>ParameterDecorator1 : unknown
@ParameterDecorator2(90)
>ParameterDecorator2(90) : (target: Function, paramIndex: number) => void
>ParameterDecorator2 : (x: number) => (target: Function, paramIndex: number) => void
greetings: string) {
>greetings : string
this.greeting = greetings;
>this.greeting = greetings : string
>this.greeting : string
>this : Greeter
>greeting : string
>greetings : string
}
}

View File

@ -0,0 +1,58 @@
// @sourcemap: true
// @target: es5
declare function ClassDecorator1(target: Function): void;
declare function ClassDecorator2(x: number): (target: Function) => void;
declare function PropertyDecorator1(target: Object, key: string | symbol, descriptor: PropertyDescriptor): void;
declare function PropertyDecorator2(x: number): (target: Object, key: string | symbol, descriptor: PropertyDescriptor) => void;
declare function ParameterDecorator1(target: Function, paramIndex: number): void;
declare function ParameterDecorator2(x: number): (target: Function, paramIndex: number) => void;
@ClassDecorator1
@ClassDecorator2(10)
class Greeter {
constructor(
@ParameterDecorator1
@ParameterDecorator2(20)
public greeting: string,
@ParameterDecorator1
@ParameterDecorator2(30)
...b: string[]) {
}
@PropertyDecorator1
@PropertyDecorator2(40)
greet() {
return "<h1>" + this.greeting + "</h1>";
}
@PropertyDecorator1
@PropertyDecorator2(50)
private x: string;
@PropertyDecorator1
@PropertyDecorator2(60)
private static x1: number = 10;
private fn(
@ParameterDecorator1
@ParameterDecorator2(70)
x: number) {
return this.greeting;
}
@PropertyDecorator1
@PropertyDecorator2(80)
get greetings() {
return this.greeting;
}
@PropertyDecorator1
@PropertyDecorator2(90)
set greetings(
@ParameterDecorator1
@ParameterDecorator2(90)
greetings: string) {
this.greeting = greetings;
}
}