/// <summary> /// Makes a mapping of value from the script type to a host type /// </summary> /// <param name="value">The source value</param> /// <returns>The mapped value</returns> private object MapToHostType(OriginalValue value) { switch (value.Type) { case OriginalTypes.Undefined: return(Undefined.Value); case OriginalTypes.Object: var objInstance = value.As <OriginalObjectInstance>(); if (objInstance != null && !_primitiveClassNames.Contains(objInstance.Class)) { return(objInstance); } else { break; } } return(value.ToObject()); }