Session model.

@param {Context} ctx
@param {Object} obj
@private
491784
function Session (ctx, obj) {
  Object.defineProperty(this, '_ctx', {
    value: ctx
  })

  if (obj) {
    for (var key in obj) {
      this[key] = obj[key]
    }
  }
}
635136
function Facade (obj) {
  obj = clone(obj);
  if (!obj.hasOwnProperty('timestamp')) obj.timestamp = new Date();
  else obj.timestamp = newDate(obj.timestamp);
  traverse(obj);
  this.obj = obj;
}
453720
public static Object setObjectProp(Object obj, String property,
                                       Object value, Context cx,
                                       Scriptable scope)
    {
        Scriptable sobj = toObjectOrNull(cx, obj, scope);
        if (sobj == null) {
            throw undefWriteError(obj, property, value);
        }
        return setObjectProp(sobj, property, value, cx);
    }
1319608
function init_session(req) {
	debug.assert(req.session).is('object');
	if(!is.obj(req.session.client)) {
		req.session.client = {};
	}
	if( (!is.obj(req.session.client.messages)) || is.array(req.session.client.messages) ) {
		req.session.client.messages = {};
	}
}
753923
function(ctx){
		var opts = ctx.options,
			tree = ctx.tree;

		this._super(ctx);

		// Prepare an object that will be passed with menu events
		tree.ext.menu.data = {
			tree: tree,
			node: null,
			$menu: null,
			menuId: null
		};

//        tree.$container[0].oncontextmenu = function() {return false;};
		// Replace the standard browser context menu with out own
		tree.$container.delegate("span.fancytree-node", "contextmenu", function(event) {
			var node = $.ui.fancytree.getNode(event),
				ctx = {node: node, tree: node.tree, originalEvent: event, options: tree.options};
			tree.ext.menu._openMenu(ctx);
			return false;
		});

		// Use jquery.ui.menu
		$(opts.menu.selector).menu({
			create: function(event, ui){
				tree.ext.menu.data.$menu = $(this).menu("widget");
				var data = $.extend({}, tree.ext.menu.data);
				opts.menu.create.call(tree, event, data);
			},
			focus: function(event, ui){
				var data = $.extend({}, tree.ext.menu.data, {
					menuItem: ui.item,
					menuId: ui.item.find(">a").attr("href")
				});
				opts.menu.focus.call(tree, event, data);
			},
			select: function(event, ui){
				var data = $.extend({}, tree.ext.menu.data, {
					menuItem: ui.item,
					menuId: ui.item.find(">a").attr("href")
				});
				if( opts.menu.select.call(tree, event, data) !== false){
					tree.ext.menu._closeMenu(ctx);
				}
			}
		}).hide();
	}
363131
public void setAttributes(FaceletContext ctx, Object obj)
    {
        super.setAttributes(ctx, obj);
        NumberConverter c = (NumberConverter) obj;
        if (this.locale != null)
        {
            c.setLocale(ComponentSupport.getLocale(ctx, this.locale));
        }
    }
661261
function(self, obj)
{
   self.stack = '';
   for(var key in obj)
   {
      self[key] = obj[key];
   }
}
510971
public void setAttributes(FaceletContext ctx, Object obj)
    {
        DateTimeConverter c = (DateTimeConverter) obj;
        if (this.locale != null)
        {
            c.setLocale(ComponentSupport.getLocale(ctx, this.locale));
        }
        if (this.pattern != null)
        {
            c.setPattern(this.pattern.getValue(ctx));
        }
        else
        {
            if (this.type != null)
            {
                c.setType(this.type.getValue(ctx));
            }
            if (this.dateStyle != null)
            {
                c.setDateStyle(this.dateStyle.getValue(ctx));
            }
            if (this.timeStyle != null)
            {
                c.setTimeStyle(this.timeStyle.getValue(ctx));
            }
        }

        if (this.timeZone != null)
        {
            Object t = this.timeZone.getObject(ctx);
            if (t != null)
            {
                if (t instanceof TimeZone)
                {
                    c.setTimeZone((TimeZone) t);
                }
                else if (t instanceof String)
                {
                    TimeZone tz = TimeZone.getTimeZone((String) t);
                    c.setTimeZone(tz);
                }
                else
                {
                    throw new TagAttributeException(this.tag, this.timeZone,
                                "Illegal TimeZone, must evaluate to either a java.util.TimeZone or String, is type: "
                                + t.getClass());
                }
            }
        }
    }
