using custom options in jquery UI dialog

using custom options in jquery UI dialog

I've noticed what I'd call a bug when using custom properties in the jquery UI dialog plugin:

If I do something like

  1. $(function() {
  2.       $('#dialog').dialog({test: 'OK'});
  3.       alert($('#dialog').dialog('option','test');
  4. });
all works fine and I get an alert with "OK" written in it. However if I do something like

  1. $(function() {
  2.       $('#dialog').dialog({test: 'OK'});
  3.       alert($('#dialog').dialog('option','non_existent');
  4. });
the alert contains "[object Object]", and upon further tests it seems that searching for a non existen option simply returns the whole object, which in my opinion is quite wrong, it should return something like null or undefined.

Am I doing something wrong or there is really a problem here?