| Summary: | Debug js generator produce runtime error when there is label in EGL file | ||||||
|---|---|---|---|---|---|---|---|
| Product: | z_Archived | Reporter: | Huang Ji Yong <hjiyong> | ||||
| Component: | EDT | Assignee: | Justin Spadea <jspadea> | ||||
| Status: | CLOSED FIXED | QA Contact: | |||||
| Severity: | normal | ||||||
| Priority: | P3 | CC: | broy2, carrollk, svihovec | ||||
| Version: | unspecified | ||||||
| Target Milestone: | --- | ||||||
| Hardware: | PC | ||||||
| OS: | Windows 7 | ||||||
| Whiteboard: | |||||||
| Attachments: |
|
||||||
Hi Justin, This bug blocks the EUnit test case api/systemTypes/languageStatements.egl function whileTest() So I change the severity to major. Brenda or Kathy, Can you skip update the EUnit to skip this test case before this bug is resolved. Thanks. I spoke with Brian, and neither EXIT nor LABEL are supported in JSGen in RBD, so we decided to make this a 1.0 feature. I've updated the wiki to indicate it's not supported in 0.7. To support this in debug mode we need to be able to generate a label in the middle of generating the statement that follows the label. Please mark the testcase(s) as failed for now. Created attachment 214145 [details]
Fix label generation
See patch for fix. Labels are now stored for later generation, so that they are between the atline() and the conditional.
atline(); // for the label below
atline(); // for the FOR loop below
LABEL1:
for (...) {
}
[Verified in build]: 0.8.1.v201206271108 |
The test case f int = 5; function start() myInt int = 5; outerLoop: while(f != 0) if(myInt == 1) exit outerLoop; end for(myInt from 1 to 100 by 1) if(f == 5) exit for; end end end ; syslib.writeStdout("go here"); end The problem is in the generation of label and while statement outerLoop: while(f != 0) The development js generator generates the following js egl.atLine(this.eze$$fileName,13,236,10, this); EzeLabel_outerLoop: egl.atLine(this.eze$$fileName,13,247,235, this); while (((this.f != 0))) { The correct js should be egl.atLine(this.eze$$fileName,13,236,10, this); EzeLabel_outerLoop: while (((this.f != 0))) {