Closed Bug 569487 Opened 14 years ago Closed 14 years ago

generalize Reflect.parse to accept JS builder functions

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dherman, Assigned: dherman)

References

Details

(Whiteboard: fixed-in-tracemonkey)

Attachments

(1 file, 3 obsolete files)

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
Attached patch builder parameter (obsolete) — Splinter Review
Implementation attached. Next I'll document the API.

Dave
Depends on: 594060
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
Updated based on recent changes in bug 594060.

Dave
Attachment #476438 - Attachment is obsolete: true
Attached patch refreshed stale patch (obsolete) — Splinter Review
Attachment #481835 - Attachment is obsolete: true
Attached patch minor bugfixSplinter Review
Attachment #500297 - Attachment is obsolete: true
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
Attachment #500409 - Flags: review?(gal)
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+
http://hg.mozilla.org/tracemonkey/rev/351e87c78237
Whiteboard: fixed-in-tracemonkey
Burned the tree; backed out:

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

Attachment

General

Created:
Updated:
Size: