Bug when a property has a getter/setter
I'm trying to upgrade from Meteor 1.6 to Meteor 1.11.1 and I'm getting the same error on virtually every file: Invalid property descriptor. Cannot both specify accessors and a value or writable attribute.
Attaching a debugger to the running meteor process (the builder, not the runner) and modifying Object.defineProperty to look for these situations and pause:
origDefineProperty = Object.defineProperty;Object.defineProperty = function(o, p, v, ...args) {
if (v) {
if ((v.writeable || v.value !== undefined) && (v.get || v.set)) {
debugger;
}
}
try {
return origDefineProperty.call(Object, o, p, v, ...args)
}
catch (e) {
debugger;
console.error(e);
console.log(o, p, v, ...args);
}
}
Shows that the offending value + getter combo is caused by the handleKey function in util.js(https://github.com/meteor/babel/blob/master/util.js#L49)
This is caused by an internal package (a hack to make sourcemaps work better) - but it feels like something that should be fixed, if a getter/setter is defined, don't set the value.
Hi @znewsham are you willing to work in a PR to fix this?