Yate Community Forum

Yate server => Yate bugs => Topic started by: ximik777 on February 06, 2013, 07:15:12 AM

Title: Javascript bugs
Post by: ximik777 on February 06, 2013, 07:15:12 AM
Hello I found several errors in the javascript.
Yete 4.2.0

var a = '700'; var b = '702';
    var c = [a, b];
    Engine.print_r(c);
    //log
    'c' = '[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)
    'length' = '2' (NamedString)
    '0' = '' (ExpOperation)
    '1' = '' (ExpOperation)

or

function test(a)
{
   Engine.print_r(a);
}

test([message.caller, message.called]);

working only

var a = [];
a.push(message.caller);
a.push(message.called);


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=--==-=-

not working "else if(...)"
<JsCode:WARN> Evaluator error: Expecting operand in line "line" at: }

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-==-=-=

not working function "join"

var a = ['a','b','c'];
a.join();
result 'a,b,c'; good!

a.join(' + ');
result 'abc' not good =(


Title: Re: Javascript bugs
Post by: andrei on February 13, 2013, 06:05:49 AM
Hi ximik777,

First bug is solved in revision: 5404
Second bug is solved in revision: 5391
The third bug is solved in revision: 5380.

Thanks for pointing out this bugs,

Regards,
Andrei.