[FEATURE REQUEST] Improvements for the TJSObject constructor
Original Reporter info from Mantis: silvioprog
-
Reporter name: silvioprog
Original Reporter info from Mantis: silvioprog
- Reporter name: silvioprog
Description:
Hi.
It would be nice to pass key-value arguments into an Object constructor. It is allowed in JSON libraries in many programming languages. Consider the following code in pure JavaScript:
asm var obj = {"color":"red","status":2,"passed":{"result":false}}; console.log(obj); end;
it will print:
{color: "red", status: 2, passed: {result: false}}
so, what do you think about improved the TJSObject constructor allowing the following?:
var obj: TJSObject; begin obj := TJSObject.new('color', 'red',"status":2,"passed":TJSObject.new('result', false)); console.log(obj); end.
The fpjson.TJSONObject constructor already allows it, but the JS.TJSObject should allow it too.
Mantis conversion info:
- Mantis ID: 34731