@@ -36,13 +36,23 @@ const fn4 = path.join(tmpdir.path, 'write4.txt');
36
36
const expected = 'ümlaut.' ;
37
37
const constants = fs . constants ;
38
38
39
- const { externalizeString, isOneByteString } = global ;
39
+ const {
40
+ createExternalizableString,
41
+ externalizeString,
42
+ isOneByteString,
43
+ } = global ;
40
44
41
45
// Account for extra globals exposed by --expose_externalize_string.
42
- common . allowGlobals ( externalizeString , isOneByteString , global . x ) ;
46
+ common . allowGlobals (
47
+ createExternalizableString ,
48
+ externalizeString ,
49
+ isOneByteString ,
50
+ global . x ,
51
+ ) ;
43
52
44
53
{
45
- const expected = 'ümlaut sechzig' ; // Must be a unique string.
54
+ // Must be a unique string.
55
+ const expected = createExternalizableString ( 'ümlaut sechzig' ) ;
46
56
externalizeString ( expected ) ;
47
57
assert . strictEqual ( isOneByteString ( expected ) , true ) ;
48
58
const fd = fs . openSync ( fn , 'w' ) ;
@@ -52,7 +62,8 @@ common.allowGlobals(externalizeString, isOneByteString, global.x);
52
62
}
53
63
54
64
{
55
- const expected = 'ümlaut neunzig' ; // Must be a unique string.
65
+ // Must be a unique string.
66
+ const expected = createExternalizableString ( 'ümlaut neunzig' ) ;
56
67
externalizeString ( expected ) ;
57
68
assert . strictEqual ( isOneByteString ( expected ) , true ) ;
58
69
const fd = fs . openSync ( fn , 'w' ) ;
@@ -62,7 +73,8 @@ common.allowGlobals(externalizeString, isOneByteString, global.x);
62
73
}
63
74
64
75
{
65
- const expected = 'Zhōngwén 1' ; // Must be a unique string.
76
+ // Must be a unique string.
77
+ const expected = createExternalizableString ( 'Zhōngwén 1' ) ;
66
78
externalizeString ( expected ) ;
67
79
assert . strictEqual ( isOneByteString ( expected ) , false ) ;
68
80
const fd = fs . openSync ( fn , 'w' ) ;
@@ -72,7 +84,8 @@ common.allowGlobals(externalizeString, isOneByteString, global.x);
72
84
}
73
85
74
86
{
75
- const expected = 'Zhōngwén 2' ; // Must be a unique string.
87
+ // Must be a unique string.
88
+ const expected = createExternalizableString ( 'Zhōngwén 2' ) ;
76
89
externalizeString ( expected ) ;
77
90
assert . strictEqual ( isOneByteString ( expected ) , false ) ;
78
91
const fd = fs . openSync ( fn , 'w' ) ;
0 commit comments