Skip to content

Commit

Permalink
pre merge commit
Browse files Browse the repository at this point in the history
  • Loading branch information
parmanoir committed Sep 13, 2009
1 parent 727c80e commit f260b28
Show file tree
Hide file tree
Showing 9 changed files with 213 additions and 5,403 deletions.
18 changes: 9 additions & 9 deletions JSCocoa/JSCocoaController.m
Expand Up @@ -362,8 +362,9 @@ + (NSString*)runningArchitecture
{
#if defined(__ppc__)
return @"PPC";
#elif defined(__ppc64__)
return @"PPC64";
// Unsupported
//#elif defined(__ppc64__)
// return @"PPC64";
#elif defined(__i386__)
return @"i386";
#elif defined(__x86_64__)
Expand Down Expand Up @@ -3381,7 +3382,7 @@ static bool jsCocoaObject_setProperty(JSContextRef ctx, JSObjectRef object, JSSt

// Can't use capitalizedString on the whole string as it will transform
// myValue
// to Myvalue (therby destroying camel letters)
// to Myvalue (thereby destroying camel letters)
// we want MyValue
// NSString* setterName = [NSString stringWithFormat:@"set%@:", [propertyName capitalizedString]];
// Capitalize only first letter
Expand Down Expand Up @@ -4185,12 +4186,6 @@ static void throwException(JSContextRef ctx, JSValueRef* exception, NSString* re
if (isSpeaking) system([[NSString stringWithFormat:@"say \"%@\" &", reason] UTF8String]);
}

// Convert exception to string
JSStringRef jsName = JSStringCreateWithUTF8CString([reason UTF8String]);
JSValueRef jsString = JSValueMakeString(ctx, jsName);
JSStringRelease(jsName);


// Gather call stack
JSValueRef callStackException = NULL;
JSStringRef scriptJS = JSStringCreateWithUTF8CString("return dumpCallStack()");
Expand All @@ -4210,6 +4205,11 @@ static void throwException(JSContextRef ctx, JSValueRef* exception, NSString* re
reason = [NSString stringWithFormat:@"%@\n%@", reason, callStack];
}

// Convert exception to string
JSStringRef jsName = JSStringCreateWithUTF8CString([reason UTF8String]);
JSValueRef jsString = JSValueMakeString(ctx, jsName);
JSStringRelease(jsName);

// Convert to object to allow JavascriptCore to add line and sourceURL
*exception = JSValueToObject(ctx, jsString, NULL);
}
Expand Down
2 changes: 1 addition & 1 deletion Tests/20 pointer to function.js
Expand Up @@ -11,4 +11,4 @@



// throw 'pointer to function'
// throw 'pointer to function'
1 change: 0 additions & 1 deletion Tests/30 obj1 == obj2.js
Expand Up @@ -11,7 +11,6 @@
*/



var obj1 = NSWorkspace.sharedWorkspace
var obj2 = NSWorkspace.sharedWorkspace

Expand Down
2 changes: 2 additions & 0 deletions TestsRunner/ApplicationController.h
Expand Up @@ -13,6 +13,8 @@
@interface ApplicationController : NSObject {

IBOutlet id webViewUsedAsContextSource;
IBOutlet id window;
IBOutlet id textField;

JSCocoa* jsc2;
id topObjects;
Expand Down
23 changes: 21 additions & 2 deletions TestsRunner/ApplicationController.m
Expand Up @@ -60,6 +60,8 @@ - (void)applicationWillTerminate:(id)notif

- (IBAction)runJSTests:(id)sender
{
[textField setStringValue:@"Running Tests ..."];

// Clean up notifications registered by previously run tests
[jsc callJSFunctionNamed:@"resetDelayedTests" withArguments:nil];

Expand Down Expand Up @@ -114,15 +116,27 @@ - (IBAction)runJSTests:(id)sender

if (!b)
{
id str = [NSString stringWithFormat:@"FAILED %@", path];
[textField setStringValue:str];
NSLog(@"!!!!!!!!!!!FAIL %d from %@", runCount, path);
return;
}
else
{
int delayedTestCount = [jsc toInt:[jsc callJSFunctionNamed:@"delayedTestCount" withArguments:nil]];

if (delayedTestCount) NSLog(@"All %d tests ran OK, %d delayed pending", testCount, delayedTestCount);
else NSLog(@"All %d tests ran OK !", testCount);
if (delayedTestCount)
{
id str = [NSString stringWithFormat:@"All %d tests ran OK, %d delayed pending", testCount, delayedTestCount];
NSLog(@"%@", str);
[textField setStringValue:str];
}
else
{
id str = [NSString stringWithFormat:@"All %d tests ran OK !", testCount];
NSLog(@"%@", str);
[textField setStringValue:str];
}
}
}

Expand Down Expand Up @@ -671,5 +685,10 @@ - (void)finishTest37:(BOOL)b
*/
}

- (void)allTestsRanOK
{
[window makeKeyAndOrderFront:nil];
[textField setStringValue:@"All tests ran OK"];
}

@end
113 changes: 102 additions & 11 deletions TestsRunner/English.lproj/MainMenu.xib
Expand Up @@ -1117,7 +1117,7 @@
<object class="NSWindowTemplate" id="972006081">
<int key="NSWindowStyleMask">15</int>
<int key="NSWindowBacking">2</int>
<string key="NSWindowRect">{{335, 512}, {286, 238}}</string>
<string key="NSWindowRect">{{335, 490}, {287, 260}}</string>
<int key="NSWTFlags">1946157056</int>
<string key="NSWindowTitle">JSCocoa Tests Runner</string>
<string key="NSWindowClass">NSWindow</string>
Expand All @@ -1131,7 +1131,7 @@
<object class="NSButton" id="879828882">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{31, 177}, {102, 32}}</string>
<string key="NSFrame">{{31, 199}, {102, 32}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="651220884">
Expand All @@ -1155,7 +1155,7 @@
<object class="NSButton" id="24604618">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{31, 146}, {127, 32}}</string>
<string key="NSFrame">{{31, 168}, {127, 32}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="294957686">
Expand All @@ -1175,7 +1175,7 @@
<object class="NSButton" id="197111648">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{31, 84}, {140, 32}}</string>
<string key="NSFrame">{{31, 106}, {140, 32}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="500837676">
Expand All @@ -1195,7 +1195,7 @@
<object class="NSButton" id="767469091">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{31, 115}, {140, 32}}</string>
<string key="NSFrame">{{31, 137}, {140, 32}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="504028646">
Expand All @@ -1215,7 +1215,7 @@
<object class="NSButton" id="701784859">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{31, 53}, {168, 32}}</string>
<string key="NSFrame">{{31, 75}, {168, 32}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="629598208">
Expand All @@ -1235,7 +1235,7 @@
<object class="NSButton" id="460065620">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{31, 22}, {169, 32}}</string>
<string key="NSFrame">{{31, 44}, {169, 32}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSButtonCell" key="NSCell" id="764919914">
Expand All @@ -1252,8 +1252,44 @@
<int key="NSPeriodicInterval">25</int>
</object>
</object>
<object class="NSTextField" id="835093140">
<reference key="NSNextResponder" ref="439893737"/>
<int key="NSvFlags">268</int>
<string key="NSFrame">{{31, 20}, {239, 12}}</string>
<reference key="NSSuperview" ref="439893737"/>
<bool key="NSEnabled">YES</bool>
<object class="NSTextFieldCell" key="NSCell" id="291550997">
<int key="NSCellFlags">68288064</int>
<int key="NSCellFlags2">272892928</int>
<string key="NSContents"/>
<object class="NSFont" key="NSSupport">
<string key="NSName">LucidaGrande</string>
<double key="NSSize">9</double>
<int key="NSfFlags">3614</int>
</object>
<reference key="NSControlView" ref="835093140"/>
<object class="NSColor" key="NSBackgroundColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
</object>
</object>
<object class="NSColor" key="NSTextColor">
<int key="NSColorSpace">6</int>
<string key="NSCatalogName">System</string>
<string key="NSColorName">controlTextColor</string>
<object class="NSColor" key="NSColor">
<int key="NSColorSpace">3</int>
<bytes key="NSWhite">MAA</bytes>
</object>
</object>
</object>
</object>
</object>
<string key="NSFrameSize">{286, 238}</string>
<string key="NSFrameSize">{287, 260}</string>
<reference key="NSSuperview"/>
</object>
<string key="NSScreenRect">{{0, 0}, {1440, 878}}</string>
Expand Down Expand Up @@ -1854,6 +1890,22 @@
</object>
<int key="connectionID">635</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">window</string>
<reference key="source" ref="451068665"/>
<reference key="destination" ref="972006081"/>
</object>
<int key="connectionID">636</int>
</object>
<object class="IBConnectionRecord">
<object class="IBOutletConnection" key="connection">
<string key="label">textField</string>
<reference key="source" ref="451068665"/>
<reference key="destination" ref="835093140"/>
</object>
<int key="connectionID">639</int>
</object>
</object>
<object class="IBMutableOrderedSet" key="objectRecords">
<object class="NSArray" key="orderedObjects">
Expand Down Expand Up @@ -2444,6 +2496,7 @@
<reference ref="460065620"/>
<reference ref="879828882"/>
<reference ref="24604618"/>
<reference ref="835093140"/>
</object>
<reference key="parent" ref="972006081"/>
</object>
Expand Down Expand Up @@ -2846,6 +2899,20 @@
<reference key="object" ref="294957686"/>
<reference key="parent" ref="24604618"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">637</int>
<reference key="object" ref="835093140"/>
<object class="NSMutableArray" key="children">
<bool key="EncodedWithXMLCoder">YES</bool>
<reference ref="291550997"/>
</object>
<reference key="parent" ref="439893737"/>
</object>
<object class="IBObjectRecord">
<int key="objectID">638</int>
<reference key="object" ref="291550997"/>
<reference key="parent" ref="835093140"/>
</object>
</object>
</object>
<object class="NSMutableDictionary" key="flattenedProperties">
Expand Down Expand Up @@ -3060,6 +3127,8 @@
<string>629.IBPluginDependency</string>
<string>632.IBPluginDependency</string>
<string>633.IBPluginDependency</string>
<string>637.IBPluginDependency</string>
<string>638.IBPluginDependency</string>
<string>72.IBPluginDependency</string>
<string>72.ImportedFromIB2</string>
<string>73.IBPluginDependency</string>
Expand Down Expand Up @@ -3218,11 +3287,11 @@
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>{{511, 286}, {286, 238}}</string>
<string>{{487, 375}, {287, 260}}</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<boolean value="YES"/>
<boolean value="YES"/>
<string>{{511, 286}, {286, 238}}</string>
<string>{{487, 375}, {287, 260}}</string>
<integer value="1"/>
<string>{{33, 99}, {480, 360}}</string>
<string>{3.40282e+38, 3.40282e+38}</string>
Expand Down Expand Up @@ -3297,6 +3366,8 @@
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
<string>com.apple.InterfaceBuilder.CocoaPlugin</string>
<integer value="1"/>
Expand Down Expand Up @@ -3339,7 +3410,7 @@
</object>
</object>
<nil key="sourceID"/>
<int key="maxID">635</int>
<int key="maxID">639</int>
</object>
<object class="IBClassDescriber" key="IBDocument.Classes">
<object class="NSMutableArray" key="referencedPartialClassDescriptions">
Expand Down Expand Up @@ -3372,13 +3443,17 @@
<bool key="EncodedWithXMLCoder">YES</bool>
<object class="NSArray" key="dict.sortedKeys">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>textField</string>
<string>topObjects</string>
<string>webViewUsedAsContextSource</string>
<string>window</string>
</object>
<object class="NSMutableArray" key="dict.values">
<bool key="EncodedWithXMLCoder">YES</bool>
<string>id</string>
<string>id</string>
<string>id</string>
<string>id</string>
</object>
</object>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
Expand Down Expand Up @@ -3865,6 +3940,22 @@
<string key="minorKey">AppKit.framework/Headers/NSText.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSTextField</string>
<string key="superclassName">NSControl</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSTextField.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSTextFieldCell</string>
<string key="superclassName">NSActionCell</string>
<object class="IBClassDescriptionSource" key="sourceIdentifier">
<string key="majorKey">IBFrameworkSource</string>
<string key="minorKey">AppKit.framework/Headers/NSTextFieldCell.h</string>
</object>
</object>
<object class="IBPartialClassDescription">
<string key="className">NSTextView</string>
<string key="superclassName">NSText</string>
Expand Down

0 comments on commit f260b28

Please sign in to comment.