Permalink
Browse files

don't load up a yui - just gaurd the window.onerror & try/catch

  • Loading branch information...
zzo committed Aug 29, 2011
1 parent 4836941 commit 00d55e9399aa0291a3d467f7c9c0e63d11d6a9d8
Showing with 5 additions and 4 deletions.
  1. +4 −3 backend/nodejute/jute/server.js
  2. +1 −1 backend/nodejute/package.json
@@ -150,6 +150,7 @@ Create: function(hub) {
var mime = require('mime'),
efun = "\
+if (typeof(YUI) == 'object') {\
YUI().use('io-base', 'json-stringify', function(Y) {\
var output = a, from='try/catch';\
if (typeof(b) != 'undefined') {\
@@ -173,7 +174,7 @@ YUI().use('io-base', 'json-stringify', function(Y) {\
headers: { 'Content-Type': 'application/x-www-form-urlencoded' }\
}\
);\
-});",
+});}",
yuiConfig = "YUI_config = {loadErrorFn: function(a,b,c) { " + efun + "}, errorFn: function(a, b, c) { " + efun + " } };";
fs.stat(path, function(err, stat) {
@@ -228,8 +229,7 @@ YUI().use('io-base', 'json-stringify', function(Y) {\
res.end(file);
} else if (type.match(/html/i)) {
var file = fs.readFileSync(path, 'utf8'),
- err = '<script src="http://yui.yahooapis.com/3.3.0/build/yui/yui.js"></script>' +
- '<script>window.onerror=function(a,b,c){' + efun + '};</script>';
+ err = '<script>window.onerror=function(a,b,c){' + efun + '};</script>';
res.setHeader('Content-Length', res.getHeader('Content-Length') + err.length);
res.write(err);
@@ -242,3 +242,4 @@ YUI().use('io-base', 'json-stringify', function(Y) {\
}
};
+
@@ -2,7 +2,7 @@
"name": "jute",
"description": "Javascript Unit Test Environment",
"keywords": ["selenium", "test", "testing", "unit", "tests"],
- "version": "0.0.49",
+ "version": "0.0.50",
"author": "Mark Ethan Trostler <mark@zzo.com>",
"preferGlobal": true,
"bin" : {

0 comments on commit 00d55e9

Please sign in to comment.