Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-6776] iOS: Add line number to the error when a width or height in auto ends being 0

GitHub Issuen/a
TypeNew Feature
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2011-12-22T11:36:36.000+0000
Affected Version/sRelease 1.7.5, Release 1.8.0.1
Fix Version/sn/a
ComponentsiOS
Labelsn/a
ReporterMauro Parra-Miranda
AssigneeDon Thorp
Created2011-12-19T17:29:06.000+0000
Updated2017-03-29T16:21:36.000+0000

Description

PROBLEM DESCRIPTION

When a view has a height or width that is 'auto' and it ends up being 0 there is an error in the console. If possible we would like this error to also show the line number of the view in question.

STEPS TO REPRODUCE

1. Create new mobile project 2. Add the code to app.js 3. Run

ACTUAL RESULTS

[WARN] [object TiUIView] has an auto width value of 0, meaning this view may not be visible.

EXPECTED RESULTS

The same message, with the file and number of line of this happening. [WARN] [object TiUIView @ app.js:3] has an auto width value of 0, meaning this view may not be visible.
var win=Ti.UI.createWindow({
	background:'white',
});
var view=Ti.UI.createView({
	width:0,
	height:0,
	background:'white',
});
var view2 = Ti.UI.createView({
	width:'auto',
	height:'auto',
});
view.add(view2);
win.add(view);
win.open();

Comments

  1. Stephen Tramer 2011-12-19

    Resolving this issue requires new code to interact with JSCore to get information about the current line of execution. Doing this outside of the debugger hooks may not even be possible. This has to be postponed until the 1.9 timeframe as a feature, not a bug.
  2. Stephen Tramer 2011-12-22

    JSCore definitely doesn't give iOS hooks to be able to do this without throwing exceptions, and Android reports the same. For internal messages like this we cannot report a line number, especially since autosizing may not even take place as part of serialized JS execution due to the threading environment.
  3. Lee Morris 2017-03-29

    Closing ticket as "Won't Fix".

JSON Source