]> git.saurik.com Git - cycript.git/blobdiff - Execute.cpp
Correct a simple typo in a thrown exception message.
[cycript.git] / Execute.cpp
index 0bb732cfcb4d8ae5566d6404adfdeaabba773cde..4f7358a68dd85ec077e7515b07ed2d192f57e326 100644 (file)
@@ -947,12 +947,12 @@ static JSValueRef Functor_callAsFunction(JSContextRef context, JSObjectRef objec
     return CYCallFunction(pool, context, 0, NULL, count, arguments, false, exception, &internal->signature_, &internal->cif_, internal->GetValue());
 }
 
-static JSObjectRef CYMakeType(JSContextRef context, const char *type) {
+JSObjectRef CYMakeType(JSContextRef context, const char *type) {
     Type_privateData *internal(new Type_privateData(type));
     return JSObjectMake(context, Type_privateData::Class_, internal);
 }
 
-static JSObjectRef CYMakeType(JSContextRef context, sig::Type *type) {
+JSObjectRef CYMakeType(JSContextRef context, sig::Type *type) {
     Type_privateData *internal(new Type_privateData(type));
     return JSObjectMake(context, Type_privateData::Class_, internal);
 }
@@ -1091,7 +1091,7 @@ static JSValueRef Type_callAsFunction(JSContextRef context, JSObjectRef object,
 
 static JSObjectRef Type_callAsConstructor(JSContextRef context, JSObjectRef object, size_t count, const JSValueRef arguments[], JSValueRef *exception) { CYTry {
     if (count != 0)
-        throw CYJSError(context, "incorrect number of arguments to type cast function");
+        throw CYJSError(context, "incorrect number of arguments to Type allocator");
     Type_privateData *internal(reinterpret_cast<Type_privateData *>(JSObjectGetPrivate(object)));
 
     sig::Type *type(internal->type_);
@@ -1469,12 +1469,7 @@ extern "C" void CYSetupContext(JSGlobalContextRef context) {
     CYSetProperty(context, cycript, CYJSString("Functor"), Functor);
 
     CYSetProperty(context, cycript, CYJSString("Pointer"), JSObjectMakeConstructor(context, Pointer_, &Pointer_new));
-
-    JSObjectRef Type(JSObjectMakeConstructor(context, Type_privateData::Class_, &Type_new));
-    CYSetProperty(context, cycript, CYJSString("Type"), Type);
-
-    JSObjectRef Type_prototype(CYCastJSObject(context, CYGetProperty(context, Type, prototype_s)));
-    CYSetProperty(context, cy, CYJSString("Type_prototype"), Type_prototype);
+    CYSetProperty(context, cycript, CYJSString("Type"), JSObjectMakeConstructor(context, Type_privateData::Class_, &Type_new));
 
     JSObjectRef all(JSObjectMake(context, All_, NULL));
     CYSetProperty(context, cycript, CYJSString("all"), all);