Skip to content

Commit 11b82de

Browse files
Trottmarco-ippolito
authored andcommitted
test: use strict mode in global setters test
test-global-setters.js was added in #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.) PR-URL: #56742 Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: James M Snell <jasnell@gmail.com> Reviewed-By: Guy Bedford <guybedford@gmail.com>
1 parent b0ab483 commit 11b82de

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/parallel/test-global-setters.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,10 @@
1-
/* eslint-disable strict */
1+
// When setters and getters were added for global.process and global.Buffer to
2+
// create a deprecation path for them in ESM, this test was added to make sure
3+
// the setters and getters behaved as expected.
4+
// Ref: https://github.com/nodejs/node/pull/26882
5+
// Ref: https://github.com/nodejs/node/pull/26334
6+
7+
'use strict';
28
require('../common');
39
const assert = require('assert');
410
const _process = require('process');

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy