X-Git-Url: https://git.saurik.com/cycript.git/blobdiff_plain/aaa4a269e00843e8a21ef26d09604d4e357dfb69..9772d9bfeff32f00eb6a2c38f11b01530e47482b:/ObjectiveC/Library.mm diff --git a/ObjectiveC/Library.mm b/ObjectiveC/Library.mm index 2cef380..957c80c 100644 --- a/ObjectiveC/Library.mm +++ b/ObjectiveC/Library.mm @@ -1244,7 +1244,7 @@ JSValueRef CYCastJSValue(JSContextRef context, NSObject *value) { CYPoolTry { JSValueRef exception(NULL); JSValueRef arguments[1]; arguments[0] = CYCastJSValue(context_, (NSObject *) object); - JSObjectRef Array(CYGetCachedObject(context_, Array_s)); + JSObjectRef Array(CYGetCachedObject(context_, CYJSString("Array_prototype"))); JSObjectCallAsFunction(context_, CYCastJSObject(context_, CYGetProperty(context_, Array, push_s)), object_, 1, arguments, &exception); CYThrow(context_, exception); } CYObjectiveCatch } @@ -1258,14 +1258,14 @@ JSValueRef CYCastJSValue(JSContextRef context, NSObject *value) { CYPoolTry { arguments[0] = CYCastJSValue(context_, index); arguments[1] = CYCastJSValue(context_, 0); arguments[2] = CYCastJSValue(context_, (NSObject *) object); - JSObjectRef Array(CYGetCachedObject(context_, Array_s)); + JSObjectRef Array(CYGetCachedObject(context_, CYJSString("Array_prototype"))); JSObjectCallAsFunction(context_, CYCastJSObject(context_, CYGetProperty(context_, Array, splice_s)), object_, 3, arguments, &exception); CYThrow(context_, exception); } CYObjectiveCatch } - (void) removeLastObject { CYObjectiveTry { JSValueRef exception(NULL); - JSObjectRef Array(CYGetCachedObject(context_, Array_s)); + JSObjectRef Array(CYGetCachedObject(context_, CYJSString("Array_prototype"))); JSObjectCallAsFunction(context_, CYCastJSObject(context_, CYGetProperty(context_, Array, pop_s)), object_, 0, NULL, &exception); CYThrow(context_, exception); } CYObjectiveCatch } @@ -1278,7 +1278,7 @@ JSValueRef CYCastJSValue(JSContextRef context, NSObject *value) { CYPoolTry { JSValueRef arguments[2]; arguments[0] = CYCastJSValue(context_, index); arguments[1] = CYCastJSValue(context_, 1); - JSObjectRef Array(CYGetCachedObject(context_, Array_s)); + JSObjectRef Array(CYGetCachedObject(context_, CYJSString("Array_prototype"))); JSObjectCallAsFunction(context_, CYCastJSObject(context_, CYGetProperty(context_, Array, splice_s)), object_, 2, arguments, &exception); CYThrow(context_, exception); } CYObjectiveCatch } @@ -2221,7 +2221,7 @@ static JSValueRef Instance_getProperty_constructor(JSContextRef context, JSObjec return Instance::Make(context, (id) object_getClass(internal->GetValue())); } -static JSValueRef Instance_getProperty_protocol(JSContextRef context, JSObjectRef object, JSStringRef property, JSValueRef *exception) { CYTry { +static JSValueRef Instance_getProperty_prototype(JSContextRef context, JSObjectRef object, JSStringRef property, JSValueRef *exception) { CYTry { Instance *internal(reinterpret_cast(JSObjectGetPrivate(object))); id self(internal->GetValue()); if (!CYIsClass(self)) @@ -2344,7 +2344,7 @@ static JSStaticValue Selector_staticValues[2] = { static JSStaticValue Instance_staticValues[5] = { {"constructor", &Instance_getProperty_constructor, NULL, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete}, {"messages", &Instance_getProperty_messages, NULL, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete}, - {"prototype", &Instance_getProperty_protocol, NULL, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete}, + {"prototype", &Instance_getProperty_prototype, NULL, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete}, {"value", &CYValue_getProperty_value, NULL, kJSPropertyAttributeReadOnly | kJSPropertyAttributeDontEnum | kJSPropertyAttributeDontDelete}, {NULL, NULL, NULL, 0} };