We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
isPointerType
1 parent f224d23 commit d71d76eCopy full SHA for d71d76e
src/parseTools.mjs
@@ -240,7 +240,7 @@ const SIZE_TYPE = POINTER_TYPE;
240
const POINTER_WASM_TYPE = `i${POINTER_BITS}`;
241
242
function isPointerType(type) {
243
- return type[type.length - 1] == '*';
+ return type.endsWith('*');
244
}
245
246
// Given an expression like (VALUE=VALUE*2,VALUE<10?VALUE:t+1) , this will
@@ -327,7 +327,7 @@ function getNativeTypeSize(type) {
327
case 'float': return 4;
328
case 'double': return 8;
329
default: {
330
- if (type[type.length - 1] === '*') {
+ if (type.endsWith('*')) {
331
return POINTER_SIZE;
332
333
if (type[0] === 'i') {
0 commit comments