[njs] Test262: allowing to omit empty default option argument.

Mike MacCana mike.maccana at gmail.com
Wed Mar 19 03:43:14 UTC 2025


Unsubscribe

On Tue, Mar 18, 2025 at 17:46 <noreply at nginx.com> wrote:

> details:
> https://github.com/nginx/njs/commit/3ad475cb9a0b24fc7bc49460ede80f4ec104c3fd
> branches:  master
> commit:    3ad475cb9a0b24fc7bc49460ede80f4ec104c3fd
> user:      Dmitry Volyntsev <xeioex at nginx.com>
> date:      Tue, 25 Feb 2025 22:44:39 -0800
> description:
> Test262: allowing to omit empty default option argument.
>
>
> ---
>  test/buffer.t.js                  | 37
> -------------------------------------
>  test/fs/methods.t.mjs             |  4 ----
>  test/harness/runTsuite.js         |  2 +-
>  test/querystring.t.mjs            |  8 --------
>  test/text_decoder.t.js            |  6 ------
>  test/text_encoder.t.js            |  4 ----
>  test/webcrypto/digest.t.mjs       |  1 -
>  test/webcrypto/import.t.mjs       |  4 ----
>  test/webcrypto/rsa_decoding.t.mjs |  1 -
>  9 files changed, 1 insertion(+), 66 deletions(-)
>
> diff --git a/test/buffer.t.js b/test/buffer.t.js
> index 01e25bed..37821104 100644
> --- a/test/buffer.t.js
> +++ b/test/buffer.t.js
> @@ -86,7 +86,6 @@ let concat_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
>      tests: [
>          { buffers: [ Buffer.from('abc'),
>                       Buffer.from(new Uint8Array([0x64, 0x65,
> 0x66]).buffer, 1) ],
> @@ -112,8 +111,6 @@ let compare_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { buf1: Buffer.from('abc'), buf2: Buffer.from('abc'), expected: 0
> },
>          { buf1: Buffer.from('abc'),
> @@ -150,8 +147,6 @@ let comparePrototype_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { buf: Buffer.from('abc'), target: Buffer.from('abc'), expected:
> 0 },
>          { buf: Buffer.from('abc'),
> @@ -200,8 +195,6 @@ let copy_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { buf: Buffer.from('abcdef'), target: Buffer.from('123456'),
>            expected: 6, expected_buf: 'abcdef' },
> @@ -236,7 +229,6 @@ let equals_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
>      tests: [
>
>          { buf1: Buffer.from('abc'), buf2: Buffer.from('abc'), expected:
> true },
> @@ -271,7 +263,6 @@ let fill_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
>      tests: [
>          { buf: Buffer.from('abc'), value: 0x61, expected: 'aaa' },
>          { buf: Buffer.from('abc'), value: 0x61, expected: 'aaa', offset:
> 0, end: 3 },
> @@ -430,8 +421,6 @@ let includes_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { buf: Buffer.from('abcdef'), value: 'abc', expected: true },
>          { buf: Buffer.from('abcdef'), value: 'def', expected: true },
> @@ -455,8 +444,6 @@ let indexOf_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { buf: Buffer.from('abcdef'), value: 'abc', expected: 0 },
>          { buf: Buffer.from('abcdef'), value: 'def', expected: 3 },
> @@ -503,8 +490,6 @@ let isBuffer_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { value: Buffer.from('α'), expected: true },
>          { value: new Uint8Array(10), expected: false },
> @@ -526,8 +511,6 @@ let isEncoding_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { value: 'utf-8', expected: true },
>          { value: 'utf8', expected: true },
> @@ -576,8 +559,6 @@ let lastIndexOf_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { buf: Buffer.from('abcdef'), value: 'abc', expected: 0 },
>          { buf: Buffer.from('abcabc'), value: 'abc', expected: 3 },
> @@ -640,8 +621,6 @@ let readXIntXX_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { buf: Buffer.from([0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff]), offset:
> 0,
>            expected: [
> -86,170,-17494,-21829,48042,43707,-573785174,-1430532899,3721182122,2864434397
> ] },
> @@ -699,8 +678,6 @@ let readFloat_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          {}
>      ],
> @@ -727,8 +704,6 @@ let readGeneric_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { buf: Buffer.from([0xaa, 0xbb, 0xcc, 0xdd, 0xee, 0xff]), offset:
> 0, length: 1,
>            expected: [ 170, 170, -86, -86 ] },
> @@ -767,8 +742,6 @@ let slice_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { buf: Buffer.from('abcdef'), start: 1, expected: 'bcdef' },
>          { buf: Buffer.from('abcdef'), start: 1, end: 3, expected: 'bc' },
> @@ -795,8 +768,6 @@ let subarray_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { buf: Buffer.from('abcdef'), start: 0, end: 3, expected: 'Zbc' },
>          { buf: Buffer.from('abcdef'), start: 1, expected: 'bcdef' },
> @@ -842,8 +813,6 @@ let toJSON_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { value: '', expected: { type: 'Buffer', data: [] } },
>          { value: 'αβγ', expected: { type: 'Buffer', data: [0xCE, 0xB1,
> 0xCE, 0xB2, 0xCE, 0xB3] } },
> @@ -912,8 +881,6 @@ let write_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { value: 'abc', expected: 3, expected_buf: 'abcZZZZZZZ' },
>          { value: 'abc', offset: 1, expected: 3, expected_buf:
> 'ZabcZZZZZZ' },
> @@ -955,8 +922,6 @@ let writeXIntXX_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { write: 'writeInt8', value: 0xaa, exception: 'RangeError: Index
> out of range' },
>          { write: 'writeInt8', value: 0x00, offset: 3, expected: 4,
> expected_buf: '5a5a5a005a5a5a5a5a5a' },
> @@ -995,8 +960,6 @@ let writeGeneric_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { write: 'writeUIntLE', value: 0xaa, length: 1,
>            exception: 'RangeError: Index out of range' },
> diff --git a/test/fs/methods.t.mjs b/test/fs/methods.t.mjs
> index 928d1682..705c1b5a 100644
> --- a/test/fs/methods.t.mjs
> +++ b/test/fs/methods.t.mjs
> @@ -1008,7 +1008,6 @@ let readSync_tsuite = {
>      skip: () => (!has_buffer()),
>      T: read_test,
>      prepare_args: p,
> -    opts: {},
>      get tests() { return read_tests() },
>  };
>
> @@ -1017,7 +1016,6 @@ let readFh_tsuite = {
>      skip: () => (!has_buffer()),
>      T: readFh_test,
>      prepare_args: p,
> -    opts: {},
>      get tests() { return read_tests() },
>  };
>
> @@ -1213,7 +1211,6 @@ let writeSync_tsuite = {
>      skip: () => (!has_buffer()),
>      T: write_test,
>      prepare_args: p,
> -    opts: {},
>      get tests() { return write_tests() },
>  };
>
> @@ -1222,7 +1219,6 @@ let writeFh_tsuite = {
>      skip: () => (!has_buffer()),
>      T: writeFh_test,
>      prepare_args: p,
> -    opts: {},
>      get tests() { return write_tests() },
>  };
>
> diff --git a/test/harness/runTsuite.js b/test/harness/runTsuite.js
> index 068a19e1..2a324fbe 100644
> --- a/test/harness/runTsuite.js
> +++ b/test/harness/runTsuite.js
> @@ -29,7 +29,7 @@ async function run(tlist) {
>                  let prepare_args = ts.prepare_args ? ts.prepare_args
>                                                     : default_prepare_args;
>
> -                return ts.T(prepare_args(t, ts.opts));
> +                return ts.T(prepare_args(t, ts.opts ? ts.opts : {}));
>
>              } catch (e) {
>                  return Promise.reject(e);
> diff --git a/test/querystring.t.mjs b/test/querystring.t.mjs
> index cb42305e..8ea14050 100644
> --- a/test/querystring.t.mjs
> +++ b/test/querystring.t.mjs
> @@ -17,8 +17,6 @@ let escape_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: { },
> -
>      tests: [
>          { value: '', expected: '' },
>          { value: 'baz=fuz', expected: 'baz%3Dfuz' },
> @@ -62,8 +60,6 @@ let parse_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: { },
> -
>      tests: [
>          { value: '', expected: {} },
>          { value: 'baz=fuz', expected: { baz:'fuz' } },
> @@ -165,8 +161,6 @@ let stringify_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: { },
> -
>      tests: [
>          { obj: {}, expected: '' },
>          { obj: { baz:'fuz', muz:'tax' }, expected: 'baz=fuz&muz=tax' },
> @@ -216,8 +210,6 @@ let unescape_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: { },
> -
>      tests: [
>          { value: '', expected: '' },
>          { value: 'baz%3Dfuz', expected: 'baz=fuz' },
> diff --git a/test/text_decoder.t.js b/test/text_decoder.t.js
> index a6fced2b..afc91fc4 100644
> --- a/test/text_decoder.t.js
> +++ b/test/text_decoder.t.js
> @@ -40,8 +40,6 @@ let stream_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { chunks: [new Uint8Array([0xF0, 0x9F, 0x8C, 0x9F])],
>            expected: ['🌟'] },
> @@ -95,8 +93,6 @@ let fatal_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { chunks: [new Uint8Array([0xF0, 0xA0, 0xAE, 0xB7])],
>            expected: ['𠮷'] },
> @@ -124,8 +120,6 @@ let ignoreBOM_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { value: new Uint8Array([239, 187, 191, 50]),
>            opts: {ignoreBOM: true},
> diff --git a/test/text_encoder.t.js b/test/text_encoder.t.js
> index 10324bca..25173cd1 100644
> --- a/test/text_encoder.t.js
> +++ b/test/text_encoder.t.js
> @@ -26,8 +26,6 @@ let encode_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { value: "", expected: [] },
>          { value: "abc", expected: [97, 98, 99] },
> @@ -58,8 +56,6 @@ let encodeinto_tsuite = {
>          return 'SUCCESS';
>      },
>
> -    opts: {},
> -
>      tests: [
>          { value: "", dest: new Uint8Array(4), expected: [], read: 0 },
>          { value: "aα", dest: new Uint8Array(3), expected: [97, 206, 177],
> read: 2 },
> diff --git a/test/webcrypto/digest.t.mjs b/test/webcrypto/digest.t.mjs
> index 4318fe16..f07f0346 100644
> --- a/test/webcrypto/digest.t.mjs
> +++ b/test/webcrypto/digest.t.mjs
> @@ -25,7 +25,6 @@ let digest_tsuite = {
>      skip: () => (!has_buffer() || !has_webcrypto()),
>      T: test,
>      prepare_args: p,
> -    opts: { },
>
>      tests: [
>          { name: "XXX", data: "",
> diff --git a/test/webcrypto/import.t.mjs b/test/webcrypto/import.t.mjs
> index 1b804006..9ec0fb60 100644
> --- a/test/webcrypto/import.t.mjs
> +++ b/test/webcrypto/import.t.mjs
> @@ -85,7 +85,6 @@ let aes_tsuite = {
>      skip: () => (!has_webcrypto()),
>      T: test,
>      prepare_args: p,
> -    opts: {},
>
>      tests: [
>        { key: { fmt: "jwk",
> @@ -186,7 +185,6 @@ let ec_tsuite = {
>      skip: () => (!has_webcrypto()),
>      T: test,
>      prepare_args: p,
> -    opts: {},
>
>      tests: [
>        { key: { fmt: "jwk",
> @@ -350,7 +348,6 @@ let hmac_tsuite = {
>      skip: () => (!has_webcrypto()),
>      T: test,
>      prepare_args: p,
> -    opts: {},
>
>      tests: [
>        { key: { fmt: "raw",
> @@ -465,7 +462,6 @@ let rsa_tsuite = {
>      skip: () => (!has_webcrypto()),
>      T: test,
>      prepare_args: p,
> -    opts: {},
>
>      tests: [
>        { key: { fmt: "jwk",
> diff --git a/test/webcrypto/rsa_decoding.t.mjs
> b/test/webcrypto/rsa_decoding.t.mjs
> index 08874491..179072ff 100644
> --- a/test/webcrypto/rsa_decoding.t.mjs
> +++ b/test/webcrypto/rsa_decoding.t.mjs
> @@ -29,7 +29,6 @@ let rsa_tsuite = {
>      name: "RSA-OAEP decoding",
>      T: test,
>      prepare_args: (v) => v,
> -    opts: { },
>
>      tests: [
>          { pem: "rsa.pkcs8", src: "text.base64.rsa-oaep.enc", expected:
> "WAKAWAKA" },
> _______________________________________________
> nginx-devel mailing list
> nginx-devel at nginx.org
> https://mailman.nginx.org/mailman/listinfo/nginx-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mailman.nginx.org/pipermail/nginx-devel/attachments/20250318/45cebc5a/attachment-0001.htm>


More information about the nginx-devel mailing list