Skip to content

Commit 0af368c

Browse files
Trottaduh95
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 <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Guy Bedford <[email protected]>
1 parent 9cfac71 commit 0af368c

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

test/parallel/test-global-setters.js

+7-1
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)