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 089362f

Browse filesBrowse files
TrottFishrock123
authored andcommitted
test,tools: limit lint tolerance of gc global
Lint rules permitted the `gc` global in any test file. This change limits it to just the files that need it. PR-URL: #6324 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
1 parent 66903f6 commit 089362f
Copy full SHA for 089362f
Expand file treeCollapse file tree

15 files changed

+33
-36
lines changed
Open diff view settings
Collapse file

‎test/.eslintrc‎

Copy file name to clipboardExpand all lines: test/.eslintrc
-3Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,3 @@
33
rules:
44
## common module is mandatory in tests
55
required-modules: [2, "common"]
6-
7-
globals:
8-
gc: false
Collapse file

‎test/addons/buffer-free-callback/test.js‎

Copy file name to clipboardExpand all lines: test/addons/buffer-free-callback/test.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@ function check(size, alignment, offset) {
1111
buf = null;
1212
binding.check(slice);
1313
slice = null;
14-
gc();
15-
gc();
16-
gc();
14+
global.gc();
15+
global.gc();
16+
global.gc();
1717
}
1818

1919
check(64, 1, 0);
Collapse file

‎test/common.js‎

Copy file name to clipboardExpand all lines: test/common.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -275,7 +275,7 @@ var knownGlobals = [setTimeout,
275275
global];
276276

277277
if (global.gc) {
278-
knownGlobals.push(gc);
278+
knownGlobals.push(global.gc);
279279
}
280280

281281
if (global.DTRACE_HTTP_SERVER_RESPONSE) {
Collapse file

‎test/gc/test-http-client-connaborted.js‎

Copy file name to clipboardExpand all lines: test/gc/test-http-client-connaborted.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,13 +53,13 @@ function afterGC() {
5353

5454
var timer;
5555
function statusLater() {
56-
gc();
56+
global.gc();
5757
if (timer) clearTimeout(timer);
5858
timer = setTimeout(status, 1);
5959
}
6060

6161
function status() {
62-
gc();
62+
global.gc();
6363
console.log('Done: %d/%d', done, todo);
6464
console.log('Collected: %d/%d', countGC, count);
6565
if (done === todo) {
Collapse file

‎test/gc/test-http-client-onerror.js‎

Copy file name to clipboardExpand all lines: test/gc/test-http-client-onerror.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,13 +61,13 @@ function afterGC() {
6161

6262
var timer;
6363
function statusLater() {
64-
gc();
64+
global.gc();
6565
if (timer) clearTimeout(timer);
6666
timer = setTimeout(status, 1);
6767
}
6868

6969
function status() {
70-
gc();
70+
global.gc();
7171
console.log('Done: %d/%d', done, todo);
7272
console.log('Collected: %d/%d', countGC, count);
7373
if (done === todo) {
Collapse file

‎test/gc/test-http-client-timeout.js‎

Copy file name to clipboardExpand all lines: test/gc/test-http-client-timeout.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -62,13 +62,13 @@ function afterGC() {
6262

6363
var timer;
6464
function statusLater() {
65-
gc();
65+
global.gc();
6666
if (timer) clearTimeout(timer);
6767
timer = setTimeout(status, 1);
6868
}
6969

7070
function status() {
71-
gc();
71+
global.gc();
7272
console.log('Done: %d/%d', done, todo);
7373
console.log('Collected: %d/%d', countGC, count);
7474
if (done === todo) {
Collapse file

‎test/gc/test-http-client.js‎

Copy file name to clipboardExpand all lines: test/gc/test-http-client.js
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ function getall() {
3131
res.resume();
3232
console.error('in cb');
3333
done += 1;
34-
res.on('end', gc);
34+
res.on('end', global.gc);
3535
}
3636

3737
var req = http.get({
@@ -57,7 +57,7 @@ function afterGC() {
5757
setInterval(status, 1000).unref();
5858

5959
function status() {
60-
gc();
60+
global.gc();
6161
console.log('Done: %d/%d', done, todo);
6262
console.log('Collected: %d/%d', countGC, count);
6363
if (done === todo) {
Collapse file

‎test/gc/test-net-timeout.js‎

Copy file name to clipboardExpand all lines: test/gc/test-net-timeout.js
+3-3Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function getall() {
4343
//console.log('timeout (expected)')
4444
req.destroy();
4545
done++;
46-
gc();
46+
global.gc();
4747
});
4848

4949
count++;
@@ -63,13 +63,13 @@ function afterGC() {
6363
setInterval(status, 100).unref();
6464

6565
function status() {
66-
gc();
66+
global.gc();
6767
console.log('Done: %d/%d', done, todo);
6868
console.log('Collected: %d/%d', countGC, count);
6969
if (done === todo) {
7070
/* Give libuv some time to make close callbacks. */
7171
setTimeout(function() {
72-
gc();
72+
global.gc();
7373
console.log('All should be collected now.');
7474
console.log('Collected: %d/%d', countGC, count);
7575
assert(count === countGC);
Collapse file

‎test/parallel/test-http-parser-bad-ref.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-http-parser-bad-ref.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ var messagesComplete = 0;
1818

1919
function flushPool() {
2020
Buffer.allocUnsafe(Buffer.poolSize - 1);
21-
gc();
21+
global.gc();
2222
}
2323

2424
function demoBug(part1, part2) {
Collapse file

‎test/parallel/test-vm-create-and-run-in-context.js‎

Copy file name to clipboardExpand all lines: test/parallel/test-vm-create-and-run-in-context.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ assert.equal('lala', context.thing);
2424
console.error('run in contextified sandbox without referencing the context');
2525
var sandbox = {x: 1};
2626
vm.createContext(sandbox);
27-
gc();
27+
global.gc();
2828
vm.runInContext('x = 2', sandbox);
2929
// Should not crash.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.