/// <summary>
/// Retrieves the string pointer of a <c>String</c> value.
/// </summary>
/// <remarks>
/// <para>
/// This function retrieves the string pointer of a <c>String</c> value. It will fail with
/// <c>InvalidArgument</c> if the type of the value is not <c>String</c>.
/// </para>
/// <para>
/// Requires an active script context.
/// </para>
/// </remarks>
/// <returns>The string.</returns>
public new string ToString()
{
IntPtr buffer;
UIntPtr length;
Native.ThrowIfError(Native.JsStringToPointer(this, out buffer, out length));
return(Marshal.PtrToStringAuto(buffer, (int)length));
}