Bug 142853

Summary: Function.prototype.toString should not decompile the AST
Product: WebKit Reporter: Geoffrey Garen <ggaren>
Component: New BugsAssignee: Geoffrey Garen <ggaren>
Status: RESOLVED FIXED    
Severity: Normal CC: buildbot, ddkilzer, msaboff, rniwa
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch
none
Archive of layout-test-results from ews100 for mac-mavericks
none
Patch sam: review+

Description Geoffrey Garen 2015-03-18 17:41:31 PDT
Function.prototype.toString should not decompile the AST
Comment 1 Geoffrey Garen 2015-03-19 19:18:03 PDT
Created attachment 249077 [details]
Patch
Comment 2 Geoffrey Garen 2015-03-19 21:17:11 PDT
Created attachment 249081 [details]
Patch
Comment 3 Build Bot 2015-03-19 22:29:01 PDT
Comment on attachment 249081 [details]
Patch

Attachment 249081 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.appspot.com/results/5132974664187904

New failing tests:
userscripts/window-onerror-for-isolated-world-1.html
userscripts/window-onerror-for-isolated-world-2.html
Comment 4 Build Bot 2015-03-19 22:29:03 PDT
Created attachment 249086 [details]
Archive of layout-test-results from ews100 for mac-mavericks

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-mavericks  Platform: Mac OS X 10.9.5
Comment 5 Geoffrey Garen 2015-03-20 10:53:50 PDT
Created attachment 249121 [details]
Patch
Comment 6 Geoffrey Garen 2015-03-20 13:12:46 PDT
Committed r181810: <http://trac.webkit.org/changeset/181810>
Comment 7 Darin Adler 2015-03-20 14:13:46 PDT
Comment on attachment 249121 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=249121&action=review

> Source/JavaScriptCore/runtime/FunctionConstructor.cpp:102
> +        builder.append("(");

append('(')

> Source/JavaScriptCore/runtime/FunctionConstructor.cpp:105
> +            builder.append(", ");

appendLiteral(", ")
Comment 8 Joseph Pecoraro 2015-03-23 16:14:53 PDT
Comment on attachment 249121 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=249121&action=review

> LayoutTests/js/class-syntax-default-constructor-expected.txt:14
> -FAIL A.prototype.constructor should be function B() { super(...arguments); }. Was function A() { }.
> +FAIL A.prototype.constructor should be function () { super(...arguments); }. Was function () { }.

Looks like this was Failing before, and needed to be updated.

> LayoutTests/js/object-literal-computed-methods-expected.txt:11
> +FAIL o.foo.toString() should be function () { return 10; }. Was () { return 10; }.

These are regressions.

> LayoutTests/js/object-literal-methods-expected.txt:11
> +FAIL o.foo.toString() should be function foo() { return 10; }. Was () { return 10; }.

Ditto.
Comment 9 Joseph Pecoraro 2015-03-23 16:16:17 PDT
Comment on attachment 249121 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=249121&action=review

> LayoutTests/ChangeLog:43
> +        * js/object-literal-methods-expected.txt: These tests fail because object
> +        literal methods do not register their function names appropriately. This
> +        was a pre-existing failure that is now more explicit.

Oh!
Comment 10 Geoffrey Garen 2015-03-26 16:41:56 PDT
Committed r182043: <http://trac.webkit.org/changeset/182043>
Comment 11 Andreas Kling 2015-03-26 17:27:43 PDT
Comment on attachment 249121 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=249121&action=review

> Source/JavaScriptCore/ChangeLog:13
> +        (1) It requires us to keep pieces of the AST live forever. This is an
> +        awkward design and a waste of memory.

This patch does not fix that issue though, right?
Comment 12 Geoffrey Garen 2015-03-27 10:32:25 PDT
> > Source/JavaScriptCore/ChangeLog:13
> > +        (1) It requires us to keep pieces of the AST live forever. This is an
> > +        awkward design and a waste of memory.
> 
> This patch does not fix that issue though, right?

No. We need one more patch to change how we re-parse functions, and then we'll be able to remove the refcounted parts of the AST.
Comment 13 Michael Saboff 2015-03-30 18:48:35 PDT
This change fixed rdar://problem/18828133.