createStructfromJson method

HTStruct createStructfromJson(
  1. Map jsonData
)

Implementation

HTStruct createStructfromJson(Map<dynamic, dynamic> jsonData) {
  final HTStruct prototype = rootStruct ??
      globalNamespace.memberGet(_lexicon.globalPrototypeId,
          isRecursive: true);
  final struct =
      HTStruct(this, prototype: prototype, closure: currentNamespace);
  for (final key in jsonData.keys) {
    var value = toStructValue(jsonData[key]);
    struct.define(key.toString(), value);
  }
  return struct;
}