From 7d453ff21294bc9dcf7c9a61b1a07c3a15a021ce Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Tue, 1 Jan 2019 20:51:06 -0800 Subject: test: replace internals with public API MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Remove instances where `--expose-internals` is used to gain access to buffer.kStringMaxLength. The property is availalble without a flag. It is undocumented but the same as the documented `buffer.constants.MAX_STRING_LENGTH` so use that. (We even have a test that confirms that they are the same value.) PR-URL: https://github.com/nodejs/node/pull/25309 Reviewed-By: Сковорода Никита Андреевич Reviewed-By: Colin Ihrig Reviewed-By: Anna Henningsen Reviewed-By: James M Snell --- test/sequential/test-fs-readfile-tostring-fail.js | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'test/sequential') diff --git a/test/sequential/test-fs-readfile-tostring-fail.js b/test/sequential/test-fs-readfile-tostring-fail.js index da8f3930f6..9a443fc71b 100644 --- a/test/sequential/test-fs-readfile-tostring-fail.js +++ b/test/sequential/test-fs-readfile-tostring-fail.js @@ -1,8 +1,6 @@ 'use strict'; -// Flags: --expose-internals const common = require('../common'); -const { internalBinding } = require('internal/test/binding'); if (!common.enoughTestMem) common.skip('intensive toString tests due to memory confinements'); @@ -11,7 +9,7 @@ const assert = require('assert'); const fs = require('fs'); const path = require('path'); const cp = require('child_process'); -const kStringMaxLength = internalBinding('buffer').kStringMaxLength; +const kStringMaxLength = require('buffer').constants.MAX_STRING_LENGTH; if (common.isAIX && (Number(cp.execSync('ulimit -f')) * 512) < kStringMaxLength) common.skip('intensive toString tests due to file size confinements'); -- cgit v1.2.3