[ALOY-1003] ListView binding compile error when "type" is used as a bindId
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-05-28T14:54:34.000+0000 |
Affected Version/s | n/a |
Fix Version/s | Alloy 1.5.0 |
Components | Styling |
Labels | n/a |
Reporter | Paul Mietz Egli |
Assignee | Feon Sua Xin Miao |
Created | 2014-05-01T18:29:18.000+0000 |
Updated | 2014-09-15T09:32:26.000+0000 |
Description
I was running into the following compiler error when building my project with 1.4.0-dev:
[DEBUG] [ERROR] : Object #<Object> has no method 'indexOf'
[DEBUG] [ERROR] Alloy compiler failed
I eventually traced this down to the use of the string "type" as my bindId in my ListItem template. The parse() method in default.js adds a property named "type" to view templates, which appears to be overwritten by my bindId value of "type", which causes processStyle() in styler.js to fail at line 359. I changed "type" to "__type" in both default.js and styler.js, which appears to have fixed the issue.
Test case attached with commented-out working code in index.xml
Attachments
File | Date | Size |
---|---|---|
TestListApp.zip | 2014-05-17T13:01:45.000+0000 | 6005784 |