Handle missing options; prefix objectId with __.

This commit is contained in:
Tony Garnock-Jones 2016-08-06 19:57:47 -04:00
parent ba2f4d677d
commit f3631ed18f
1 changed files with 3 additions and 2 deletions

View File

@ -78,9 +78,10 @@ Graph.prototype.repairDamage = function (repairNode) {
} }
}; };
Graph.prototype.defineObservableProperty = function (obj, prop, value, options) { Graph.prototype.defineObservableProperty = function (obj, prop, value, maybeOptions) {
var graph = this; var graph = this;
var objectId = (options.baseId || prop) + '_' + (graph.observablePropertyCounter++); var options = typeof maybeOptions === 'undefined' ? {} : maybeOptions;
var objectId = '__' + (options.baseId || prop) + '_' + (graph.observablePropertyCounter++);
Object.defineProperty(obj, prop, { Object.defineProperty(obj, prop, {
configurable: true, configurable: true,
enumerable: true, enumerable: true,