From ee003fce67519201339897e5961a999258675423 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 24 Jan 2025 06:40:49 -0800 Subject: [PATCH 1/2] test: use strict mode in global setters test test-global-setters.js was added in https://github.com/nodejs/node/pull/26882 and hasn't been modified since. It appears that it avoids strict mode so that unscoped identifiers are treated as globals, but that's true in strict mode too. (In sloppy mode, an assignment to an undefined identifier will create a global, but that's not what this test does. In strict mode, those assignments will throw an error, which would seem to be what we would want.) --- test/parallel/test-global-setters.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/parallel/test-global-setters.js b/test/parallel/test-global-setters.js index 7fd070ed8e1c4e..8c2870e315002a 100644 --- a/test/parallel/test-global-setters.js +++ b/test/parallel/test-global-setters.js @@ -1,4 +1,4 @@ -/* eslint-disable strict */ +'use strict'; require('../common'); const assert = require('assert'); const _process = require('process'); From 513d880011ce89eba620f3f890bd0f7c73b8bf70 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Fri, 24 Jan 2025 09:30:29 -0800 Subject: [PATCH 2/2] squash! test: use strict mode in global setters test --- test/parallel/test-global-setters.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/test/parallel/test-global-setters.js b/test/parallel/test-global-setters.js index 8c2870e315002a..3117118563a78d 100644 --- a/test/parallel/test-global-setters.js +++ b/test/parallel/test-global-setters.js @@ -1,3 +1,9 @@ +// When setters and getters were added for global.process and global.Buffer to +// create a deprecation path for them in ESM, this test was added to make sure +// the setters and getters behaved as expected. +// Ref: https://github.com/nodejs/node/pull/26882 +// Ref: https://github.com/nodejs/node/pull/26334 + 'use strict'; require('../common'); const assert = require('assert');