802888
function string(obj, fn, ctx) {
  for (var i = 0; i < obj.length; ++i) {
    fn.call(ctx, obj.charAt(i), i);
  }
}
386098
function createSession (callback) {
      var path, sessionCreate;

      _log(me.setting);
      path = me.setting.apiroot + '/session/create.json?apiKey=' + me.setting.apikey;
      _log(path);

      sessionCreate = http.request({
        port: me.setting.port,
        host: me.setting.host,
        method: 'POST',
        path: path
      });

      sessionCreate.on('response', function (response) {
        var data = '';

        _log('STATUS: ' + response.statusCode);
        _log('HEADERS: ' + JSON.stringify(response.headers));

        if (200 !== response.statusCode) {
          callback(response.statusCode);
          return;
        }

        response.on('data', function (chunk) {
          data += chunk;
        });

        response.on('end', function() {
          var sessionInfo = JSON.parse(data);
          _log('SID OK: ' + sessionInfo.sid);

          callback(response.statusCode, sessionInfo);
        });
      });

      sessionCreate.on('error', function(err) {
        console.error(err);
      });

      sessionCreate.end();
    }
355267
function process( ctx, obj ) {
    try {
        if ( Array.isArray( obj ) ) return processArray( ctx, obj );
        switch ( typeof obj ) {
        case "string":
            return processString( ctx, obj );
        case "object":
            return processObject( ctx, obj );
        default:
            return obj;
        }
    } catch ( ex ) {
        fatal( ctx, ex );
    }
}
1366411
function (ctx, object) {
      if (!object) return;

      if (this.controlsAboveOverlay) {
        var hasBorders = object.hasBorders, hasCorners = object.hasCorners;
        object.hasBorders = object.hasCorners = false;
        object.render(ctx);
        object.hasBorders = hasBorders;
        object.hasCorners = hasCorners;
      }
      else {
        object.render(ctx);
      }
    }
1292841
function FREEZE(obj, all = false) {
		if (UoN(obj)) return obj;
		// ----------------------------------------------------------
		let iss = ISS(obj), iEN = OoA.has(iss), dfl, res;
		// ----------------------------------------------------------
			if (!iEN||iss=='function') return obj;
			if (!!obj.toJS) obj = obj.toJS();
			if (ISCONFIG(obj)||ISPTYPE(obj)) return obj;
		// ----------------------------------------------------------
			dfl = [{},[]][-(-(iss==OoA[1]))];
			res = Assign(dfl, obj);
		// ----------------------------------------------------------
			if (!!all) res = FromJS(res).map((v)=>(
				FREEZE(v, all)
			)).toJS();
		// ----------------------------------------------------------
			return Object.freeze(res);
	}
1354438
def delete_object(self, obj):
        
        session = self.get_db_session()
        session.delete(obj)
        session.commit()
124616
public void putSessionObject(@Nonnull final String key, @Nullable final Object obj) {
    this.lock();
    try {
      if (obj == null) {
        this.sessionObjects.remove(key);
      } else {
        this.sessionObjects.put(key, obj);
      }
    } finally {
      this.unlock();
    }
  }
210035
function (e, obj) {
            obj.pageX = Event.getPageX(e);
            obj.pageY = Event.getPageY(e);
        }
1238315
function(obj) {
      if(obj == null || typeof(obj) != 'object') {
        return obj;
      }

      var temp = new obj.constructor();

      for(var key in obj) {
        if (obj.hasOwnProperty(key)) {
          temp[key] = _.snapshot(obj[key]);
        }
      }

      return temp;
    }