]> git.saurik.com Git - cycript.git/blobdiff - Java/Cycript.java
Have console pre-initialize engine to feel faster.
[cycript.git] / Java / Cycript.java
index d2349562c11e84ab146a67dc843033ff05c64af4..79ebe8e29109e79b0b9e6b885da24155a7ee8bea 100644 (file)
@@ -1,5 +1,5 @@
-/* Cycript - Optimizing JavaScript Compiler/Runtime
- * Copyright (C) 2009-2015  Jay Freeman (saurik)
+/* Cycript - The Truly Universal Scripting Language
+ * Copyright (C) 2009-2016  Jay Freeman (saurik)
 */
 
 /* GNU Affero General Public License, Version 3 {{{ */
@@ -43,6 +43,7 @@ public static native Object handle(long protect, String property, Object[] argum
     throws Throwable;
 
 public static class Wrapper
+    extends RuntimeException
     implements InvocationHandler
 {
     private long protect_;
@@ -61,6 +62,18 @@ public static class Wrapper
         return protect_;
     }
 
+    public Object call(String property, Object[] arguments) {
+        try {
+            return handle(protect_, property, arguments);
+        } catch (Throwable throwable) {
+            return new RuntimeException(throwable);
+        }
+    }
+
+    public String toString() {
+        return call("toString", null).toString();
+    }
+
     public Object invoke(Object proxy, Method method, Object[] args)
         throws Throwable
     {