2015-02-03 00:30:33 +01:00
|
|
|
//// [propertyWrappedInTry.ts]
|
|
|
|
class Foo {
|
|
|
|
|
|
|
|
try {
|
|
|
|
|
|
|
|
public bar = someInitThatMightFail();
|
|
|
|
|
|
|
|
} catch(e) {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public baz() {
|
|
|
|
|
|
|
|
return this.bar; // doesn't get rewritten to Foo.bar.
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
//// [propertyWrappedInTry.js]
|
|
|
|
var Foo = (function () {
|
|
|
|
function Foo() {
|
|
|
|
}
|
|
|
|
return Foo;
|
|
|
|
})();
|
|
|
|
try {
|
|
|
|
bar = someInitThatMightFail();
|
|
|
|
}
|
2015-03-26 21:46:35 +01:00
|
|
|
catch (e) { }
|
2015-02-03 00:30:33 +01:00
|
|
|
baz();
|
|
|
|
{
|
|
|
|
return this.bar; // doesn't get rewritten to Foo.bar.
|
|
|
|
}
|