Skip to content

Commit

Permalink
fix glEnumToString for non-numbers
Browse files Browse the repository at this point in the history
  • Loading branch information
greggman committed Feb 18, 2021
1 parent 51ba155 commit 9f6fbd8
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const glEnumToString = (function() {

return function glEnumToString(gl, value) {
addEnums(gl);
return enums[value] || ("0x" + value.toString(16));
return enums[value] || (typeof value === 'number' ? `0x${value.toString(16)}` : value);
};
}());

Expand Down

0 comments on commit 9f6fbd8

Please sign in to comment.