Titanium JIRA Archive
Appcelerator Community (AC)

[AC-6421] iOS: transpilation produces incorrect output to device

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsios
ReporterSergey Volkov
AssigneeShak Hossain
Created2019-10-28T15:17:00.000+0000
Updated2019-11-05T08:26:19.000+0000

Description

Steps: 1. Create test app
ti create --type app --id test.transpil --name test.transpil -p all -u 'example.com' -d .
2. Add this snippet into app.js
(function() {
    let a = {b: [1,2,3]};
    let r = 0;
    let test = function test() {
        if (!a) {
            return;
        }
        const b = a.b;
        for (let i = 0, l = b.length; i < l; i++) {
            r += b[i];
        }
    };
    test();
    console.log(r);
})();
3. Build the app for device:
ti build -p ios -T device
4. Verify "0" in application output in console 5. Verify transpiled code in "build/iphone/assets/app_js":
function(){var
a={b:[1,2,3]},
r=0,
test=function test(){
if(1)



for(var b=a.b,i=0,l=b.length;void 0>i;i++)
r+=b[i];

};
test(),
console.log(r);
}();
Problem is here: "void 0>i". Correct application output is: "6".

Comments

  1. Sharif AbuDarda 2019-11-03

    Hello [~s.volkov], The issue is only in the device? I wasn't able to reproduce the issue in the simulator. I got the below log
       [INFO]  test.transpil 1.0 (Powered by Titanium 8.2.0.6bfdf6e394)
       [INFO]  6
       [DEBUG] Firing app event: started
       
    Thanks.
  2. Ewan Harris 2019-11-04

    Seeing as this is a device only thing, it's probably down to the minification side of things
  3. Sergey Volkov 2019-11-05

    Hi. Device only.

JSON Source