[TIMOB-25453] iOS: console.error.bind is not a function
| GitHub Issue | n/a |
|---|---|
| Type | Bug |
| Priority | Medium |
| Status | Open |
| Resolution | Unresolved |
| Affected Version/s | Release 6.3.0 |
| Fix Version/s | n/a |
| Components | iOS |
| Labels | n/a |
| Reporter | Jan Vennemann |
| Assignee | Unknown |
| Created | 2017-10-29T13:41:22.000+0000 |
| Updated | 2020-01-08T20:35:19.000+0000 |
Description
*Steps to reproduce the behavior*
1. Create a new app and insert the following code snippet at the end of
app/controllers/index.js:
console.error.bind(null, 'test').apply();
2. Run the app
*Actual behavior*
The following script error occurs:
[ERROR] Script Error {
[ERROR] column = 19;
[ERROR] line = 19;
[ERROR] message = "console.error.bind is not a function. (In 'console.error.bind(null, 'test')', 'console.error.bind' is undefined)";
[ERROR] sourceURL = "file:///Users/jvennemann/Library/Developer/CoreSimulator/Devices/AFB48D22-ADB6-4629-BAC5-EE208FE2B712/data/Containers/Bundle/Application/19A373DC-4ECA-4C59-9C04-541FC78877BC/googlevr.app/app.js";
[ERROR] }
*Expected behavior*
The word test is printed to the error log and no script error appears.
*Additional notes*
This only happens on iOS. Android seems be fine with binding console.error.
cc [~hknoechel] This does not seem to work for anything we expose on the iOS runtime. The following example also fails on iOS, whereas on Android it runs fine:
*Actual behavior* Script error is thrown:var win = Ti.UI.createWindow({ backgroundColor: '#fff' }); var btn = Ti.UI.createButton({ title: 'Test' }); win.add.bind(win, btn).apply(); win.open();*Expected behavior* Button gets added to the window and the app does not crash.[ERROR] Script Error { [ERROR] column = 13; [ERROR] line = 16; [ERROR] message = "win.add.bind is not a function. (In 'win.add.bind(win, btn)', 'win.add.bind' is undefined)"; [ERROR] sourceURL = "file:///Users/jvennemann/Library/Developer/CoreSimulator/Devices/AFB48D22-ADB6-4629-BAC5-EE208FE2B712/data/Containers/Bundle/Application/3085F028-B155-40D6-8841-08C9303788FF/googlevr.app/app.js"; [ERROR] }