nodejs-mozilla/test/parallel/test-fs-readdir-stack-overf...

20 lines
276 B
JavaScript

'use strict';
require('../common');
const assert = require('assert');
const fs = require('fs');
function recurse() {
fs.readdirSync('.');
recurse();
}
assert.throws(
() => recurse(),
{
name: 'RangeError',
message: 'Maximum call stack size exceeded'
}
);