Skip to content

Commit e3b69ba

Browse files
committed
Replace usages of fromCodePoint with string literals
1 parent f1fa309 commit e3b69ba

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

test/simple-test.js

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,14 +197,15 @@ exports['Simple'] = nodeunit.testCase({
197197
"method returning a string (Unicode BMP)": function(test) {
198198
var s = java.callStaticMethodSync("Test", "getUnicodeBMP");
199199
console.log(s);
200-
test.equal(String.fromCodePoint(0x2605), s);
200+
test.equal("\u2605", s);
201201
test.done();
202202
},
203203

204204
"method returning a string (Unicode SMP)": function(test) {
205205
var s = java.callStaticMethodSync("Test", "getUnicodeSMP");
206206
console.log(s);
207-
test.equal(String.fromCodePoint(0x1F596), s);
207+
// The below string is U+1F596, represented as surrogate pairs
208+
test.equal("\uD83D\uDD96", s);
208209
test.done();
209210
},
210211

@@ -286,15 +287,16 @@ exports['Simple'] = nodeunit.testCase({
286287
},
287288

288289
"method taking a string (Unicode BMP)": function(test) {
289-
var s = String.fromCodePoint(0x2605);
290+
var s = "\u2605";
290291
var r = java.callStaticMethodSync("Test", "staticString", s);
291292
console.log(r);
292293
test.equal(r, s);
293294
test.done();
294295
},
295296

296297
"method taking a string (Unicode SMP)": function(test) {
297-
var s = String.fromCodePoint(0x1F596);
298+
// The below string is U+1F596, represented as surrogate pairs
299+
var s = "\uD83D\uDD96";
298300
var r = java.callStaticMethodSync("Test", "staticString", s);
299301
console.log(r);
300302
test.equal(r, s);

0 commit comments

Comments
 (0)