@@ -4,27 +4,25 @@ require('../common');
44const assert = require ( 'assert' ) ;
55
66// v8 fails silently if string length > v8::String::kMaxLength
7- ( function ( ) {
8- // v8::String::kMaxLength defined in v8.h
9- const kStringMaxLength = process . binding ( 'buffer' ) . kStringMaxLength ;
7+ // v8::String::kMaxLength defined in v8.h
8+ const kStringMaxLength = process . binding ( 'buffer' ) . kStringMaxLength ;
109
11- try {
12- new Buffer ( kStringMaxLength * 3 ) ;
13- } catch ( e ) {
14- assert . equal ( e . message , 'Invalid array buffer length' ) ;
15- console . log (
16- '1..0 # Skipped: intensive toString tests due to memory confinements' ) ;
17- return ;
18- }
10+ try {
11+ new Buffer ( kStringMaxLength * 3 ) ;
12+ } catch ( e ) {
13+ assert . equal ( e . message , 'Invalid typed array length' ) ;
14+ console . log (
15+ '1..0 # Skipped: intensive toString tests due to memory confinements' ) ;
16+ return ;
17+ }
1918
20- const buf = new Buffer ( kStringMaxLength ) ;
19+ const buf = new Buffer ( kStringMaxLength ) ;
2120
22- var maxString = buf . toString ( ) ;
23- assert . equal ( maxString . length , kStringMaxLength ) ;
24- // Free the memory early instead of at the end of the next assignment
25- maxString = undefined ;
21+ var maxString = buf . toString ( ) ;
22+ assert . equal ( maxString . length , kStringMaxLength ) ;
23+ // Free the memory early instead of at the end of the next assignment
24+ maxString = undefined ;
2625
27- maxString = buf . toString ( 'binary' ) ;
28- assert . equal ( maxString . length , kStringMaxLength ) ;
29- maxString = undefined ;
30- } ) ( ) ;
26+ maxString = buf . toString ( 'binary' ) ;
27+ assert . equal ( maxString . length , kStringMaxLength ) ;
28+ maxString = undefined ;
0 commit comments