3 ms·
Deserialized JSON in JavaScript is not necessarily in its most useful form: the objects produced have no useful prototype. Dart already has the equivalent to th
by spankalee 12y ago
Deserialized JSON in JavaScript is not necessarily in its most useful form: the objects produced have no useful prototype. Dart already has the equivalent to that with its built-in JSON codec - it deals in Maps and Lists.
What the OP is asking for is for deserialization to produce instances of different classes. No matter that it's not possible to map generic JSON structures to classes and objects for anything other than trivial cases (polymorphism, interfaces, heterogenous collections and non-tree structures won't work), JavaScript doesn't produce objects with interesting prototype chains when deserializing JSON, so you'd still have to copy bit around if that's what you want.