IE8 does not support getter/setter functions on properties of non DOM objects.
The "solution" here is to not rely on property getters, and use a full getter function instead.
AutosizeInput.prototype.getOptions = function() {
return this._options;
};
var input = new AutoresizeInput();
input.getOptions();
Or, instead of keeping this._options
as an "internal" variable, just drop the underscore allow access directly. This way you need no magic at all.
var AutoresizeInput = function() {
this.options = {};
}
var input = new AutoresizeInput();
input.options();
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…