Ramonskis Blog

A Microblog powered by Octopress

JavaScriptCore on Mac

| Comments

JavaScriptCore is the built-in JavaScript engine for WebKit

You can find it here:

1
$ /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc

You can symlink it somewhere to your $PATH for convenience:

1
$ sudo ln -s /System/Library/Frameworks/JavaScriptCore.framework/Versions/A/Resources/jsc /usr/bin/jsc

Time to test:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
$ jsc --help
Usage: jsc [options] [files] [-- arguments]
  -d         Dumps bytecode (debug builds only)
  -e         Evaluate argument as script code
  -f         Specifies a source file (deprecated)
  -h|--help  Prints this help message
  -i         Enables interactive mode (default if no files are specified)
  -s         Installs signal handlers that exit on a crash (Unix platforms only)

$ jsc
> var foo = "bar";
undefined
> typeof(foo);
string

Changenotes

  • 2012-02-15 created

Comments