#1 2014-08-17 06:18:44

win2014
Member
Registered: 2014-06-10
Posts: 31

Just found a litter bug in SynSM

I call procedure TSMObject.DefineProperty(const name: SynUnicode; const value: variant) like this:
smObj.DefineProperty('propName', 'propValue');
Then it raise 'Unhandled variant type 21' - ESMException.
I read the source clearly and found the kernal rutine

procedure TSMObject.DefineProperty(const name: SynUnicode;
  const value: variant; attrs: TJSPropertyAttrs);
begin
  DefineProperty(name,VariantToJsVal(cx,value),attrs);
end;

See that? VariantToJsVal cast the value into correct jsval, but it return a jsval type, and no proper DefineProperty() accept this param..so it call itself again..
Try to patch this, I wrote codes instead:

DefineProperty(name,TSMValue(VariantToJsVal(cx,value)),attrs);

Exception has no raise again.

I love the beautiful SynSM, thanks mpv's times.
Regard.

Offline

#2 2014-08-17 07:29:46

ab
Administrator
From: France
Registered: 2010-06-21
Posts: 14,207
Website

Re: Just found a litter bug in SynSM

Should be fixed by http://synopse.info/fossil/info/ab0acc6 … 38a0705b19

Thanks for the fix and feedback!
You are now part of the credits. wink

Offline

Board footer

Powered by FluxBB