generalize Reflect.parse to accept JS builder functions

RESOLVED FIXED

Status

()

Core
JavaScript Engine
RESOLVED FIXED
7 years ago
7 years ago

People

(Reporter: dherman, Assigned: dherman)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 attachment, 3 obsolete attachments)

(Assignee)

Description

7 years ago
Generalize the Reflect.parse API to accept an optional JS builder function, a la:

    Reflect.parse(src, builder)

where builder is an object with callbacks the serializer calls on every sub-node to generate the result.

Dave
(Assignee)

Comment 1

7 years ago
Created attachment 476438 [details] [diff] [review]
builder parameter

Implementation attached. Next I'll document the API.

Dave
(Assignee)

Updated

7 years ago
Depends on: 594060
(Assignee)

Comment 2

7 years ago
BTW, this patch builds off of the patch for 594060. The builder argument is provided as an optional 'builder' property of the configuration object.

Dave
(Assignee)

Comment 3

7 years ago
Created attachment 481835 [details] [diff] [review]
updated based on changes in bug 594060

Updated based on recent changes in bug 594060.

Dave
Attachment #476438 - Attachment is obsolete: true
(Assignee)

Comment 4

7 years ago
Created attachment 500297 [details] [diff] [review]
refreshed stale patch
Attachment #481835 - Attachment is obsolete: true
(Assignee)

Comment 5

7 years ago
Created attachment 500409 [details] [diff] [review]
minor bugfix
Attachment #500297 - Attachment is obsolete: true
(Assignee)

Comment 6

7 years ago
The docs now pretty exhaustively detail the API for the optional builder object:

    https://developer.mozilla.org/en/SpiderMonkey/Parser_API

The docs have gotten pretty big, so they probably want to be split out into multiple pages. But MDC is such hell to edit I'm not sure I'm quite up to the task at the moment. At any rate, I think this is ready for review now.

Dave
(Assignee)

Updated

7 years ago
Attachment #500409 - Flags: review?(gal)

Comment 7

7 years ago
Comment on attachment 500409 [details] [diff] [review]
minor bugfix

>From: Dave Herman <dherman@mozilla.com>
>
>bug 569487, r=?: Reflect.parse(): custom builder object
>
>diff --git a/js/src/jsast.tbl b/js/src/jsast.tbl
>--- a/js/src/jsast.tbl
>+++ b/js/src/jsast.tbl
>@@ -34,85 +34,86 @@
>  * and other provisions required by the GPL or the LGPL. If you do not delete
>  * the provisions above, a recipient may use your version of this file under
>  * the terms of any one of the MPL, the GPL or the LGPL.
>  *
>+            for (uintN i = 0; i < AST_LIMIT; i++) {
>+                callbacks[i].setNull();
>+            }

No {} I think.

Looks good. NPOTB so just land it.
Attachment #500409 - Flags: review?(gal) → review+
(Assignee)

Comment 8

7 years ago
http://hg.mozilla.org/tracemonkey/rev/351e87c78237
Whiteboard: fixed-in-tracemonkey
(Assignee)

Comment 9

7 years ago
Burned the tree; backed out:

http://hg.mozilla.org/tracemonkey/rev/83f778ef2a77
Whiteboard: fixed-in-tracemonkey
(Assignee)

Comment 10

7 years ago
http://hg.mozilla.org/tracemonkey/rev/1155e7cf1914
Whiteboard: fixed-in-tracemonkey
http://hg.mozilla.org/mozilla-central/rev/1155e7cf1914
Status: NEW → RESOLVED
Last Resolved: 7 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.