Start a new topic
Solved

JSON Class Bugfix

The DuoCode.Dom.JSON class functions are not marked as static but they are.


If someone has the same problem here is a quick fix :


Create a file anywhere in your project and add this :

 

using DuoCode.Runtime;
using System;

namespace DuoCode.Dom
{
    [Js(Extern = true, Name = "JSON")]
    public class JSON : Object
    {
        public extern JSON();

        public static extern dynamic parse(string text, Func<dynamic, dynamic, dynamic> reviver = null);
        public static extern string stringify(dynamic value);
        public static extern string stringify(dynamic value, Func<string, dynamic, dynamic> replacer);
        public static extern string stringify(dynamic value, Func<string, dynamic, dynamic> replacer, dynamic space);
    }
}

 This is just a copy from the metadata with additional "static" and "extern" modifier.

1 Comment

Lol, i'm so stupid.


Use DuoCode.Dom.Global.JSON

Login or Signup to post a comment