if (debug)
std::cout << code << std::endl;
- if (!bypass)
- code = "with(Cycript.all){" + code + "}";
Run(client, code, fout, expand);
}
} else if (driver.program_ != NULL)
if (client != -1) {
std::string code(start, end-start);
- code = "with(Cycript.all){" + code + "}";
Run(client, code, stdout);
} else {
std::ostringstream str;
std::string code(str.str());
if (compile)
std::cout << code;
- else {
- code = "with(Cycript.all){" + code + "}";
+ else
Run(client, code, stdout);
- }
}
}
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) {
JSObjectRef all(JSObjectMake(context, All_, NULL));
CYSetProperty(context, cycript, CYJSString("all"), all);
+ JSObjectRef last(NULL), curr(global);
+
+ goto next; for (JSValueRef next;;) {
+ if (JSValueIsNull(context, next))
+ break;
+ last = curr;
+ curr = CYCastJSObject(context, next);
+ next:
+ next = JSObjectGetPrototype(context, curr);
+ }
+
+ JSObjectSetPrototype(context, last, all);
+
CYSetProperty(context, global, CYJSString("$cyq"), &$cyq);
JSObjectRef System(JSObjectMake(context, NULL, NULL));
if (context_ == NULL) {
context_ = JSGlobalContextCreate(Global_);
CYSetupContext(context_);
- JSObjectSetPrototype(context_, CYGetGlobalObject(context_), JSObjectMake(context_, All_, NULL));
}
return context_;
CYSetProperty(context, cycript, CYJSString("Super"), Super);
#if defined(__APPLE__) && defined(__arm__)
- CYSetProperty(context, all, CYJSString("objc_registerClassPair"), &objc_registerClassPair_);
+ CYSetProperty(context, all, CYJSString("objc_registerClassPair"), &objc_registerClassPair_, kJSPropertyAttributeDontEnum);
#endif
- CYSetProperty(context, all, CYJSString("objc_msgSend"), &$objc_msgSend);
+ CYSetProperty(context, all, CYJSString("objc_msgSend"), &$objc_msgSend, kJSPropertyAttributeDontEnum);
JSObjectRef Function_prototype(CYGetCachedObject(context, CYJSString("Function_prototype")));
JSObjectSetPrototype(context, CYCastJSObject(context, CYGetProperty(context, Message, prototype_s)), Function_prototype);