Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25453] iOS: console.error.bind is not a function

GitHub Issuen/a
TypeBug
PriorityMedium
StatusOpen
ResolutionUnresolved
Affected Version/sRelease 6.3.0
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterJan Vennemann
AssigneeUnknown
Created2017-10-29T13:41:22.000+0000
Updated2020-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.

Comments

  1. Jan Vennemann 2017-10-29

    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:
       var win = Ti.UI.createWindow({
         backgroundColor: '#fff'
       });
       
       var btn = Ti.UI.createButton({
         title: 'Test'
       });
       
       win.add.bind(win, btn).apply();
       win.open();
       
    *Actual behavior* Script error is thrown:
       [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] }
       
    *Expected behavior* Button gets added to the window and the app does not crash.

JSON Source