redeyed
Advanced tools
Comparing version 0.4.1 to 0.4.2
{ | ||
"name": "redeyed", | ||
"version": "0.4.1", | ||
"version": "0.4.2", | ||
"description": "Takes JavaScript code, along with a config and returns the original code with tokens wrapped as configured.", | ||
@@ -26,3 +26,3 @@ "author": "Thorsten Lorenz <thlorenz@gmx.de> (thlorenz.com)", | ||
"devDependencies": { | ||
"tap": "~0.3.1", | ||
"tap": "git://github.com/thlorenz/node-tap.git", | ||
"readdirp": "~0.2.1", | ||
@@ -29,0 +29,0 @@ "cardinal": "~0.2.0" |
@@ -12,3 +12,8 @@ ;(function () { | ||
if (typeof define === 'function' && define.amd) { | ||
if (typeof module === 'object' && typeof module.exports === 'object' && typeof require === 'function') { | ||
// server side | ||
esprima = require('esprima'); | ||
exportFn = function (redeyed) { module.exports = redeyed; }; | ||
bootstrap(esprima, exportFn); | ||
} else if (typeof define === 'function' && define.amd) { | ||
// client side | ||
@@ -19,3 +24,2 @@ // amd | ||
}); | ||
} else if (typeof window === 'object') { | ||
@@ -25,8 +29,2 @@ // no amd -> attach to window if it exists | ||
window.redeyed = bootstrap(window.esprima); | ||
} else if (typeof module === 'object' && typeof module.exports === 'object' && typeof require === 'function') { | ||
// server side | ||
esprima = require('esprima'); | ||
exportFn = function (redeyed) { module.exports = redeyed; }; | ||
bootstrap(esprima, exportFn); | ||
} | ||
@@ -33,0 +31,0 @@ |
@@ -20,2 +20,4 @@ 'use strict' | ||
// TODO: need to run in vm in order to properly simulate require and module not being present | ||
return; | ||
test('define and window exist', function (t) { | ||
@@ -22,0 +24,0 @@ var defineCb |
52548
1312