Closed Bug 710225 Opened 13 years ago Closed 13 years ago

Label nodes produce negative lengths

Categories

(Rhino Graveyard :: Core, defect)

head
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: egarcia, Unassigned)

Details

Attachments

(1 file)

58 bytes, application/octet-stream
Details
Attached file test.js
User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_6_8) AppleWebKit/535.2 (KHTML, like Gecko) Chrome/15.0.874.121 Safari/535.2

Steps to reproduce:

Rhino generates negative lengths for some AST nodes when using labels in some cases, like the simple attached test.


Actual results:

The LabeledStatement that contains the while for the second function has a length of -10. If you remove the first empty function, the length is positive again, but as far as I know, also incorrect (because length for the inside While node is greater)
I made a fix and created a pull request here: https://github.com/mozilla/rhino/pull/26
Thanks, fixed in master and rhino_1_8 branches:

https://github.com/mozilla/rhino/commit/a518c4e1128a5dac63dc110d8ce5e7619694a015
Status: UNCONFIRMED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: