From ea50a3f9c704f61baf0ca19a6c9cdf8c5e592eb9 Mon Sep 17 00:00:00 2001 From: Bill Christo Date: Wed, 12 Oct 2016 16:37:33 -0400 Subject: [PATCH 1/2] bug fix Proxy set function needs to return true otherwise we get this error: "TypeError: 'set' on proxy: trap returned falsish for property." --- app.js | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app.js b/app.js index cbad06c..e3a0245 100644 --- a/app.js +++ b/app.js @@ -57,10 +57,7 @@ function Filejson(cfg) { if( value instanceof Object ) { value = new Proxy(value, this); } - - // The default behavior to store the value - Reflect.set(target, key, value, receiver); - + if(!self.paused) { self.save(function(error) { if(error) { @@ -69,6 +66,9 @@ function Filejson(cfg) { } }); } + + // The default behavior to store the value + return Reflect.set(target, key, value, receiver); } }; From d436365edf754e25791c9f631f1d7e868bb0f53b Mon Sep 17 00:00:00 2001 From: Bill Christo Date: Wed, 12 Oct 2016 16:37:59 -0400 Subject: [PATCH 2/2] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 54e1e43..9baede9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "filejson", - "version": "1.0.6", + "version": "1.0.7", "description": "Use a JSON encoded file to automatically save a JavaScript value to disk whenever that value changes.", "main": "app.js", "scripts": {