From c275254c45353aeadf6adf85858856d0c36d624f Mon Sep 17 00:00:00 2001 From: Dave Henderson Date: Sun, 16 Jun 2024 15:16:54 -0400 Subject: chore(api)!: Error instead of returning 0 on invalid inputs to conv.* functions (#2104) Signed-off-by: Dave Henderson --- docs-src/content/functions/conv.yml | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) (limited to 'docs-src') diff --git a/docs-src/content/functions/conv.yml b/docs-src/content/functions/conv.yml index f0073247..237af8e5 100644 --- a/docs-src/content/functions/conv.yml +++ b/docs-src/content/functions/conv.yml @@ -301,8 +301,9 @@ funcs: This function attempts to convert most types of input (strings, numbers, and booleans), but behaviour when the input can not be converted is - undefined and subject to change. Unconvertable inputs may result in - errors, or `0` or `-1`. + undefined and subject to change. + + Unconvertable inputs will result in errors. Floating-point numbers (with decimal points) are truncated. arguments: @@ -327,6 +328,8 @@ funcs: platforms, but is useful when input to another function must be provided as an `int`. + Unconvertable inputs will result in errors. + On 32-bit systems, given a number that is too large to fit in an `int`, the result is `-1`. This is done to protect against [CWE-190](https://cwe.mitre.org/data/definitions/190.html) and @@ -352,6 +355,8 @@ funcs: description: | Converts the inputs to an array of `int64`s. + Unconvertable inputs will result in errors. + This delegates to [`conv.ToInt64`](#conv-toint64) for each input argument. arguments: - name: in... @@ -366,6 +371,8 @@ funcs: description: | Converts the inputs to an array of `int`s. + Unconvertable inputs will result in errors. + This delegates to [`conv.ToInt`](#conv-toint) for each input argument. arguments: - name: in... @@ -382,8 +389,9 @@ funcs: This function attempts to convert most types of input (strings, numbers, and booleans), but behaviour when the input can not be converted is - undefined and subject to change. Unconvertable inputs may result in - errors, or `0` or `-1`. + undefined and subject to change. + + Unconvertable inputs will result in errors. arguments: - name: in required: true @@ -399,6 +407,8 @@ funcs: description: | Converts the inputs to an array of `float64`s. + Unconvertable inputs will result in errors. + This delegates to [`conv.ToFloat64`](#conv-tofloat64) for each input argument. arguments: - name: in... -- cgit v1.2.3