Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2072] Ti.UI.convertUnits returns NaN

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionInvalid
Resolution Date2013-04-03T22:39:40.000+0000
Affected Version/sn/a
Fix Version/sn/a
Componentsn/a
Labelsn/a
ReporterStanislav Fedorenko
AssigneeMauro Parra-Miranda
Created2012-11-06T17:39:33.000+0000
Updated2016-03-08T07:41:02.000+0000

Description

Anvil test fails on suite: ui_layout test: convertUnits with message: convertUnits - 67ms - error - Message: should be: '0', was: 'NaN' Fix: in file titanium\Ti\UI.js in function convertUnits change 1st line to: // even if result is NaN - convert it to 0; var intermediary = +(dom.computeSize(convertFromValue, 0, false)) || 0;

Comments

  1. Daniel Sefton 2012-11-27

    Please can you provide some more information about this? What's "Anvil test"? Please could you provide a reproducible test case? Thanks!
  2. Stanislav Fedorenko 2013-01-08

    This was found in test form suites\ui_layout.js : On MobileWeb: {quote} {noformat} // Functional Test #1087-#1097 this.convertUnits = function(testRun) { //...... skipped ...... // #1097 valueOf(testRun, Math.round(Ti.UI.convertUnits('abc', Ti.UI.UNIT_PX))).shouldBe(0); } {noformat} {quote} According to this test code: Ti.UI.convertUnits('abc', Ti.UI.UNIT_PX) should not return NaN. It must return 0.
  3. Pedro Enrique 2013-04-03

    This function is to convert units such as pixels or dips. "abc" is not a number, it's a string.
  4. Mauro Parra-Miranda 2013-11-24

    Invalid issue.

JSON Source