2014-07-13 01:04:16 +02:00
|
|
|
//// [classMemberInitializerScoping.ts]
|
|
|
|
var aaa = 1;
|
|
|
|
class CCC {
|
|
|
|
y: number = aaa;
|
|
|
|
static staticY: number = aaa; // This shouldnt be error
|
|
|
|
constructor(aaa) {
|
|
|
|
this.y = ''; // was: error, cannot assign string to number
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
// above is equivalent to this:
|
|
|
|
var aaaa = 1;
|
|
|
|
class CCCC {
|
|
|
|
y: any;
|
|
|
|
constructor(aaaa) {
|
|
|
|
this.y = aaaa;
|
|
|
|
this.y = '';
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//// [classMemberInitializerScoping.js]
|
|
|
|
var aaa = 1;
|
|
|
|
var CCC = (function () {
|
|
|
|
function CCC(aaa) {
|
|
|
|
this.y = aaa;
|
2014-08-16 00:49:09 +02:00
|
|
|
this.y = ''; // was: error, cannot assign string to number
|
2014-07-13 01:04:16 +02:00
|
|
|
}
|
2014-08-15 22:18:54 +02:00
|
|
|
CCC.staticY = aaa; // This shouldnt be error
|
2014-07-13 01:04:16 +02:00
|
|
|
return CCC;
|
|
|
|
})();
|
2014-08-12 00:54:12 +02:00
|
|
|
// above is equivalent to this:
|
2014-07-13 01:04:16 +02:00
|
|
|
var aaaa = 1;
|
|
|
|
var CCCC = (function () {
|
|
|
|
function CCCC(aaaa) {
|
|
|
|
this.y = aaaa;
|
|
|
|
this.y = '';
|
|
|
|
}
|
|
|
|
return CCCC;
|
|
|
|
})();
|