]> git.saurik.com Git - cycript.git/commitdiff
Fixed cycript.all for Cydget and isolated the new function namespaces (as I hate...
authorJay Freeman (saurik) <saurik@saurik.com>
Mon, 9 Nov 2009 06:32:53 +0000 (06:32 +0000)
committerJay Freeman (saurik) <saurik@saurik.com>
Mon, 9 Nov 2009 06:32:53 +0000 (06:32 +0000)
Console.cpp
Library.cpp

index fad7dda7d9633d7f22a7d72f80c86d36fb325f05..a6a1c544dcef60b2e33174a35b9690f7fcbb1bb4 100644 (file)
@@ -332,7 +332,8 @@ static void Console(apr_pool_t *pool, int client) {
 
         if (debug)
             std::cout << code << std::endl;
-        code = "with(Cycript.all){" + code + "}";
+        if (!bypass)
+            code = "with(Cycript.all){" + code + "}";
 
         Run(client, code, fout, expand);
     }
index df3a95a259a37194e8d11dac18ae6f8721c8710f..2c6e31bcb73f83d929e62378deb5597541a6ce5c 100644 (file)
@@ -1464,7 +1464,26 @@ const char *CYExecute(apr_pool_t *pool, const char *code) {
     return json;
 }
 
-extern "C" void CYParseWebCore(apr_pool_t *pool, const uint16_t **data, size_t *size) {
+extern "C" void CydgetSetupContext(JSGlobalContextRef context) {
+    CYSetupContext(context);
+
+    JSObjectRef last(NULL);
+    JSObjectRef curr(CYGetGlobalObject(context));
+
+    goto next; for (JSValueRef next;;) {
+        if (JSValueIsNull(context, next))
+            break;
+        last = curr;
+        curr = CYCastJSObject(context, next);
+      next:
+        next = JSObjectGetPrototype(context, curr);
+    }
+
+    JSObjectRef all(JSObjectMake(context, All_, NULL));
+    JSObjectSetPrototype(context, last, all);
+}
+
+extern "C" void CydgetPoolParse(apr_pool_t *pool, const uint16_t **data, size_t *size) {
     CYDriver driver("");
     cy::parser parser(driver);