code: protected Object invokeJavascript(String function, Object... args) {
          Object[] jsArgs = new Object[args.length];
          for (int i = 0; i < jsArgs.length; i++) {
              if (args[i] instanceof JavascriptObject) {
                  jsArgs[i] = ((JavascriptObject) args[i]).getJSObject();
              } else if (args[i] instanceof JavascriptEnum) {
                  jsArgs[i] = ((JavascriptEnum) args[i]).getEnumValue();
              } else {
                  jsArgs[i] = args[i];
              }
          }
          return checkUndefined(jsObject.call(function, (Object[]) jsArgs));
      }
docs: Invoke the specified JavaScript function in the JavaScript runtime.
  
  @param function The function to invoke
  @param args Any arguments to pass to the function
  @return The result of the function.