[AC-6421] iOS: transpilation produces incorrect output to device
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Open |
Resolution | Unresolved |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | ios |
Reporter | Sergey Volkov |
Assignee | Shak Hossain |
Created | 2019-10-28T15:17:00.000+0000 |
Updated | 2019-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".
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
Thanks.
Seeing as this is a device only thing, it's probably down to the minification side of things
Hi. Device only.