code: public static Scriptable toObject(Object value, Scriptable scope)
      {
          return ScriptRuntime.toObject(scope, value);
      }
docs: Convert the value to an JavaScript object value.
  <p>
  Note that a scope must be provided to look up the constructors
  for Number, Boolean, and String.
  <p>
  See ECMA 9.9.
  <p>
  Additionally, arbitrary Java objects and classes will be
  wrapped in a Scriptable object with its Java fields and methods
  reflected as JavaScript properties of the object.
  
  @param value any Java object
  @param scope global scope containing constructors for Number,
  Boolean, and String
  @return new JavaScript object