TypeScript/tests/baselines/reference/propertyWrappedInTry.js

36 lines
466 B
TypeScript

//// [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();
}
catch (e) { }
baz();
{
return this.bar; // doesn't get rewritten to Foo.bar.
}