Skip to content
Permalink
Browse files

docs: add example for `no-unsafe-finally` rule

  • Loading branch information...
blond committed May 4, 2016
1 parent e3999c0 commit 75f4c00867b0174207c702f51371dfb25389cc70
Showing with 11 additions and 0 deletions.
  1. +11 −0 examples/bad/overwrite.js
@@ -8,3 +8,14 @@ try {
} catch (e) {
e = 10; // Overwrite the reference to the error.
}

/*eslint no-unsafe-finally: "error"*/
(() => {
try {
return 1; // 1 is returned but suspended until finally block ends
} catch(err) {
return 2;
} finally {
return 3; // 3 is returned before 1, which we did not expect
}
})(); // We expect this function to return 1, but result is 3.

0 comments on commit 75f4c00

Please sign in to comment.
You can’t perform that action at this time.