Quite obvisouly, this code is wrong, somehow mixing the arrays of different instances of the same thing.
As far as I can see, the problem is not JS-specific (though I haven't tested for other compilers) and probably is somewhere in the inglorious ConfigurationHelper.initExpressionsForInstanceArrays helper method.
Consider the following spec:
It generates the following erroneous JS code:
Quite obvisouly, this code is wrong, somehow mixing the arrays of different instances of the same thing.
As far as I can see, the problem is not JS-specific (though I haven't tested for other compilers) and probably is somewhere in the inglorious
ConfigurationHelper.initExpressionsForInstanceArrays
helper method.