Bug 14897 - Decompilation of double negation fails and produces invalid or incorrect code
Summary: Decompilation of double negation fails and produces invalid or incorrect code
Status: CLOSED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 523.x (Safari 3)
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
: 14892 (view as bug list)
Depends on:
Blocks: 13638
  Show dependency treegraph
 
Reported: 2007-08-07 20:28 PDT by Oliver Hunt
Modified: 2007-08-07 23:35 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Oliver Hunt 2007-08-07 20:28:24 PDT
> (function() {  a - -b; }  )

becomes

function() {a--b;}

and 
- -b
becomes
--b

Which is also clearly wrong and bad, but *will* compile
Comment 1 Oliver Hunt 2007-08-07 20:32:40 PDT
> (function(){a + +b;}).toString() 
function(){a++b;}

Which is also wrong.
Comment 2 Jesse Ruderman 2007-08-07 20:38:49 PDT
FWIW, Mozilla had the same bug and fixed it by always decompiling negation as "- ".  See https://bugzilla.mozilla.org/show_bug.cgi?id=346904 for details.
Comment 3 Sam Weinig 2007-08-07 22:46:34 PDT
<rdar://problem/5394405>
Comment 4 Sam Weinig 2007-08-07 22:47:42 PDT
Fix landed in r24924
Comment 5 Oliver Hunt 2007-08-07 23:35:07 PDT
*** Bug 14892 has been marked as a duplicate of this bug. ***