mirror of
https://github.com/jashkenas/coffeescript.git
synced 2026-05-03 03:00:14 -04:00
Fixes #1467. Catch now introduces its parameter to scope.
This commit is contained in:
committed by
Michael Ficarra
parent
4af47f0c26
commit
4fc52cd08e
@@ -1822,7 +1822,7 @@
|
||||
var catchPart, errorPart;
|
||||
o.indent += TAB;
|
||||
errorPart = this.error ? " (" + (this.error.compile(o)) + ") " : ' ';
|
||||
catchPart = this.recovery ? " catch" + errorPart + "{\n" + (this.recovery.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}" : !(this.ensure || this.recovery) ? ' catch (_e) {}' : void 0;
|
||||
catchPart = this.recovery ? (o.scope.add(this.error.value, 'param'), " catch" + errorPart + "{\n" + (this.recovery.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}") : !(this.ensure || this.recovery) ? ' catch (_e) {}' : void 0;
|
||||
return ("" + this.tab + "try {\n" + (this.attempt.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}" + (catchPart || '')) + (this.ensure ? " finally {\n" + (this.ensure.compile(o, LEVEL_TOP)) + "\n" + this.tab + "}" : '');
|
||||
};
|
||||
return Try;
|
||||
|
||||
Reference in New Issue
Block a user