Welcome! Log In Create A New Profile

Advanced

[njs] Test262: simplified import_chain.t.js.

Dmitry Volyntsev
February 07, 2024 09:00PM
details: https://hg.nginx.org/njs/rev/82ae061db9d0
branches:
changeset: 2285:82ae061db9d0
user: Dmitry Volyntsev <xeioex@nginx.com>
date: Wed Feb 07 17:57:01 2024 -0800
description:
Test262: simplified import_chain.t.js.

Avoid using "crypto" module, which unnessesary complicates the test.

diffstat:

test/js/import_chain.t.js | 8 ++------
test/js/module/libs/hash.js | 5 +----
test/js/module/sub/sub1.js | 3 +--
3 files changed, 4 insertions(+), 12 deletions(-)

diffs (49 lines):

diff -r 45f72ce8761b -r 82ae061db9d0 test/js/import_chain.t.js
--- a/test/js/import_chain.t.js Wed Feb 07 17:57:01 2024 -0800
+++ b/test/js/import_chain.t.js Wed Feb 07 17:57:01 2024 -0800
@@ -4,10 +4,6 @@ flags: []
paths: [test/js/module/, test/js/module/libs/, test/js/module/sub]
---*/

-import lib2 from 'lib2.js';
+import lib2 from 'lib2.js';

-import crypto from 'crypto';
-var h = crypto.createHash('md5');
-var hash = h.update('AB').digest('hex');
-
-assert.sameValue(lib2.hash(), hash);
+assert.sameValue(lib2.hash(), "XXX");
diff -r 45f72ce8761b -r 82ae061db9d0 test/js/module/libs/hash.js
--- a/test/js/module/libs/hash.js Wed Feb 07 17:57:01 2024 -0800
+++ b/test/js/module/libs/hash.js Wed Feb 07 17:57:01 2024 -0800
@@ -1,11 +1,8 @@
function hash() {
- var h = crypto.createHash('md5');
- var v = h.update('AB').digest('hex');
- return v;
+ return "XXX";
}

import sub from 'sub/sub3.js';
import name from 'name.js';
-import crypto from 'crypto';

export default {hash, name};
diff -r 45f72ce8761b -r 82ae061db9d0 test/js/module/sub/sub1.js
--- a/test/js/module/sub/sub1.js Wed Feb 07 17:57:01 2024 -0800
+++ b/test/js/module/sub/sub1.js Wed Feb 07 17:57:01 2024 -0800
@@ -1,5 +1,5 @@
function hash() {
- return sub2.hash(crypto);
+ return sub2.hash();
}

function error() {
@@ -7,6 +7,5 @@ function error() {
}

import sub2 from 'sub2.js';
-import crypto from 'crypto';

export default {hash, error};
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
https://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[njs] Test262: simplified import_chain.t.js.

Dmitry Volyntsev 228 February 07, 2024 09:00PM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 301
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 500 on July 15, 2024
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready