Bug 17929 - Incorrect decompilation with |const|, comma
Summary: Incorrect decompilation with |const|, comma
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: 528+ (Nightly build)
Hardware: Mac OS X 10.5
: P2 Normal
Assignee: Oliver Hunt
URL:
Keywords: HasReduction, InRadar
Depends on:
Blocks: 13638
  Show dependency treegraph
 
Reported: 2008-03-18 17:57 PDT by Jesse Ruderman
Modified: 2008-03-18 23:18 PDT (History)
3 users (show)

See Also:


Attachments
Patch-fu! (2.99 KB, patch)
2008-03-18 23:06 PDT, Oliver Hunt
mrowe: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jesse Ruderman 2008-03-18 17:57:44 PDT
> function f() { const x = (1, 2); }

> f
function f() 
{
  const x = 1, 2;
}

> eval("" + f)
SyntaxError: Parse error

Tested with (Safari 3.1) and (ToT Debug/testkjs).
Comment 1 Mark Rowe (bdash) 2008-03-18 18:59:51 PDT
<rdar://problem/5806714>
Comment 2 Oliver Hunt 2008-03-18 23:06:39 PDT
Created attachment 19879 [details]
Patch-fu!
Comment 3 Mark Rowe (bdash) 2008-03-18 23:12:41 PDT
Comment on attachment 19879 [details]
Patch-fu!

r=me.  It'd be good if you could improve the grammar in the changelog entry (giant run-on sentences make me sad), and reference the bug URL in the layout test changelog too for easy reference.
Comment 4 Oliver Hunt 2008-03-18 23:18:13 PDT
	M	JavaScriptCore/ChangeLog
	M	JavaScriptCore/kjs/nodes2string.cpp
	M	LayoutTests/ChangeLog
	M	LayoutTests/fast/js/function-toString-parentheses-expected.txt
	M	LayoutTests/fast/js/resources/function-toString-parentheses.js
Committed r31148