Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 54 lines (45 sloc) 1.462 kb
3a8690a Initial native module support
Tom Robinson authored
1 #include <narwhal.h>
2
5d35781 Initial commit of JavaScriptCore support for Narwhal, including optional...
tlrobinson authored
3 #ifdef JSCOCOA
4 #import <JSCocoa/JSCocoa.h>
5 #endif
6
56a175d @tolmasky Added DOMParser and friends through WebKit.
tolmasky authored
7 #ifdef WEBKIT
8 #import <Foundation/Foundation.h>
9 #import <WebKit/WebKit.h>
a00f018 Refactor narwhal-jsc, build webkit-debug version, cleanup Makefile, add ...
tlrobinson authored
10 #elif WEBKIT_DEBUG
11 #import <Foundation/Foundation.h>
12 #import <AppKit/AppKit.h>
13 #import <WebKit/WebKit.h>
14 #import "NWDebug.h"
56a175d @tolmasky Added DOMParser and friends through WebKit.
tolmasky authored
15 #endif
16
096968e Convert more of narwhal-jsc.cc to macros, general cleanup.
Tom Robinson authored
17 int main(int argc, char *argv[], char *envp[])
18 {
6559b59 Fixed no content-length bug in Jill. Fixed exception printing in narwhal...
Tom Robinson authored
19 #ifdef WEBKIT
20 NSAutoreleasePool *pool = [NSAutoreleasePool new];
a00f018 Refactor narwhal-jsc, build webkit-debug version, cleanup Makefile, add ...
tlrobinson authored
21 WebView *webView = [[WebView alloc] init];
22 JSGlobalContextRef _context = [[webView mainFrame] globalContext];
23 #elif WEBKIT_DEBUG
24 NSAutoreleasePool *pool = [NSAutoreleasePool new];
25 WebView *webView = NW_init(argc, argv, envp);
6559b59 Fixed no content-length bug in Jill. Fixed exception printing in narwhal...
Tom Robinson authored
26 JSGlobalContextRef _context = [[webView mainFrame] globalContext];
27 #elif defined(JSCOCOA)
28 NSAutoreleasePool *pool = [NSAutoreleasePool new];
29 JSCocoaController *jsc = [JSCocoa new];
30 JSGlobalContextRef _context = [jsc ctx];
31 #else
32 JSGlobalContextRef _context = JSGlobalContextCreate(NULL);
33 #endif
34
a00f018 Refactor narwhal-jsc, build webkit-debug version, cleanup Makefile, add ...
tlrobinson authored
35 #ifdef WEBKIT_DEBUG
36 return NSApplicationMain(argc, (const char **)argv);
37 #else
38 JSValueRef exception = NULL;
39 JSValueRef *_exception = &exception;
6559b59 Fixed no content-length bug in Jill. Fixed exception printing in narwhal...
Tom Robinson authored
40
a00f018 Refactor narwhal-jsc, build webkit-debug version, cleanup Makefile, add ...
tlrobinson authored
41 CALL(narwhal, argc, argv, envp, 1);
6559b59 Fixed no content-length bug in Jill. Fixed exception printing in narwhal...
Tom Robinson authored
42
d72c76c Refactor initialization
Tom Robinson authored
43 int code = !!(*_exception);
a00f018 Refactor narwhal-jsc, build webkit-debug version, cleanup Makefile, add ...
tlrobinson authored
44
45 #ifdef WEBKIT
46 [pool drain];
47 #elif defined(JSCOCOA)
48 [pool drain];
49 #endif
50
51 return code;
6559b59 Fixed no content-length bug in Jill. Fixed exception printing in narwhal...
Tom Robinson authored
52 #endif
096968e Convert more of narwhal-jsc.cc to macros, general cleanup.
Tom Robinson authored
53 }
Something went wrong with that request. Please try again.