See this script: https://jsfiddle.net/t5w060bv/
var A = function() {
this.test1 = '1';
};
Object.defineProperty(A.prototype, 'test2', { value: '2', enumerable: true });
document.body.innerText = JSON.stringify(new A());
Even though the property is defined as enumerable, it is not serialized. What's the correct way to handle this situation?