diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-at-max.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-at-max.js index 820f71ec9e7a01..fcf5279dd3ceae 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-at-max.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-at-max.js @@ -1,8 +1,6 @@ 'use strict'; -// Flags: --expose-internals const common = require('../../common'); -const { internalBinding } = require('internal/test/binding'); const skipMessage = 'intensive toString tests due to memory confinements'; if (!common.enoughTestMem) common.skip(skipMessage); @@ -12,7 +10,7 @@ const assert = require('assert'); // v8 fails silently if string length > v8::String::kMaxLength // v8::String::kMaxLength defined in v8.h -const kStringMaxLength = internalBinding('buffer').kStringMaxLength; +const kStringMaxLength = require('buffer').constants.MAX_STRING_LENGTH; let buf; try { diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-ascii.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-ascii.js index 7f5a8347956e43..5e3033db3ea193 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-ascii.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-ascii.js @@ -1,8 +1,6 @@ 'use strict'; -// Flags: --expose-internals const common = require('../../common'); -const { internalBinding } = require('internal/test/binding'); const skipMessage = 'intensive toString tests due to memory confinements'; if (!common.enoughTestMem) common.skip(skipMessage); @@ -11,7 +9,7 @@ const binding = require(`./build/${common.buildType}/binding`); // v8 fails silently if string length > v8::String::kMaxLength // v8::String::kMaxLength defined in v8.h -const kStringMaxLength = internalBinding('buffer').kStringMaxLength; +const kStringMaxLength = require('buffer').constants.MAX_STRING_LENGTH; let buf; try { diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-base64.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-base64.js index d7fe26814f7b24..400477034d0010 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-base64.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-base64.js @@ -1,8 +1,6 @@ 'use strict'; -// Flags: --expose-internals const common = require('../../common'); -const { internalBinding } = require('internal/test/binding'); const skipMessage = 'intensive toString tests due to memory confinements'; if (!common.enoughTestMem) common.skip(skipMessage); @@ -11,7 +9,7 @@ const binding = require(`./build/${common.buildType}/binding`); // v8 fails silently if string length > v8::String::kMaxLength // v8::String::kMaxLength defined in v8.h -const kStringMaxLength = internalBinding('buffer').kStringMaxLength; +const kStringMaxLength = require('buffer').constants.MAX_STRING_LENGTH; let buf; try { diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js index 7e75ba1246662c..ef5d6a21ed0042 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-binary.js @@ -1,8 +1,7 @@ -// Flags: --expose-gc --expose-internals +// Flags: --expose-gc 'use strict'; const common = require('../../common'); -const { internalBinding } = require('internal/test/binding'); const skipMessage = 'intensive toString tests due to memory confinements'; if (!common.enoughTestMem) common.skip(skipMessage); @@ -12,7 +11,7 @@ const assert = require('assert'); // v8 fails silently if string length > v8::String::kMaxLength // v8::String::kMaxLength defined in v8.h -const kStringMaxLength = internalBinding('buffer').kStringMaxLength; +const kStringMaxLength = require('buffer').constants.MAX_STRING_LENGTH; let buf; try { diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js index 57242399bb02b9..844c8bcb335a87 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-hex.js @@ -1,8 +1,6 @@ 'use strict'; -// Flags: --expose-internals const common = require('../../common'); -const { internalBinding } = require('internal/test/binding'); const skipMessage = 'intensive toString tests due to memory confinements'; if (!common.enoughTestMem) common.skip(skipMessage); @@ -11,7 +9,7 @@ const binding = require(`./build/${common.buildType}/binding`); // v8 fails silently if string length > v8::String::kMaxLength // v8::String::kMaxLength defined in v8.h -const kStringMaxLength = internalBinding('buffer').kStringMaxLength; +const kStringMaxLength = require('buffer').constants.MAX_STRING_LENGTH; let buf; try { diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-utf8.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-utf8.js index 4a0908290c1926..15ec78b6c9ab1c 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-utf8.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-1-utf8.js @@ -1,8 +1,6 @@ 'use strict'; -// Flags: --expose-internals const common = require('../../common'); -const { internalBinding } = require('internal/test/binding'); const skipMessage = 'intensive toString tests due to memory confinements'; if (!common.enoughTestMem) common.skip(skipMessage); @@ -12,7 +10,7 @@ const assert = require('assert'); // v8 fails silently if string length > v8::String::kMaxLength // v8::String::kMaxLength defined in v8.h -const kStringMaxLength = internalBinding('buffer').kStringMaxLength; +const kStringMaxLength = require('buffer').constants.MAX_STRING_LENGTH; let buf; try { diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js index 3c613a69fd3fcd..121ca2d62bae6b 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max-by-2.js @@ -1,8 +1,6 @@ 'use strict'; -// Flags: --expose-internals const common = require('../../common'); -const { internalBinding } = require('internal/test/binding'); const skipMessage = 'intensive toString tests due to memory confinements'; if (!common.enoughTestMem) common.skip(skipMessage); @@ -12,7 +10,7 @@ const assert = require('assert'); // v8 fails silently if string length > v8::String::kMaxLength // v8::String::kMaxLength defined in v8.h -const kStringMaxLength = internalBinding('buffer').kStringMaxLength; +const kStringMaxLength = require('buffer').constants.MAX_STRING_LENGTH; let buf; try { diff --git a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max.js b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max.js index be571c5059ef8f..d65144e04d457c 100644 --- a/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max.js +++ b/test/addons/stringbytes-external-exceed-max/test-stringbytes-external-exceed-max.js @@ -1,8 +1,6 @@ 'use strict'; -// Flags: --expose-internals const common = require('../../common'); -const { internalBinding } = require('internal/test/binding'); const skipMessage = 'intensive toString tests due to memory confinements'; if (!common.enoughTestMem) common.skip(skipMessage); @@ -11,7 +9,7 @@ const binding = require(`./build/${common.buildType}/binding`); // v8 fails silently if string length > v8::String::kMaxLength // v8::String::kMaxLength defined in v8.h -const kStringMaxLength = internalBinding('buffer').kStringMaxLength; +const kStringMaxLength = require('buffer').constants.MAX_STRING_LENGTH; let buf; try { diff --git a/test/sequential/test-fs-readfile-tostring-fail.js b/test/sequential/test-fs-readfile-tostring-fail.js index da8f3930f618f9..9a443fc71bb2c3 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');