I tried to extend Proxy, like so:
class ObservableObject extends Proxy {}
I used Babel to transpile it to ES5, and I got this error in the browser:
app.js:15 Uncaught TypeError: Object prototype may only be an Object or null: undefined
I looked at the line of code it pointed to. Here's that portion of the code with arrows pointing to the offending line of code:
var ObservableObject = exports.ObservableObject = function (_Proxy) {
_inherits(ObservableObject, _Proxy); // <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
function ObservableObject() {
_classCallCheck(this, ObservableObject);
return _possibleConstructorReturn(this, Object.getPrototypeOf(ObservableObject).apply(this, arguments));
}
return ObservableObject;
}(Proxy);
Does anyone know why I might be getting this error? Is this a bug in Babel? What is supposed to happen when you try to extend Proxy?
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…