'use strict';

var
U       = require('./u'),
objects = require('./objects');


exports.create = objects.factory({

  // spec.name
  // spec.version
  // spec.appdir
  // spec.sysconfigsdir
  // spec.packageJSON
  // spec.environment
  // spec.configs
  // spec.argv
  initialize: function (spec) {
    Object.defineProperties(this, {
      name: {
        enumerable: true,
        value: spec.name
      },
      version: {
        enumerable: true,
        value: spec.version
      },
      appdir: {
        enumerable: true,
        value: spec.appdir
      },
      sysconfigsdir: {
        enumerable: true,
        value: spec.sysconfigsdir
      },
      packageJSON: {
        enumerable: true,
        value: U.deepFreeze(spec.packageJSON)
      },
      environment: {
        enumerable: true,
        value: spec.environment
      },
      configs: {
        enumerable: true,
        value: U.deepFreeze(spec.configs)
      },
      argv: {
        enumerable: true,
        value: U.deepFreeze(spec.argv)
      },
      API: {
        enumerable: true,
        value: Object.create(null)
      }
    });
  }
});

@@ -162,32 +162,8 @@
 dir%0A
-  // spec.sysconfigsdir%0A
   //
@@ -206,26 +206,8 @@
 ent%0A
-  // spec.configs%0A
   //
@@ -523,29 +523,27 @@
 ,%0A      
-sysconfigsdir
+packageJSON
 : %7B%0A    
@@ -588,92 +588,21 @@
 pec.
-sysconfigsdir%0A      %7D,%0A      packageJSON: %7B%0A        enumerable: true,%0A        value:
+packageJSON ?
  U.d
@@ -628,16 +628,23 @@
 ageJSON)
+ : null
 %0A      %7D
@@ -795,33 +795,26 @@
 ue: 
-U.deepFreeze(spec.configs
+Object.create(null
 )%0A  

Update the appication object.