diff --git a/src/helpers/helpers.config.js b/src/helpers/helpers.config.js index 4d27f9e5b02..30567c912ec 100644 --- a/src/helpers/helpers.config.js +++ b/src/helpers/helpers.config.js @@ -76,8 +76,7 @@ export function _createResolver(scopes, prefixes = [''], rootScopes = scopes, fa */ set(target, prop, value) { const storage = target._storage || (target._storage = getTarget()); - storage[prop] = value; // set to top level scope - delete target[prop]; // remove from cache + target[prop] = storage[prop] = value; // set to top level scope + cache delete target._keys; // remove cached keys return true; } diff --git a/test/specs/helpers.config.tests.js b/test/specs/helpers.config.tests.js index 58e295b580b..76d056a3327 100644 --- a/test/specs/helpers.config.tests.js +++ b/test/specs/helpers.config.tests.js @@ -492,6 +492,7 @@ describe('Chart.helpers.config', function() { resolver.value = false; expect(options.value).toBeFalse(); expect(defaults.value).toBeTrue(); + expect(resolver.value).toBeFalse(); }); it('should set values of sub-objects to first scope', function() { @@ -505,6 +506,7 @@ describe('Chart.helpers.config', function() { resolver.sub.value = false; expect(options.sub.value).toBeFalse(); expect(defaults.sub.value).toBeTrue(); + expect(resolver.sub.value).toBeFalse(); }); it('should throw when setting a value and options is frozen', function() {