From 8d2fbcf7b6ea7020331bc16bc2e482c77b93b52e Mon Sep 17 00:00:00 2001 From: guy Date: Tue, 2 Jan 2018 16:46:21 +0800 Subject: [PATCH] update --- dist/fix/fix.js | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/dist/fix/fix.js b/dist/fix/fix.js index fcfa02b6e..0ae477f7e 100644 --- a/dist/fix/fix.js +++ b/dist/fix/fix.js @@ -371,6 +371,15 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons shouldConvert: true }; + function def(obj, key, val, enumerable) { + Object.defineProperty(obj, key, { + value: val, + enumerable: !!enumerable, + writable: true, + configurable: true + }); + } + /** * Observer class that are attached to each observed * object. Once attached, the observer converts target @@ -392,7 +401,11 @@ function _classCallCheck(instance, Constructor) { if (!(instance instanceof Cons } else { this.model = this.walk(value); } - this.model['__ob__'] = this; + try { + def(this.model, "__ob__", this); + } catch (e) { + this.model['__ob__'] = this; + } } Observer.prototype.walk = function walk(obj) {