replace internal use of error() by new throw()
internal.ToNumber declared local first