namespacing CoffeeScript in the browser, and sniffing the 'require' function instead of the 'exports' object

This commit is contained in:
Jeremy Ashkenas
2010-02-17 23:15:37 -05:00
parent ff1fd97924
commit 2f6b69b580
12 changed files with 26 additions and 26 deletions

View File

@@ -1,13 +1,13 @@
# Set up for both the browser and the server.
if process?
if require?
process.mixin require 'nodes'
path: require 'path'
lexer: new (require('lexer').Lexer)()
parser: require('parser').parser
else
this.exports: this
exports: this.CoffeeScript: {}
lexer: new Lexer()
parser: exports.parser
parser: this.parser
# Thin wrapper for Jison compatibility around the real lexer.
parser.lexer: {