Skip to content
Browse files

clean this up a bit

Conflicts:

	lib/coffee-script/coffee-script.js
	lib/coffee-script/tame.js
  • Loading branch information...
1 parent 3e577d2 commit 0c2b4671a57e13043f8951611ebb21b168563ddc @maxtaco committed Dec 11, 2011
Showing with 13 additions and 29 deletions.
  1. +3 −5 lib/coffee-script/coffee-script.js
  2. +5 −16 lib/coffee-script/tame.js
  3. +3 −4 src/coffee-script.coffee
  4. +2 −4 src/tame.coffee
View
8 lib/coffee-script/coffee-script.js
@@ -14,8 +14,6 @@
vm = require('vm');
- astTamer = new tame.AstTamer;
-
if (require.extensions) {
require.extensions['.coffee'] = function(module, filename) {
var content;
@@ -39,7 +37,7 @@
exports.compile = compile = function(code, options) {
if (options == null) options = {};
try {
- return (astTamer.transform(parser.parse(lexer.tokenize(code)))).compile(options);
+ return (tame.transform(parser.parse(lexer.tokenize(code)))).compile(options);
} catch (err) {
if (options.filename) {
err.message = "In " + options.filename + ", " + err.message;
@@ -54,9 +52,9 @@
exports.nodes = function(source, options) {
if (typeof source === 'string') {
- return astTamer.transform(parser.parse(lexer.tokenize(source, options)));
+ return tame.transform(parser.parse(lexer.tokenize(source, options)));
} else {
- return astTamer.transform(parser.parse(source));
+ return tame.transform(parser.parse(source));
}
};
View
21 lib/coffee-script/tame.js
@@ -1,21 +1,10 @@
(function() {
- var AstTamer, Deferrals, Rendezvous, makeDeferReturn;
- var __slice = Array.prototype.slice;
+ var Deferrals, Rendezvous, makeDeferReturn,
+ __slice = Array.prototype.slice;
- exports.AstTamer = AstTamer = (function() {
-
- function AstTamer() {
- var rest;
- rest = 1 <= arguments.length ? __slice.call(arguments, 0) : [];
- }
-
- AstTamer.prototype.transform = function(x) {
- return x.tameTransform();
- };
-
- return AstTamer;
-
- })();
+ exports.transform = function(x) {
+ return x.tameTransform();
+ };
exports["const"] = {
k: "__tame_k",
View
7 src/coffee-script.coffee
@@ -13,7 +13,6 @@ path = require 'path'
tame = require './tame'
vm = require 'vm'
-astTamer = new tame.AstTamer
# TODO: Remove registerExtension when fully deprecated.
if require.extensions
@@ -37,7 +36,7 @@ exports.helpers = require './helpers'
exports.compile = compile = (code, options = {}) ->
{merge} = exports.helpers
try
- js = (astTamer.transform parser.parse lexer.tokenize code).compile options
+ js = (tamer.transform parser.parse lexer.tokenize code).compile options
return js unless options.header
catch err
err.message = "In #{options.filename}, #{err.message}" if options.filename
@@ -54,9 +53,9 @@ exports.tokens = (code, options) ->
# or traverse it by using `.traverseChildren()` with a callback.
exports.nodes = (source, options) ->
if typeof source is 'string'
- astTamer.transform parser.parse lexer.tokenize source, options
+ tame.transform parser.parse lexer.tokenize source, options
else
- astTamer.transform parser.parse source
+ tame.transform parser.parse source
# Compile and execute a string of CoffeeScript (on the server), correctly
# setting `__filename`, `__dirname`, and relative `require()`.
View
6 src/tame.coffee
@@ -2,10 +2,8 @@
# =======================================================================
# Compile Time!
#
-exports.AstTamer = class AstTamer
- constructor: (rest...) ->
- transform: (x) ->
- x.tameTransform()
+exports.transform = (x) ->
+ x.tameTransform()
exports.const =
k : "__tame_k"

0 comments on commit 0c2b467

Please sign in to comment.
Something went wrong with that request. Please try again.