0
0
mirror of https://github.com/nodejs/node.git synced 2024-11-21 21:19:50 +01:00
nodejs/test/parallel/test-process-constrained-memory.js
Chengzhong Wu 0eb2b727f6
src: return a number from process.constrainedMemory() constantly
`0` is already a special value returned from
`uv_get_constrained_memory` representing unknown or no constraint.
Make `process.constrainedMemory()` constantly return a number instead
to avoid polymorphic return type.

PR-URL: https://github.com/nodejs/node/pull/52039
Reviewed-By: theanarkh <theratliter@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Yagiz Nizipli <yagiz.nizipli@sentry.io>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
2024-03-15 00:27:33 +08:00

7 lines
182 B
JavaScript

'use strict';
require('../common');
const assert = require('assert');
const constrainedMemory = process.constrainedMemory();
assert.strictEqual(typeof constrainedMemory, 'number');