Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000354 [Yate - Yet Another Telephony Engine] module major always 2013-08-06 13:50 2013-08-06 13:50
Reporter folarte View Status public  
Assigned To
Priority normal Resolution open  
Status new   Product Version SVN
Summary 0000354: Object initializers destroy global variables.
Description When writing an object initializer with an empty string as a key global variables ( both mine and built in as Message ) get destroyed.

Test script:
Engine.output("Start");
var s = "123";
t = "456";
Engine.print_r(s);
Engine.print_r(t);
Engine.print_r(Message);
x={};
Engine.print_r(s);
Engine.print_r(t);
Engine.print_r(Message);
y={'':false};
Engine.print_r(s);
Engine.print_r(t);
Engine.print_r(Message);
Engine.output("End");

Log output:
20130806103649.671816 <javascript:CONF> Installing java billing simulator handlers.
Start
's' = '123' (ExpOperation)
't' = '456' (ExpOperation)
'Message' = '[function Message()]' (ExpOperation)
's' = '123' (ExpOperation)
't' = '456' (ExpOperation)
'Message' = '[function Message()]' (ExpOperation)
's' = '' (Undefined)
't' = '' (Undefined)
'Message' = '' (Undefined)
End

As can be seen both variables, with and without var in the declaration, and the built in Message prototype get destroyed by the creation of the y object. Have tested with more variations ( using var in object creation, different values, comments inside initializer ) and it seems it is always the empty key which destroys the global vars.
Additional Information
Tags No tags attached.
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2013-08-06 13:50 folarte New Issue


Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker