Skip to content

Commit

Permalink
don't load up a yui - just gaurd the window.onerror & try/catch
Browse files Browse the repository at this point in the history
  • Loading branch information
zzo committed Aug 29, 2011
1 parent 4836941 commit 00d55e9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions backend/nodejute/jute/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -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') {\
Expand All @@ -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) {
Expand Down Expand Up @@ -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);
Expand All @@ -242,3 +242,4 @@ YUI().use('io-base', 'json-stringify', function(Y) {\
}
};


2 changes: 1 addition & 1 deletion backend/nodejute/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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" : {
Expand Down

0 comments on commit 00d55e9

Please sign in to comment.