"use strict";

/**
 *
 * ----------------------------------------------------------------------------
 * express.js
 * ----------------------------------------------------------------------------
 *
 * This file is part of browser Project.
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */
var Browser = require('../'),
    path    = require('path');

module.exports = function(options) {

    var browser = Browser(options || {});

    var middleware = function(req, res, next) {

        Object.defineProperty(browser, 'current', {
            enumerable: false,
            configurable: false,
            writable: false,
            value: req.query.hasOwnProperty('root') ? path.join(browser.home, req.query.root) : path.join(browser.home, '/')
        });

        req.browser = browser;

        next();
    };

    return middleware;
};
@@ -371,17 +371,17 @@
  */%0Avar 
-B
+b
 rowser =
@@ -479,19 +479,19 @@
 var 
-brows
+manag
 er = 
-B
+b
 rows
@@ -554,24 +554,101 @@
 es, next) %7B%0A
+        //Define new property where it's values is current list relative path
 %0A        Obj
@@ -666,21 +666,21 @@
 roperty(
-brows
+manag
 er, 'cur
@@ -941,21 +941,21 @@
 owser = 
-brows
+manag
 er;%0A%0A   

Refactor missing new operator for coverage test. Fixes #2.