| Summary: | AST Nodes should keep track of their end offset | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Saam Barati <saam> | ||||||||
| Component: | JavaScriptCore | Assignee: | Saam Barati <saam> | ||||||||
| Status: | RESOLVED FIXED | ||||||||||
| Severity: | Normal | CC: | buildbot, fpizlo, ggaren, rniwa | ||||||||
| Priority: | P2 | ||||||||||
| Version: | 528+ (Nightly build) | ||||||||||
| Hardware: | Unspecified | ||||||||||
| OS: | Unspecified | ||||||||||
| Attachments: |
|
||||||||||
|
Description
Saam Barati
2014-10-28 12:08:39 PDT
Created attachment 240566 [details]
patch
Here is a patch that records the end offsets for all AST nodes.
It's a bit awkward that the endOffset property on Node is just an int. To be symmetric with node's position property, it should be a JSTextPosition.
But because we don't need the other two fields on JSTextPosition, making it an int is more efficient.
Created attachment 240656 [details]
patch
Comment on attachment 240656 [details]
patch
LGTM!
Created attachment 240705 [details]
patch
This fixes a few problems with the previous patch:
1. parseStatement should handle the case when result is null.
2. The FunctionBody and PropertyNode nodes weren't being assigned an endOffset.
landed in: http://trac.webkit.org/changeset/175396 |