Last Comment Bug 717170 - Finally block can change context.result's value resulting in wrong behavior with returns in functions
: Finally block can change context.result's value resulting in wrong behavior w...
Status: RESOLVED FIXED
:
Product: Other Applications
Classification: Client Software
Component: Narcissus (show other bugs)
: Trunk
: x86_64 Mac OS X
: -- major (vote)
: ---
Assigned To: Nobody; OK to take it and work on it
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2012-01-10 23:38 PST by Amjad Masad
Modified: 2012-01-13 16:52 PST (History)
1 user (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description Amjad Masad 2012-01-10 23:38:39 PST
Examples:

(function () {
  try {
    return 1;
  } finally {
    2; 
  }
})(); // expected: 1, actual: 2

(function () {
  try {
    throw 'x';
  } catch (e) {
    return 'error';
  } finally {
    'no just kidding';
  }
})(); // expected 'error', actual: 'no just kidding'.

I'll be sending a simple fix (maybe considered hack, but it works!) pull request on github.

Note You need to log in before you can comment on or make changes to this bug.