# HG changeset patch # User Yaroslav Zhuravlev # Date 1685635938 -3600 # Node ID 02889d1bab78a8ac751e40969653391cd516dc6b # Parent 576e06abd683411f6f45cbb65cea836f9479e25b Marked byte string methods as removed in njs Reference. diff --git a/xml/en/docs/njs/reference.xml b/xml/en/docs/njs/reference.xml --- a/xml/en/docs/njs/reference.xml +++ b/xml/en/docs/njs/reference.xml @@ -9,7 +9,7 @@
+ rev="106">
@@ -2811,13 +2811,25 @@ Returns the PID of the current parent pr
-There are two types of strings in njs: a Unicode string (default) and -a byte string. +By default all strings in njs are Unicode strings. +They correspond to ECMAScript strings that contain Unicode characters. +Before 0.8.0, +byte strings were also supported. +
+ -A Unicode string corresponds to an ECMAScript string -which contains Unicode characters. + +Since 0.8.0, +the support for byte strings and byte string methods were removed. +When working with byte sequence, +the Buffer object +and Buffer properties, such as +r.requestBuffer, +r.rawVariables, +should be used. + @@ -2843,16 +2855,10 @@ otherwise, null is re String.bytesFrom(array | string, encoding) -Creates a byte string either from an array that contains octets, -or from an encoded string -(0.2.3). -The encoding can be -hex, -base64, and -base64url. -The method is deprecated since -0.4.4, -the Buffer.from method should be used instead: +The method was made obsolete in +0.4.4 +and was removed in 0.8.0. +The Buffer.from method should be used instead: >> Buffer.from([0x62, 0x75, 0x66, 0x66, 0x65, 0x72]).toString() 'buffer' @@ -2860,13 +2866,22 @@ the Buffer.from metho >> Buffer.from('YnVmZmVy', 'base64').toString() 'buffer' +Before 0.4.4, +created a byte string either from an array that contained octets, +or from an encoded string +(0.2.3), +the encoding could be +hex, +base64, and +base64url. String.prototype.fromBytes(start[, end]) -the property is deprecated since -0.7.7. +the property was made obsolete in +0.7.7 +and was removed in 0.8.0. Before 0.7.7, returned a new Unicode string from a byte string where each byte was replaced with a corresponding Unicode code point. @@ -2875,9 +2890,10 @@ where each byte was replaced with a corr String.prototype.fromUTF8(start[, end]) -the property is deprecated since -0.7.7, -the TextDecoder method +the property was made obsolete in +0.7.7 +and was removed in 0.8.0. +The TextDecoder method should be used instead. Before 0.7.7, converted a byte string containing a valid UTF-8 string @@ -2888,8 +2904,9 @@ otherwise null was re String.prototype.toBytes(start[, end]) -the property is deprecated since -0.7.7. +the property was made obsolete in +0.7.7 +and was removed in 0.8.0. Before 0.7.7, serialized a Unicode string to a byte string, returned null if a character larger than 255 was @@ -2899,8 +2916,9 @@ found in the string. String.prototype.toString(encoding) -the property is deprecated since -0.7.7. +the property was made obsolete in +0.7.7 +and was removed in 0.8.0. Before 0.7.7, encoded a string to hex, @@ -2922,9 +2940,10 @@ only a byte st String.prototype.toUTF8(start[, end]) -the property is deprecated since -0.7.7, -the TextEncoder method +the property was made obsolete in +0.7.7 +and was removed in 0.8.0. +The TextEncoder method should be used instead. Before 0.7.7, serialized a Unicode string @@ -2944,6 +2963,8 @@ 4
+
+