1
0
Fork 0
This commit is contained in:
Alan Plum 2015-06-16 14:54:14 +02:00
parent 6e9900c462
commit 273d16c0ed
4 changed files with 12 additions and 12 deletions

View File

@ -2,11 +2,14 @@
"bitwise": true, "bitwise": true,
"curly": true, "curly": true,
"eqeqeq": true, "eqeqeq": true,
"esnext": true,
"forin": true, "forin": true,
"freeze": true, "freeze": true,
"globalstrict": true, "globalstrict": true,
"immed": true, "immed": true,
"indent": 2,
"laxbreak": true, "laxbreak": true,
"maxlen": 120,
"newcap": true, "newcap": true,
"noarg": true, "noarg": true,
"node": true, "node": true,
@ -15,7 +18,5 @@
"nonew": true, "nonew": true,
"strict": true, "strict": true,
"undef": true, "undef": true,
"unused": true, "unused": true
"indent": 2,
"maxlen": 120
} }

View File

@ -1,6 +1,4 @@
/*global applicationContext */
'use strict'; 'use strict';
const _ = require('underscore'); const _ = require('underscore');
const joi = require('joi'); const joi = require('joi');
const internal = require('internal'); const internal = require('internal');

View File

@ -1378,17 +1378,17 @@ function require (path) {
var keys = Object.keys(args); var keys = Object.keys(args);
// script = Function.apply(null, keys.concat(content)); // script = Function.apply(null, keys.concat(content));
// do not use Function constructor here... this is because the following code // do not use Function constructor here... this is because the following code
// //
// f = new Function("a", "b", "return 1"); // f = new Function("a", "b", "return 1");
// //
// will create the following function code in current V8: // will create the following function code in current V8:
// //
// function anonymous(a,b // function anonymous(a,b
// /**/) { // /**/) {
// return 1 // return 1
// } // }
// //
// Though the function code is correct, the line numbers in the generated code // Though the function code is correct, the line numbers in the generated code
// will be off by two lines due to V8 inserting two line breaks above the function body. // will be off by two lines due to V8 inserting two line breaks above the function body.
// Generating the function as follows will avoid that: // Generating the function as follows will avoid that:
@ -1399,7 +1399,7 @@ function require (path) {
try { try {
fn = internal.executeScript("(" + script + ")", undefined, filename); fn = internal.executeScript("(" + script + ")", undefined, filename);
} catch (e) { } catch (e) {
// This should never happen, right? require('console').errorLines(e);
throw extend(new internal.ArangoError({ throw extend(new internal.ArangoError({
errorNum: internal.errors.ERROR_SYNTAX_ERROR_IN_SCRIPT.code, errorNum: internal.errors.ERROR_SYNTAX_ERROR_IN_SCRIPT.code,
errorMessage: internal.errors.ERROR_SYNTAX_ERROR_IN_SCRIPT.message errorMessage: internal.errors.ERROR_SYNTAX_ERROR_IN_SCRIPT.message
@ -1416,6 +1416,7 @@ function require (path) {
return args[key]; return args[key];
})); }));
} catch (e) { } catch (e) {
require('console').errorLines(e);
throw extend(new internal.ArangoError({ throw extend(new internal.ArangoError({
errorNum: internal.errors.ERROR_MODULE_FAILURE.code, errorNum: internal.errors.ERROR_MODULE_FAILURE.code,
errorMessage: internal.errors.ERROR_MODULE_FAILURE.message errorMessage: internal.errors.ERROR_MODULE_FAILURE.message

View File

@ -50,10 +50,10 @@ function decorateController(auth, controller) {
secret: cfg.cookie.secret, secret: cfg.cookie.secret,
algorithm: cfg.cookie.algorithm algorithm: cfg.cookie.algorithm
} }
}); } : undefined);
} }
if (cfg.header) { if (!sid && cfg.header) {
sid = sid || req.headers[cfg.header.toLowerCase()]; sid = req.headers[cfg.header.toLowerCase()];
} }
if (sid) { if (sid) {
if (cfg.jwt) { if (cfg.jwt) {