actually that function is hot and called frequently, can't we simpify it, e.g. like this:

node.ch = 0;
node.left = node.next = node.right = node.center = -1;

if (nodetype === 1) {  // Terminal node
  return node;
}
if (nodetype === 2) { // Suffix node
  if (charsize === 1) {
    node.ch = tree[offset + 1];
    node.center = offset + 2;
  }
  else {
    node.ch = (tree[offset + 1] << 8) + tree[offset + 2];
    node.center = offset + 3;
  }
  return node;
}

var secondbyte = tree[offset + 1];
if (charsize === 1) {
  node.ch = tree[offset + 2];
  offset += 3;
}
else {
  node.ch = (tree[offset + 2] << 8) + tree[offset + 3];
  offset += 4;
}

if (secondbyte & 4) {
  node.center = getUint24(offset);
  offset += 3;
}

if (secondbyte & 1) {
  node.next = getUint24(offset);
  offset += 3;
}

// We never use the left and right pointers when searching for
// completions, only when checking for an exact word, so don't read
// them if we don't need them.

if (!needLeftAndRight)
  return node;

if (secondbyte & 8) {
  node.left = getUint24(offset);
  offset += 3;
}

if (secondbyte & 2) {
  node.right = getUint24(offset);
  offset += 3;
}

return node;