title: How can I get the type of a variable in RHINO?
body: <p>I'm translating some code that use SpiderMonkey to RHINO, 
  and it uses the method JSVAL_IS_INT(val) where 'val' is a jsval(SpiderMonkey code), 
  and I tried to use toNumber(val) of RHINO, where 'val' is an instance of Object, 
  but it seems tha toNumber doesn't check the type of 'val'.</p>
  
  <p>This is the code of a similar case, with toBoolean:</p>
  
  <pre><code>    ContextTest ct = new ContextTest();
      ct.val = "lol";
      System.out.println(Context.toBoolean(ct.val));
      System.out.println(ct.val);
  </code></pre>
  
  <p>This shows:</p>
  
  <pre><code>true
  lol
  </code></pre>
  
  <p>But toBoolean() shouldn't return true.</p>