Description
When an error is thrown using the 3.5.0 SDK the following is printed out in the console
[ERROR] : Script Error {
[ERROR] : column = 11;
[ERROR] : line = 8;
[ERROR] : sourceURL = "file:///private/var/mobile/Containers/Bundle/Application/8E9433FD-3F80-4060-8BBB-2C1C249744CB/TIMOB-10501.app/app.js";
[ERROR] : stack = "global code@file:///private/var/mobile/Containers/Bundle/Application/8E9433FD-3F80-4060-8BBB-2C1C249744CB/TIMOB-10501.app/app.js:8:11";
[ERROR] : }
In the error logs in the console there should be a message telling the user where the error is as shown when using 3.4.1.GA SDK
[ERROR] : Script Error {
[ERROR] : backtrace = "#0 () at :0";
[ERROR] : line = 8;
[ERROR] : message = "'undefined' is not a function (evaluating 'win.foobar()')";
[ERROR] : name = TypeError;
[ERROR] : sourceId = 48024064;
[ERROR] : sourceURL = "file:///private/var/mobile/Containers/Bundle/Application/E979FC89-452D-43B9-85F5-32FE7920445B/TIMOB-10501.app/app.js";
[ERROR] : }
This *is a regression* as context is given in 3.4.1.GA
On the device there are also differences, see the attached images for examples of these.
Steps To Reproduce
1. Add the code below to an exisiting project and run the project on a device or sim
Titanium.UI.setBackgroundColor('#000');
var win = Titanium.UI.createWindow({
title: 'test'
});
var obj = require('module')();
win.foobar();
win.open();
Actual Result
The app will crash and will only show a reference to the line numbers rather than providing context
Expected Result
The app will crash and should provide context, e.g. it should say "message = "'undefined' is not a function (evaluating 'e.foobar()')";"
[~jalter] [~pec1985] [~mlangston] [~vduggal] FYI
Pull pending https://github.com/appcelerator/tijscore/pull/19
Verified fix on: Mac OSX 10.10.1 Appcelerator Studio, build: 3.4.1.201410281743 Titanium SDK build: 3.5.0.v20141208122514 Titanium CLI, build: 3.4.1 Alloy: 1.5.1 Xcode 6.1.1 iPhone 6 Plus (8.1), iPhone 6 Simulator (8.1), iPhone 5s (7.1.1)
Using the code above, built to device and sim. Each time the application included the correct information was included in the application error screen and the console log (see example log below).
The following was what was tried: * Require ti.cloud and not add it to tiapp.xml * Undefined function (view.foobar) * Undefined variable (var x = y) Closing ticket.
Reopening to add affects version