Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1708] Alloy: Compile fails if object property contains variable

GitHub Issuen/a
TypeBug
PriorityNone
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
LabelsengTriage
ReporterHans Knöchel
AssigneeUnknown
Created2019-10-31T21:48:10.000+0000
Updated2020-01-07T22:45:25.000+0000

Description

The following fails on Alloy 1.14.1: alloy.js
Alloy.Globals.test = 'Helvetica';
index.xml
<Alloy>
    <Label text="Bayern Ticket" font.fontFamily="Alloy.Globals.test" />
</Alloy>
Error:
[ERROR] Error parsing code in app/widgets/mywidget/controllers/widget.js. Unexpected token, expected "," (69:68)
[ERROR]   67 | $.__views.__alloyId173.add($.__views.__alloyId174);
[ERROR]   68 | $.__views.__alloyId175 = Ti.UI.createLabel(
[ERROR] > 69 | {color:Alloy.CFG.styles.textColor,font:{fontSize:16,fontFamily:Alloy:CFG.fonts.sourceSansPro.bold,},text:"Hello World",id:"__alloyId175",}
[ERROR]      |                                                                    ^
[ERROR]   70 | );
[ERROR]   71 | $.__views.__alloyId174.add($.__views.__alloyId175);
[ERROR]   72 | $.__views.__alloyId176 = Ti.UI.createView(
[ERROR] Alloy compiler failed

Comments

  1. Brenton House 2020-01-07

    [~hknoechel] - are you still seeing this?
  2. Hans Knöchel 2020-01-07

    Haven't tried out since then. Was there an Alloy fix for this? You should probably try it out
  3. Brenton House 2020-01-07

    I tried it with Alloy 1.14.5 and couldn't recreate. I just wanted to make sure you were good.

JSON Source