feat: add validation to skip/take and rename split parameter for clarity
Add type and range checks to Sequence.skip() and Sequence.take() methods, aborting with "Count must be a non-negative integer." when count is not a non-negative integer. Rename split() parameter from 'delim' to 'delimiter' and update its error message from "Argument must be a non-empty string." to "Delimiter must be a non-empty string." for consistency. Remove old behavior allowing negative counts and add new test files for skip/take validation errors.
This commit is contained in:
@@ -1 +1 @@
|
||||
"foo".split(1) // expect runtime error: Argument must be a non-empty string.
|
||||
"foo".split(1) // expect runtime error: Delimiter must be a non-empty string.
|
||||
|
||||
@@ -1 +1 @@
|
||||
"foo".split("") // expect runtime error: Argument must be a non-empty string.
|
||||
"foo".split("") // expect runtime error: Delimiter must be a non-empty string.
|
||||
|
||||
Reference in New Issue
Block a user