Skip to content
This repository has been archived by the owner on Feb 21, 2022. It is now read-only.

brace-style error when try/finally block is missing a catch block #93

Closed
bressain opened this issue Aug 5, 2016 · 0 comments
Closed

Comments

@bressain
Copy link

bressain commented Aug 5, 2016

The brace-style rule throws when it encounters a try/finally block with no catch, e.g.

try {
  // do some stuff here
} finally {
  // clean-up code here
}

Adding the catch block fixes the problem.

The error is something like:

/node_modules/tslint-eslint-rules/dist/rules/braceStyleRule.js:130
        return node.getSourceFile().getLineAndCharacterOfPosition(node.getEnd());
                   ^

TypeError: Cannot read property 'getSourceFile' of undefined
    at BraceStyleWalker.getEndPosition (/node_modules/tslint-eslint-rules/dist/rules/braceStyleRule.js:130:20)
    at BraceStyleWalker.areOnSameLine (/node_modules/tslint-eslint-rules/dist/rules/braceStyleRule.js:124:21)
    at BraceStyleWalker.visitTryStatement (/node_modules/tslint-eslint-rules/dist/rules/braceStyleRule.js:65:40)
    at BraceStyleWalker.SyntaxWalker.visitNode (/node_modules/tslint/lib/language/walker/syntaxWalker.js:429:22)
    at /node_modules/tslint/lib/language/walker/syntaxWalker.js:459:63
hadalin pushed a commit to hadalin/tslint-eslint-rules that referenced this issue Aug 29, 2016
hadalin pushed a commit to hadalin/tslint-eslint-rules that referenced this issue Aug 29, 2016
hadalin pushed a commit to hadalin/tslint-eslint-rules that referenced this issue Aug 29, 2016
hadalin pushed a commit to hadalin/tslint-eslint-rules that referenced this issue Aug 29, 2016
hadalin pushed a commit to hadalin/tslint-eslint-rules that referenced this issue Aug 29, 2016
hadalin pushed a commit to hadalin/tslint-eslint-rules that referenced this issue Aug 29, 2016
@buzinas buzinas closed this as completed in 874440f Sep 5, 2016
buzinas added a commit that referenced this issue Sep 5, 2016
[bug] fixed brace-style rule (closes #93)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants