2014-07-13 01:04:16 +02:00
|
|
|
==== tests/cases/compiler/propertyWrappedInTry.ts (9 errors) ====
|
|
|
|
class Foo {
|
|
|
|
|
|
|
|
try {
|
|
|
|
~~~
|
|
|
|
!!! Unexpected token. A constructor, method, accessor, or property was expected.
|
|
|
|
|
|
|
|
public bar = someInitThatMightFail();
|
|
|
|
~~~~~~
|
|
|
|
!!! Statement expected.
|
|
|
|
~~~
|
|
|
|
!!! Cannot find name 'bar'.
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
!!! Cannot find name 'someInitThatMightFail'.
|
|
|
|
|
|
|
|
} catch(e) {}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public baz() {
|
|
|
|
~~~~~~
|
|
|
|
!!! Declaration or statement expected.
|
|
|
|
~
|
|
|
|
!!! ';' expected.
|
|
|
|
~~~
|
|
|
|
!!! Cannot find name 'baz'.
|
|
|
|
|
|
|
|
return this.bar; // doesn't get rewritten to Foo.bar.
|
2014-07-23 01:36:53 +02:00
|
|
|
~~~~~~
|
|
|
|
!!! A 'return' statement can only be used within a function body.
|
2014-07-13 01:04:16 +02:00
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
~
|
|
|
|
!!! Declaration or statement expected.
|
|
|
|
|
|
|
|
|