Table of Contents

Introduction

This is the README file for the JavaScript Reference (JSRef, now better known as SpiderMonkey) implementation. It consists of build conventions and instructions, source code conventions, a design walk-through, and a brief file-by-file description of the source.

JSRef builds a library or DLL containing the JavaScript runtime (compiler, interpreter, decompiler, garbage collector, atom manager, standard classes). It then compiles a small "shell" program and links that with the library to make an interpreter that can be used interactively and with test .js files to run scripts.  The code has no dependencies on the rest of the Mozilla codebase.

Quick start tip: skip to "Using the JS API" below, build the js shell, and play with the object named "it" (start by setting 'it.noisy = true').

Build conventions (standalone JS engine and shell) (OUT OF DATE!)

These build directions refer only to building the standalone JavaScript engine and shell.  To build within the browser, refer to the build directions on the mozilla.org website.

By default, all platforms build a version of the JS engine that is not threadsafe.  If you require thread-safety, you must also populate the mozilla/dist directory with NSPR headers and libraries.  (NSPR implements a portable threading library, among other things.  The source is downloadable via CVS from mozilla/nsprpub.)  Next, you must define JS_THREADSAFE when building the JS engine, either on the command-line (gmake/nmake) or in a universal header file.

Windows

Macintosh

Unix

Debugging notes