-
Notifications
You must be signed in to change notification settings - Fork 12.7k
Commit
- Loading branch information
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1062,6 +1062,8 @@ module ts { | |
export enum ScriptTarget { | ||
ES3, | ||
ES5, | ||
ES6, | ||
This comment has been minimized.
Sorry, something went wrong.
ahejlsberg
Member
|
||
Latest = ES6, | ||
} | ||
|
||
export interface ParsedCommandLine { | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -174,6 +174,7 @@ module ts { | |
export enum LanguageVersion { | ||
EcmaScript3 = 0, | ||
EcmaScript5 = 1, | ||
EcmaScript6 = 2, | ||
} | ||
|
||
export enum ModuleGenTarget { | ||
|
@@ -213,6 +214,7 @@ module ts { | |
switch (languageVersion) { | ||
case LanguageVersion.EcmaScript3: return ScriptTarget.ES3 | ||
case LanguageVersion.EcmaScript5: return ScriptTarget.ES5; | ||
case LanguageVersion.EcmaScript6: return ScriptTarget.ES6; | ||
default: throw Error("unsupported LanguageVersion value: " + languageVersion); | ||
} | ||
} | ||
|
@@ -234,6 +236,7 @@ module ts { | |
switch (scriptTarget) { | ||
case ScriptTarget.ES3: return LanguageVersion.EcmaScript3; | ||
case ScriptTarget.ES5: return LanguageVersion.EcmaScript5; | ||
case ScriptTarget.ES6: return LanguageVersion.EcmaScript6; | ||
This comment has been minimized.
Sorry, something went wrong.
JsonFreeman
Contributor
|
||
default: throw Error("unsupported ScriptTarget value: " + scriptTarget); | ||
} | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
//// [es6-amd.ts] | ||
|
||
class A | ||
{ | ||
constructor () | ||
{ | ||
|
||
} | ||
|
||
public B() | ||
{ | ||
return 42; | ||
} | ||
} | ||
|
||
//// [es6-amd.js] | ||
var A = (function () { | ||
function A() { | ||
} | ||
A.prototype.B = function () { | ||
return 42; | ||
}; | ||
return A; | ||
})(); | ||
This comment has been minimized.
Sorry, something went wrong.
KirillGrishin
|
||
//# sourceMappingURL=es6-amd.js.map | ||
|
||
//// [es6-amd.d.ts] | ||
declare class A { | ||
constructor(); | ||
B(): number; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
=================================================================== | ||
JsFile: es6-amd.js | ||
mapUrl: es6-amd.js.map | ||
sourceRoot: | ||
sources: es6-amd.ts | ||
=================================================================== | ||
------------------------------------------------------------------- | ||
emittedFile:tests/cases/compiler/es6-amd.js | ||
sourceFile:es6-amd.ts | ||
------------------------------------------------------------------- | ||
>>>var A = (function () { | ||
1 > | ||
2 >^^^^ | ||
3 > ^ | ||
4 > ^^^^^^^^^^^^^^-> | ||
1 > | ||
> | ||
2 >class | ||
3 > A | ||
1 >Emitted(1, 1) Source(2, 1) + SourceIndex(0) | ||
2 >Emitted(1, 5) Source(2, 7) + SourceIndex(0) | ||
3 >Emitted(1, 6) Source(2, 8) + SourceIndex(0) | ||
--- | ||
>>> function A() { | ||
1->^^^^ | ||
2 > ^^^^^^^^^ | ||
3 > ^ | ||
1-> | ||
>{ | ||
> | ||
2 > | ||
3 > A | ||
1->Emitted(2, 5) Source(4, 5) + SourceIndex(0) name (A) | ||
2 >Emitted(2, 14) Source(2, 7) + SourceIndex(0) name (A) | ||
3 >Emitted(2, 15) Source(2, 8) + SourceIndex(0) name (A) | ||
--- | ||
>>> } | ||
1 >^^^^ | ||
2 > ^ | ||
3 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> | ||
1 > | ||
>{ | ||
> constructor () | ||
> { | ||
> | ||
> | ||
2 > } | ||
1 >Emitted(3, 5) Source(7, 5) + SourceIndex(0) name (A.constructor) | ||
2 >Emitted(3, 6) Source(7, 6) + SourceIndex(0) name (A.constructor) | ||
--- | ||
>>> A.prototype.B = function () { | ||
1->^^^^ | ||
2 > ^^^^^^^^^^^^^ | ||
3 > ^^^ | ||
1-> | ||
> | ||
> public | ||
2 > B | ||
3 > | ||
1->Emitted(4, 5) Source(9, 12) + SourceIndex(0) name (A) | ||
2 >Emitted(4, 18) Source(9, 13) + SourceIndex(0) name (A) | ||
3 >Emitted(4, 21) Source(9, 5) + SourceIndex(0) name (A) | ||
--- | ||
>>> return 42; | ||
1 >^^^^^^^^ | ||
2 > ^^^^^^ | ||
3 > ^ | ||
4 > ^^ | ||
5 > ^ | ||
1 >public B() | ||
> { | ||
> | ||
2 > return | ||
3 > | ||
4 > 42 | ||
5 > ; | ||
1 >Emitted(5, 9) Source(11, 9) + SourceIndex(0) name (A.B) | ||
2 >Emitted(5, 15) Source(11, 15) + SourceIndex(0) name (A.B) | ||
3 >Emitted(5, 16) Source(11, 16) + SourceIndex(0) name (A.B) | ||
4 >Emitted(5, 18) Source(11, 18) + SourceIndex(0) name (A.B) | ||
5 >Emitted(5, 19) Source(11, 19) + SourceIndex(0) name (A.B) | ||
--- | ||
>>> }; | ||
1 >^^^^ | ||
2 > ^ | ||
3 > ^^^^^^^^^-> | ||
1 > | ||
> | ||
2 > } | ||
1 >Emitted(6, 5) Source(12, 5) + SourceIndex(0) name (A.B) | ||
2 >Emitted(6, 6) Source(12, 6) + SourceIndex(0) name (A.B) | ||
--- | ||
>>> return A; | ||
1->^^^^ | ||
2 > ^^^^^^^^ | ||
1-> | ||
> | ||
2 > } | ||
1->Emitted(7, 5) Source(13, 1) + SourceIndex(0) name (A) | ||
2 >Emitted(7, 13) Source(13, 2) + SourceIndex(0) name (A) | ||
--- | ||
>>>})(); | ||
1 > | ||
2 >^ | ||
3 > | ||
4 > ^^^^ | ||
5 > ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^-> | ||
1 > | ||
2 >} | ||
3 > | ||
4 > class A | ||
> { | ||
> constructor () | ||
> { | ||
> | ||
> } | ||
> | ||
> public B() | ||
> { | ||
> return 42; | ||
> } | ||
> } | ||
1 >Emitted(8, 1) Source(13, 1) + SourceIndex(0) name (A) | ||
2 >Emitted(8, 2) Source(13, 2) + SourceIndex(0) name (A) | ||
3 >Emitted(8, 2) Source(2, 1) + SourceIndex(0) | ||
4 >Emitted(8, 6) Source(13, 2) + SourceIndex(0) | ||
--- | ||
>>>//# sourceMappingURL=es6-amd.js.map |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
=== tests/cases/compiler/es6-amd.ts === | ||
|
||
class A | ||
>A : A | ||
{ | ||
constructor () | ||
{ | ||
|
||
} | ||
|
||
public B() | ||
>B : () => number | ||
{ | ||
return 42; | ||
} | ||
} |
The casing is not consistent between these two messages (6015 and 6047)