Skip to content

Commit

Permalink
Hey, it's mostly stopped crashing all the time now!
Browse files Browse the repository at this point in the history
  • Loading branch information
ccgus committed Sep 27, 2010
1 parent c4f18d9 commit 06d1f04
Show file tree
Hide file tree
Showing 17 changed files with 596 additions and 236 deletions.
32 changes: 22 additions & 10 deletions jstalk.xcodeproj/project.pbxproj
Expand Up @@ -217,6 +217,10 @@
CC69B5831245536600E735F6 /* JSTRuntimeInfo.m in Sources */ = {isa = PBXBuildFile; fileRef = CC09CB521242C91F00B41D15 /* JSTRuntimeInfo.m */; };
CC725EB91238026D00EA83BF /* TETextUtils.h in Headers */ = {isa = PBXBuildFile; fileRef = CC725EB71238026D00EA83BF /* TETextUtils.h */; };
CC725EBA1238026D00EA83BF /* TETextUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = CC725EB81238026D00EA83BF /* TETextUtils.m */; };
CC7528F3124FE64D005546B0 /* JSTFunction.h in Headers */ = {isa = PBXBuildFile; fileRef = CC7528F1124FE64D005546B0 /* JSTFunction.h */; };
CC7528F4124FE64D005546B0 /* JSTFunction.m in Sources */ = {isa = PBXBuildFile; fileRef = CC7528F2124FE64D005546B0 /* JSTFunction.m */; };
CC75296E1250066F005546B0 /* JSTTests.h in Headers */ = {isa = PBXBuildFile; fileRef = CC75296C1250066F005546B0 /* JSTTests.h */; };
CC75296F1250066F005546B0 /* JSTTests.m in Sources */ = {isa = PBXBuildFile; fileRef = CC75296D1250066F005546B0 /* JSTTests.m */; };
CC7576B40F6DF3B7003AE279 /* JSTFileWatcher.m in Sources */ = {isa = PBXBuildFile; fileRef = CC7576B30F6DF3B7003AE279 /* JSTFileWatcher.m */; };
CC8CF98F0F46521000C32090 /* JSTExtras.m in Sources */ = {isa = PBXBuildFile; fileRef = CC4143C00F2529F200E46669 /* JSTExtras.m */; };
CC94E0520F4A616300208BE0 /* JSTalk.icns in Resources */ = {isa = PBXBuildFile; fileRef = CC94E0510F4A616300208BE0 /* JSTalk.icns */; };
Expand All @@ -238,8 +242,8 @@
CCC5B8CD0F1EFAAA00126722 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = CCC5B8CC0F1EFAAA00126722 /* main.m */; };
CCC5B8D00F1EFABA00126722 /* JSTDocument.m in Sources */ = {isa = PBXBuildFile; fileRef = CCC5B8CE0F1EFABA00126722 /* JSTDocument.m */; };
CCC5B94E0F1EFC4500126722 /* JSTAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = CCC5B94D0F1EFC4500126722 /* JSTAppDelegate.m */; };
CCD7C530124D674A00657984 /* JSTClosure.h in Headers */ = {isa = PBXBuildFile; fileRef = CCD7C52E124D674A00657984 /* JSTClosure.h */; };
CCD7C531124D674A00657984 /* JSTClosure.m in Sources */ = {isa = PBXBuildFile; fileRef = CCD7C52F124D674A00657984 /* JSTClosure.m */; };
CCCA67A11250422700522EFA /* JSTFunction.m in Sources */ = {isa = PBXBuildFile; fileRef = CC7528F2124FE64D005546B0 /* JSTFunction.m */; };
CCCA67A31250422900522EFA /* JSTUtils.m in Sources */ = {isa = PBXBuildFile; fileRef = CCB5EB0F124D922E0052BCD9 /* JSTUtils.m */; };
CCE16C3E12188AE500F6D312 /* JSTPluginMover.m in Sources */ = {isa = PBXBuildFile; fileRef = CCE16C3D12188AE500F6D312 /* JSTPluginMover.m */; };
CCE16C8312188F5000F6D312 /* JSTDocumentController.m in Sources */ = {isa = PBXBuildFile; fileRef = CCE16C8212188F5000F6D312 /* JSTDocumentController.m */; };
CCF68F1E0F4E3E4F00925FCA /* JSTalkDocument.icns in Resources */ = {isa = PBXBuildFile; fileRef = CCF68F1D0F4E3E4F00925FCA /* JSTalkDocument.icns */; };
Expand Down Expand Up @@ -465,6 +469,10 @@
CC5FB7D70F1FDDE900F4ECC2 /* JSTalk.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = JSTalk.m; path = src/JSTalk.m; sourceTree = "<group>"; };
CC725EB71238026D00EA83BF /* TETextUtils.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = TETextUtils.h; path = src/TETextUtils.h; sourceTree = "<group>"; };
CC725EB81238026D00EA83BF /* TETextUtils.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = TETextUtils.m; path = src/TETextUtils.m; sourceTree = "<group>"; };
CC7528F1124FE64D005546B0 /* JSTFunction.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSTFunction.h; path = src/JSTFunction.h; sourceTree = "<group>"; };
CC7528F2124FE64D005546B0 /* JSTFunction.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = JSTFunction.m; path = src/JSTFunction.m; sourceTree = "<group>"; };
CC75296C1250066F005546B0 /* JSTTests.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSTTests.h; path = src/JSTTests.h; sourceTree = "<group>"; };
CC75296D1250066F005546B0 /* JSTTests.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = JSTTests.m; path = src/JSTTests.m; sourceTree = "<group>"; };
CC7576B20F6DF3B7003AE279 /* JSTFileWatcher.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSTFileWatcher.h; path = src/JSTFileWatcher.h; sourceTree = "<group>"; };
CC7576B30F6DF3B7003AE279 /* JSTFileWatcher.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = JSTFileWatcher.m; path = src/JSTFileWatcher.m; sourceTree = "<group>"; };
CC94E0510F4A616300208BE0 /* JSTalk.icns */ = {isa = PBXFileReference; lastKnownFileType = image.icns; name = JSTalk.icns; path = res/images/JSTalk.icns; sourceTree = "<group>"; };
Expand All @@ -489,8 +497,6 @@
CCC5B94D0F1EFC4500126722 /* JSTAppDelegate.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = JSTAppDelegate.m; path = src/JSTAppDelegate.m; sourceTree = "<group>"; };
CCC5B95A0F1EFCFE00126722 /* JSTListener.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSTListener.h; path = src/JSTListener.h; sourceTree = "<group>"; };
CCC5B95B0F1EFCFE00126722 /* JSTListener.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = JSTListener.m; path = src/JSTListener.m; sourceTree = "<group>"; };
CCD7C52E124D674A00657984 /* JSTClosure.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSTClosure.h; path = src/JSTClosure.h; sourceTree = "<group>"; };
CCD7C52F124D674A00657984 /* JSTClosure.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = JSTClosure.m; path = src/JSTClosure.m; sourceTree = "<group>"; };
CCE16C3C12188AE500F6D312 /* JSTPluginMover.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSTPluginMover.h; path = src/JSTPluginMover.h; sourceTree = "<group>"; };
CCE16C3D12188AE500F6D312 /* JSTPluginMover.m */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.objc; name = JSTPluginMover.m; path = src/JSTPluginMover.m; sourceTree = "<group>"; };
CCE16C8112188F5000F6D312 /* JSTDocumentController.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; name = JSTDocumentController.h; path = src/JSTDocumentController.h; sourceTree = "<group>"; };
Expand Down Expand Up @@ -629,19 +635,21 @@
children = (
CCC5B92C0F1EFB5900126722 /* JSCocoa */,
CC5FB7D60F1FDDE900F4ECC2 /* JSTalk.h */,
CCB5EB0E124D922E0052BCD9 /* JSTUtils.h */,
CCB5EB0F124D922E0052BCD9 /* JSTUtils.m */,
CC5FB7D70F1FDDE900F4ECC2 /* JSTalk.m */,
CC3CC7F1124C3406001A349E /* JSTBridge.h */,
CC3CC7F2124C3406001A349E /* JSTBridge.m */,
CCD7C52E124D674A00657984 /* JSTClosure.h */,
CCD7C52F124D674A00657984 /* JSTClosure.m */,
CC4143C10F2529F200E46669 /* JSTExtras.h */,
CC4143C00F2529F200E46669 /* JSTExtras.m */,
CC7528F1124FE64D005546B0 /* JSTFunction.h */,
CC7528F2124FE64D005546B0 /* JSTFunction.m */,
CCC5B95A0F1EFCFE00126722 /* JSTListener.h */,
CCC5B95B0F1EFCFE00126722 /* JSTListener.m */,
CC975BC60F47E5BD00097108 /* JSTPreprocessor.h */,
CC975BC70F47E5BD00097108 /* JSTPreprocessor.m */,
CC75296C1250066F005546B0 /* JSTTests.h */,
CC75296D1250066F005546B0 /* JSTTests.m */,
CCB5EB0E124D922E0052BCD9 /* JSTUtils.h */,
CCB5EB0F124D922E0052BCD9 /* JSTUtils.m */,
CC4184501244773A004144B7 /* MA */,
CC1C7D200F48BB2C007A2941 /* todparsekit */,
CC5064DE0F4A155000F4A952 /* UIWidgets */,
Expand Down Expand Up @@ -922,8 +930,9 @@
CC41845F12447743004144B7 /* RTUnregisteredClass.h in Headers */,
CC41857112448360004144B7 /* MABlockClosure.h in Headers */,
CC3CC7F3124C3406001A349E /* JSTBridge.h in Headers */,
CCD7C530124D674A00657984 /* JSTClosure.h in Headers */,
CCB5EB10124D922E0052BCD9 /* JSTUtils.h in Headers */,
CC7528F3124FE64D005546B0 /* JSTFunction.h in Headers */,
CC75296E1250066F005546B0 /* JSTTests.h in Headers */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1156,8 +1165,9 @@
CC41846012447743004144B7 /* RTUnregisteredClass.m in Sources */,
CC41857212448360004144B7 /* MABlockClosure.m in Sources */,
CC3CC7F4124C3406001A349E /* JSTBridge.m in Sources */,
CCD7C531124D674A00657984 /* JSTClosure.m in Sources */,
CCB5EB11124D922E0052BCD9 /* JSTUtils.m in Sources */,
CC7528F4124FE64D005546B0 /* JSTFunction.m in Sources */,
CC75296F1250066F005546B0 /* JSTTests.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -1232,6 +1242,8 @@
CCA9C2261241D7E5003EB4C5 /* JSTBridgedObject.m in Sources */,
CC69B5831245536600E735F6 /* JSTRuntimeInfo.m in Sources */,
CC3CC7FB124C3416001A349E /* JSTBridge.m in Sources */,
CCCA67A11250422700522EFA /* JSTFunction.m in Sources */,
CCCA67A31250422900522EFA /* JSTUtils.m in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
75 changes: 24 additions & 51 deletions res/JSTalk.bridgesupport
Expand Up @@ -2,65 +2,38 @@
<!DOCTYPE signatures SYSTEM "file://localhost/System/Library/DTDs/BridgeSupport.dtd">
<signatures version='0.9'>

<!--
<function name='jsobjc_msgSend' variadic='true'>
<arg type='@'/>
<arg type=':'/>
<retval type='@'/>
</function>
-->

<function name='objc_msgSend' variadic='true'>
<arg type='@'/>
<arg type=':'/>
<retval type='@'/>
</function>

<!--
<function name='jsobjc_msgSend1'>
<arg type='@'/>
<arg type=':'/>
<arg type='^'/>
<retval type='@'/>
<arg type='@'/>
<arg type=':'/>
<retval type='@'/>
</function>
-->

<!--
<class name='JSTalk'>
<method selector='print:' class_method='true'>
<arg name='aString' declared_type='NSString*' type='@' index='0'/>
</method>
</class>
-->

<class name='JSTClosure'>
<method selector='testBoolValue'>
<retval declared_type='BOOL' type='B'/>
</method>

<method selector='testClassBoolValue' class_method='true'>
<retval declared_type='BOOL' type='B'/>
</method>

<method selector='testStringValue'>
<retval declared_type='NSString*' type='@'/>
</method>
<class name='JSTTests'>
<method selector='testBoolValue'>
<retval declared_type='BOOL' type='B'/>
</method>

<method selector='testClassStringValue' class_method='true'>
<retval declared_type='NSString*' type='@'/>
</method>
<method selector='testClassBoolValue' class_method='true'>
<retval declared_type='BOOL' type='B'/>
</method>

<method selector='testAppendString'>
<arg name='aString' declared_type='NSString*' type='@' index='0'/>
<retval declared_type='NSString*' type='@'/>
</method>
<method selector='testStringValue'>
<retval declared_type='NSString*' type='@'/>
</method>

<method selector='testClassAppendString' class_method='true'>
<arg name='aString' declared_type='NSString*' type='@' index='0'/>
<retval declared_type='NSString*' type='@'/>
</method>
<method selector='testClassStringValue' class_method='true'>
<retval declared_type='NSString*' type='@'/>
</method>

<method selector='testAppendString'>
<arg name='aString' declared_type='NSString*' type='@' index='0'/>
<retval declared_type='NSString*' type='@'/>
</method>

<method selector='testClassAppendString' class_method='true'>
<arg name='aString' declared_type='NSString*' type='@' index='0'/>
<retval declared_type='NSString*' type='@'/>
</method>
</class>


Expand Down
16 changes: 8 additions & 8 deletions src/JSCocoaController.m
Expand Up @@ -2654,7 +2654,7 @@ JSValueRef OSXObject_getProperty(JSContextRef ctx, JSObjectRef object, JSStringR


// Let's see if it's a function
if ([bridgedObjectInfo objectType] == JSTFunction) {
if ([bridgedObjectInfo jstType] == JSTTypeFunction) {
JSObjectRef jsRef = [JSCocoaController jsCocoaPrivateFunctionInContext:ctx];
JSTBridgedObject* private = JSObjectGetPrivate(jsRef);
//private.type = @"function";
Expand All @@ -2667,7 +2667,7 @@ JSValueRef OSXObject_getProperty(JSContextRef ctx, JSObjectRef object, JSStringR
}

// ok, is it a struct maybe?
else if ([bridgedObjectInfo objectType] == JSTStruct) {
else if ([bridgedObjectInfo jstType] == JSTTypeStruct) {
JSObjectRef jsRef = [JSCocoaController jsCocoaPrivateObjectInContext:ctx];
JSTBridgedObject* private = JSObjectGetPrivate(jsRef);
//private.type = @"struct";
Expand All @@ -2677,7 +2677,7 @@ JSValueRef OSXObject_getProperty(JSContextRef ctx, JSObjectRef object, JSStringR
}

// How about a constant?
else if (([bridgedObjectInfo objectType] == JSTConstant)) {
else if (([bridgedObjectInfo jstType] == JSTTypeConstant)) {

debug(@"[bridgedObjectInfo typeEncoding]: '%@'", [bridgedObjectInfo typeEncoding]);

Expand Down Expand Up @@ -2721,7 +2721,7 @@ JSValueRef OSXObject_getProperty(JSContextRef ctx, JSObjectRef object, JSStringR
id o = *(id*)symbol;
return [JSCocoaController boxedJSObject:o inContext:ctx];
}
else if ([constInfo objectType] == JSTStruct) {
else if ([constInfo jstType] == JSTTypeStruct) {

debug(@"ok, it's a struct, so I'm doing that thing.");

Expand Down Expand Up @@ -2767,7 +2767,7 @@ JSValueRef OSXObject_getProperty(JSContextRef ctx, JSObjectRef object, JSStringR
}

// Enum
else if ([bridgedObjectInfo objectType] == JSTEnum) {
else if ([bridgedObjectInfo jstType] == JSTTypeEnum) {
debug(@"[bridgedObjectInfo enumValue]: %d", [bridgedObjectInfo enumValue]);
return JSValueMakeNumber(ctx, [bridgedObjectInfo enumValue]);
}
Expand Down Expand Up @@ -3082,7 +3082,7 @@ JSValueRef valueOfCallback(JSContextRef ctx, JSObjectRef function, JSObjectRef t
}

// Struct
if ([[thisPrivateObject runtimeInfo] objectType] == JSTStruct)// .type isEqualToString:@"struct"])
if ([[thisPrivateObject runtimeInfo] jstType] == JSTTypeStruct)// .type isEqualToString:@"struct"])
{
id structDescription = nil;
id self = [JSCocoaController controllerFromContext:ctx];
Expand Down Expand Up @@ -3223,7 +3223,7 @@ static JSValueRef jsCocoaObject_getProperty(JSContextRef ctx, JSObjectRef object
JSCocoaController* jsc = [JSCocoaController controllerFromContext:ctx];
id delegate = jsc.delegate;

if ([runtimeInfo objectType] == JSTStruct) {
if ([runtimeInfo jstType] == JSTTypeStruct) {
debug(@"IT'S A FUCKING STRUCT!");


Expand Down Expand Up @@ -4009,7 +4009,7 @@ static bool jsCocoaObject_setProperty(JSContextRef ctx, JSObjectRef object, JSSt
if ([bridgedObject.type isEqualToString:@"struct"]) {
debug(@"bridgedObject: '%@'", bridgedObject);
//assert([bridgedObject runtimeInfo]);
//if ([[bridgedObject runtimeInfo] objectType] == JSTStruct) {
//if ([[bridgedObject runtimeInfo] jstType] == JSTTypeStruct) {
//assert(NO);
return NO;
}
Expand Down

0 comments on commit 06d1f04

Please sign in to comment.