Improved String.prototype.toString() for ordinary strings.

Allowing converting all strings to encodings 'hex', 'base64', 'base64url'.
diff --git a/src/njs_string.c b/src/njs_string.c
index de575b8..6bd5d7f 100644
--- a/src/njs_string.c
+++ b/src/njs_string.c
@@ -738,9 +738,9 @@
 
 
 /*
- * String.toString([encoding]).
+ * String.prototype.toString([encoding]).
  * Returns the string as is if no additional argument is provided,
- * otherwise converts a byte string into an encoded string: hex, base64,
+ * otherwise converts a string into an encoded string: hex, base64,
  * base64url.
  */
 
@@ -771,11 +771,6 @@
 
     (void) njs_string_prop(&string, &value);
 
-    if (njs_slow_path(string.length != 0)) {
-        njs_type_error(vm, "argument must be a byte string");
-        return NJS_ERROR;
-    }
-
     njs_string_get(&args[1], &enc);
 
     str.length = string.size;
diff --git a/src/test/njs_unit_test.c b/src/test/njs_unit_test.c
index 30618bd..83cad21 100644
--- a/src/test/njs_unit_test.c
+++ b/src/test/njs_unit_test.c
@@ -895,9 +895,6 @@
     { njs_str("'A'.toString()"),
       njs_str("A") },
 
-    { njs_str("'A'.toString('hex')"),
-      njs_str("TypeError: argument must be a byte string") },
-
     { njs_str("'A'.toBytes().toString('latin1')"),
       njs_str("TypeError: Unknown encoding: \"latin1\"") },