   '<table><tr><th><th><th><th></table>' +
    '<table></table>';
  const result = nodesetToSet(doc.evaluate('(//table)[count((//table)[2]/descendant::th)-1]', doc.documentElement));
  assert_equals(result.size, 1);
  assert_true(result.has(doc.body.lastChild));
}, 'An expression in a predicate should not change the context node');
</script>
</body>
