Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 11b82de

Browse filesBrowse 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
Copy full SHA for 11b82de

File tree

Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+7
-1
lines changed
Open diff view settings
Collapse file

‎test/parallel/test-global-setters.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-global-setters.js
+7-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.