38 lines
No EOL
916 B
Text
38 lines
No EOL
916 B
Text
==== 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.
|
|
~~~~~~
|
|
!!! A 'return' statement can only be used within a function body.
|
|
|
|
}
|
|
|
|
}
|
|
~
|
|
!!! Declaration or statement expected.
|
|
|
|
|