flex-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Harbs <harbs.li...@gmail.com>
Subject FlexJS Issue with multiple assignment
Date Sat, 26 Aug 2017 18:41:58 GMT
I just ran into the following issue:

I have some code which looks like this:
ID = _rawStoryXML.@Self = UIDUtil.createUID();

It gets cross-compiled in JS to this:
this.ID = org.apache.flex.utils.Language.string(this._rawStoryXML.setAttribute('Self', org.apache.flex.utils.UIDUtil.createUID()));

The problem is that both ID and _rawStoryXML.@Self should both be assigned the result of UIDUtil.createUID().

Instead, ID is being assigned the result of this._rawStoryXML.setAttribute('Self', org.apache.flex.utils.UIDUtil.createUID())
which happens to be null.

I’m not sure how to fix this issue. Maybe it’s necessary to assign a temporary variable
and then assign both values separately:

var tempVal = org.apache.flex.utils.UIDUtil.createUID();
this._rawStoryXML.setAttribute('Self', tempVal);
this.ID = tempVal;

(or something like that)

View raw message