如何在嵌套对象中使用'this'?
这个问题在这里已经有了答案:
  如果不是这样工作的话。  self技术是封闭的,它应该与使用的功能相同。  例如: 
function myFunc() {
     var self = this;
     anotherFuncWithCallback( function() { self.myValue = this.valueFromOtherContext; });
}
  你不能以你想要的方式将this绑定到你的方法上。  如果你有绑定问题,你需要改变你的方法调用: 
myObject.myMethod.bind(myObject)("parameters");
  它会在调用你的方法之前将正确的对象绑定到this对象上。 
顺便说一下,您可以将您的班级定义更改为:
var LayoutConstructor = function() {
  var self = this;
  this.newsroom = {
        buildSidebar: function() {
            //some code...
            //get the error: Cannot read property 'buildBoxWrapper' of undefined
            self.general.buildBoxWrapper($(".sidebar .box-wrapper"));
        }
    };
  this.buildNewsroom = function() {
        this.newsroom.buildSidebar();
  };
  this.general = {
        // Build the box-wrapper
        buildBoxWrapper: function(boxWrapper) {
            //some code...
        }
    }
}
