IMHO, the TJSJSON external class definition is incorrect.
Currently, we have class function, if you want to use the stringify method,
use this wierd way: TJSJSON.stringify( jsObject);
I think code that don't have mutual dependencies should be separate in
units:
unit ECMA.Json;interface{$mode objfpc}{$modeswitch externalclass}type 
TKeyValueProcessor = function (Key: String; Value: JSValue): JSValue;  
JJSON = class external name 'JSON'  public    function parse(Text: String):
JSValue; overload;    function parse(Text: String; Reviver:
TKeyValueProcessor): JSValue; overload;    function stringify(const Value:
JSValue): String; overload;    function stringify(const Value: JSValue;
Replacer: TKeyValueProcessor): String; overload;    function stringify(const
Value: JSValue; Replacer: TKeyValueProcessor; Space: String): String;
overload;  end;var  JSON: JJSON; external name 'JSON';implementationend.
and use like this: JSON.stringify( JsonObject );




--
Sent from: http://free-pascal-general.1045716.n5.nabble.com/
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to