Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000347 [Yate - Yet Another Telephony Engine] module major always 2013-06-27 10:36 2013-07-11 16:40
Reporter folarte View Status public  
Assigned To
Priority normal Resolution fixed  
Status resolved   Product Version SVN
Summary 0000347: Length is not updated in javascript arrays
Description When assigning to an array via subscripting, length is not properly updated. When pushing it is.

The example code uses Engine.print_r for dumps, but similar results are accesed when directly accessing a.length and printing it.

Expected values for length would be 3 ( auto filled intermediate values ), 2, 1, actual values are 0 ( inherited ), 0 ( inherited from __proto__ ), 1 .


The following code:

a = new Array();
a[2]=2;
Engine.print_r(a);
a = new Array();
a[0]=0;
a[1]=1;
Engine.print_r(a);
a = new Array();
a.push(0);
Engine.print_r(a);

Gives this result:

'a' = '[object Array]' (JsArray)
  '__proto__' = '[object Array]' (JsArray)
    'freeze' = '[function freeze()]' (ExpFunction)
    'isFrozen' = '[function isFrozen()]' (ExpFunction)
    'toString' = '[function toString()]' (ExpFunction)
    'hasOwnProperty' = '[function hasOwnProperty()]' (ExpFunction)
    'push' = '[function push()]' (ExpFunction)
    'pop' = '[function pop()]' (ExpFunction)
    'concat' = '[function concat()]' (ExpFunction)
    'join' = '[function join()]' (ExpFunction)
    'reverse' = '[function reverse()]' (ExpFunction)
    'shift' = '[function shift()]' (ExpFunction)
    'unshift' = '[function unshift()]' (ExpFunction)
    'slice' = '[function slice()]' (ExpFunction)
    'splice' = '[function splice()]' (ExpFunction)
    'sort' = '[function sort()]' (ExpFunction)
    'indexOf' = '[function indexOf()]' (ExpFunction)
    'length' = '0' (NamedString)
  '2' = '2' (ExpOperation)



'a' = '[object Array]' (JsArray)
  '__proto__' = '[object Array]' (JsArray)
    'freeze' = '[function freeze()]' (ExpFunction)
    'isFrozen' = '[function isFrozen()]' (ExpFunction)
    'toString' = '[function toString()]' (ExpFunction)
    'hasOwnProperty' = '[function hasOwnProperty()]' (ExpFunction)
    'push' = '[function push()]' (ExpFunction)
    'pop' = '[function pop()]' (ExpFunction)
    'concat' = '[function concat()]' (ExpFunction)
    'join' = '[function join()]' (ExpFunction)
    'reverse' = '[function reverse()]' (ExpFunction)
    'shift' = '[function shift()]' (ExpFunction)
    'unshift' = '[function unshift()]' (ExpFunction)
    'slice' = '[function slice()]' (ExpFunction)
    'splice' = '[function splice()]' (ExpFunction)
    'sort' = '[function sort()]' (ExpFunction)
    'indexOf' = '[function indexOf()]' (ExpFunction)
    'length' = '0' (NamedString)
  '0' = '0' (ExpOperation)
  '1' = '1' (ExpOperation)
'a' = '[object Array]' (JsArray)
  '__proto__' = '[object Array]' (JsArray)
    'freeze' = '[function freeze()]' (ExpFunction)
    'isFrozen' = '[function isFrozen()]' (ExpFunction)
    'toString' = '[function toString()]' (ExpFunction)
    'hasOwnProperty' = '[function hasOwnProperty()]' (ExpFunction)
    'push' = '[function push()]' (ExpFunction)
    'pop' = '[function pop()]' (ExpFunction)
    'concat' = '[function concat()]' (ExpFunction)
    'join' = '[function join()]' (ExpFunction)
    'reverse' = '[function reverse()]' (ExpFunction)
    'shift' = '[function shift()]' (ExpFunction)
    'unshift' = '[function unshift()]' (ExpFunction)
    'slice' = '[function slice()]' (ExpFunction)
    'splice' = '[function splice()]' (ExpFunction)
    'sort' = '[function sort()]' (ExpFunction)
    'indexOf' = '[function indexOf()]' (ExpFunction)
    'length' = '0' (NamedString)
  '0' = '0' (ExpOperation)
  'length' = '1' (NamedString)
Additional Information
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0000535)
oana (developer)
2013-07-11 16:40

Fixed in SVN rev. 5580 (2013-07-11).

- Issue History
Date Modified Username Field Change
2013-06-27 10:36 folarte New Issue
2013-07-11 12:12 paulc Status new => acknowledged
2013-07-11 16:40 oana Note Added: 0000535
2013-07-11 16:40 oana Status acknowledged => resolved
2013-07-11 16:40 oana Resolution open => fixed


Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker