[AC-5320] iOS - functions declared in alloy.js are not globally visible
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | n/a |
Status | Closed |
Resolution | Not Our Bug |
Resolution Date | 2017-11-07T05:23:48.000+0000 |
Affected Version/s | Appcelerator Studio 4.3.0 |
Fix Version/s | n/a |
Components | Titanium SDK & CLI |
Labels | ios, regression |
Reporter | Andrea Vitale |
Assignee | Shak Hossain |
Created | 2017-10-29T11:00:17.000+0000 |
Updated | 2017-11-07T05:23:48.000+0000 |
Description
Declare a function in _alloy.js_
function test() {
Ti.API.info("Hello!");
}
and try to invoke it in _index.js_ an you will see:
[ERROR] ReferenceError: Can't find variable: test
[ERROR] File: app.js
[ERROR] Line: 31
[ERROR] SourceId: <null>
[ERROR] Backtrace:
[ERROR] undefined
on Android is working as well.
Hello, I can't reproduce the issue in iOS simulator 11.0, I define your function in alloy.js and call the function in index.xml in a button click event. The event fires fine for simulator build. Can you share a full code for this?
[~Andrea.Vitale], Can you please test the sample code from [here](https://gist.github.com/rakhimoni/e15cc150f82dbf0d5d5ff7ddd31b40a8) on your end and let us know how it goes. Thanks
Hello [~Andrea.Vitale], Did you manage to test sample code provided earlier? Best
Hi @Mostafizur, I tested your code and is working as well. Also my sample code that I tested before to open this issue now is working maybe due to the CLI that was outdated. Really don't know but is working. You can close this issue, thanks!