Skip to content
This repository has been archived by the owner on Jan 13, 2021. It is now read-only.

Commit

Permalink
Various bug fixes.
Browse files Browse the repository at this point in the history
  • Loading branch information
logancollins committed Aug 8, 2012
1 parent e04ddcb commit ad57f78
Showing 1 changed file with 5 additions and 24 deletions.
29 changes: 5 additions & 24 deletions Mocha/Utilities/MOUtilities.m
Expand Up @@ -16,6 +16,7 @@
#import "MOFunctionArgument.h"
#import "MOUndefined.h"
#import "MOJavaScriptObject.h"
#import "MOPointerValue.h"
#import "MOPointer_Private.h"

#import "MOBridgeSupportController.h"
Expand Down Expand Up @@ -110,17 +111,6 @@ JSValueRef MOSelectorInvoke(id target, SEL selector, JSContextRef ctx, size_t ar
if ([object isKindOfClass:[MOBox class]]) {
__unsafe_unretained id value = [object representedObject];
[invocation setArgument:&value atIndex:argIndex];
//id representedObject = [object representedObject];
//if ([representedObject isKindOfClass:[MOBox class]]) {
//}
//else if ([object isKindOfClass:[MOFunction class]]) {
// SEL selector = [(MOFunction *)object selector];
// [invocation setArgument:&selector atIndex:argIndex];
//}
//else if ([[(MOPrivateObject *)object type] isEqualToString:@"pointer"]) {
// void * pointer = [[(MOPrivateObject *)object object] pointerValue];
// [invocation setArgument:&pointer atIndex:argIndex];
//}
}

// NSNumber
Expand Down Expand Up @@ -202,25 +192,16 @@ JSValueRef MOSelectorInvoke(id target, SEL selector, JSContextRef ctx, size_t ar
SEL selector = NULL;
[invocation getReturnValue:&selector];
JSObjectRef object = [mocha newPrivateObject];
MOPrivateObject *private = JSObjectGetPrivate(object);
private.type = @"selector";
private.selector = selector;
returnValue = object;
}*/
// void *
/*else if (strcmp(returnType, @encode(void *)) == 0) {
else if (strcmp(returnType, @encode(void *)) == 0) {
void *pointer = NULL;
[invocation getReturnValue:&pointer];

JSObjectRef object = [mocha newPrivateObject];
MOPrivateObject *private = JSObjectGetPrivate(object);
private.type = @"pointer";
private.object = [NSValue valueWithPointer:pointer];
returnValue = object;
}*/
MOPointerValue * __autoreleasing object = [[MOPointerValue alloc] initWithPointerValue:pointer typeEncoding:nil];
returnValue = (__bridge void *)object;
}
// bool
else if (strcmp(returnType, @encode(bool)) == 0
|| strcmp(returnType, @encode(_Bool)) == 0) {
Expand Down

0 comments on commit ad57f78

Please sign in to comment.