Skip to content

finally in do-expressions #6385

@nicolo-ribaudo

Description

@nicolo-ribaudo

finally shouldn't alter the completion vaule of the try statement. You can test it using eval("body of the do expression");

https://babeljs.io/repl/build/5158/#?babili=false&browsers=&build=&builtIns=false&code_lz=G4QwTgBCELwQJgewgbwgFzAT1RATBAL4QBmAlgHYgA21OaAzEUQFCiQBGsCyam9GABZhEAd1TFiAYxDopgiAAoApgEpcAVmbkqtAQDZmhFiymIKAZ0TVlAOmqIA5opAAaCB1UBuE-yjdlUGpFACJ-XAJiHRo6XCZCEO8INnAPAKDQ8L5hMQlmGTkFFXU0LSjKGIMiRJ9TcysbeycXd08vIA&debug=false&circleciRepo=&evaluate=true&lineWrap=true&presets=es2015-loose%2Cstage-0&targets=&version=7.0.0-beta.2%2Bpr.6372

Input Code

var a = do { try { 2 } finally { 3 } }
var b = do { try { throw {} } catch (e) { 5 } finally { 6 } }

console.log(a, b);

Expected Behavior

2 5

Current Behavior

3 6

software version(s)
Babel
node
npm
Operating System

Metadata

Metadata

Assignees

No one assigned

    Labels

    Has PRSpec: Do ExpressionsoutdatedA closed issue/PR that is archived due to age. Recommended to make a new issue

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions