Skip to content

Commit d9b5bc3

Browse files
committed
[js] Fix nqp::getstrfromname and nqp::codepointfromname with NULL
1 parent 8dbaec7 commit d9b5bc3

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

src/vm/js/nqp-runtime/core.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1397,9 +1397,9 @@ op.getstrfromname = function(name) {
13971397
let codePoint;
13981398
let codePoints;
13991399

1400-
if (codePoint = ucd.nameToCodePoint(uppercased)) {
1400+
if ((codePoint = ucd.nameToCodePoint(uppercased)) !== undefined) {
14011401
return String.fromCodePoint(codePoint);
1402-
} else if (codePoint = ucd.aliasToCodePoint(uppercased)) {
1402+
} else if ((codePoint = ucd.aliasToCodePoint(uppercased)) !== undefined) {
14031403
return String.fromCodePoint(codePoint);
14041404
} else if (codePoints = ucd.sequenceToCodePoints(uppercased)) {
14051405
return codePoints.map(codePoint => String.fromCodePoint(codePoint)).join('');
@@ -1411,9 +1411,9 @@ op.getstrfromname = function(name) {
14111411
op.codepointfromname = function(name) {
14121412
let codePoint;
14131413

1414-
if (codePoint = ucd.nameToCodePoint(name)) {
1414+
if ((codePoint = ucd.nameToCodePoint(name)) !== undefined) {
14151415
return codePoint;
1416-
} else if (codePoint = ucd.aliasToCodePoint(name)) {
1416+
} else if ((codePoint = ucd.aliasToCodePoint(name)) !== undefined) {
14171417
return codePoint;
14181418
} else {
14191419
return -1;

0 commit comments

Comments
 (0)