From 4d99099d1ab69183325a85bb5c4b45867a43b15b Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Thu, 31 Jan 2019 11:01:16 -0800 Subject: [PATCH 1/8] Ensure that marshalArgs pulls wildcard info value from __data It currently pulls the value from `changedProps` rather than __data, meaning it could provide stale data for re-entrant changes. --- lib/mixins/property-effects.js | 48 ++++++++++++++---------------- test/unit/path-effects-elements.js | 36 ++++++++++++++++++++++ test/unit/path-effects.html | 11 +++++++ 3 files changed, 69 insertions(+), 26 deletions(-) diff --git a/lib/mixins/property-effects.js b/lib/mixins/property-effects.js index 4961eec486..eeff962645 100644 --- a/lib/mixins/property-effects.js +++ b/lib/mixins/property-effects.js @@ -2140,37 +2140,33 @@ export const PropertyEffects = dedupingMixin(superClass => { */ _marshalArgs(args, path, props) { const data = this.__data; - let values = []; + const values = []; for (let i=0, l=args.length; i Date: Thu, 31 Jan 2019 16:14:33 -0800 Subject: [PATCH 2/8] Refactor to make code more readable, add tests, remove dead code. --- lib/mixins/property-effects.js | 37 +++++----- test/unit/path-effects-elements.js | 8 ++- test/unit/path-effects.html | 106 +++++++++++++++++++++++++++++ 3 files changed, 131 insertions(+), 20 deletions(-) diff --git a/lib/mixins/property-effects.js b/lib/mixins/property-effects.js index eeff962645..030c7951c5 100644 --- a/lib/mixins/property-effects.js +++ b/lib/mixins/property-effects.js @@ -964,6 +964,19 @@ function parseArg(rawArg) { return a; } +function getArgValue(data, props, structured, path) { + if (structured) { + let value = get(data, path); + // when data is not stored e.g. `splices`, get the changed value + if (value === undefined) { + value = props[path]; + } + return value; + } else { + return data[path]; + } +} + // data api /** @@ -982,8 +995,6 @@ function notifySplices(inst, array, path, splices) { let splicesPath = path + '.splices'; inst.notifyPath(splicesPath, { indexSplices: splices }); inst.notifyPath(path + '.length', array.length); - // Null here to allow potentially large splice records to be GC'ed. - inst.__data[splicesPath] = {indexSplices: null}; } /** @@ -2143,26 +2154,14 @@ export const PropertyEffects = dedupingMixin(superClass => { const values = []; for (let i=0, l=args.length; i Date: Thu, 31 Jan 2019 18:42:14 -0800 Subject: [PATCH 3/8] Upgrade webcomponentsjs --- package-lock.json | 92 ++++++++++++++++++++--------------------------- package.json | 2 +- 2 files changed, 40 insertions(+), 54 deletions(-) diff --git a/package-lock.json b/package-lock.json index 9da912d1cb..b468dee87f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1310,9 +1310,9 @@ "integrity": "sha512-bx0TzeZ11VqYDGLuXfznen8+4u0hADk2dD5RNMFxWL9MM4c5NXCDCgNXgssb4i2zQOos/GGe4tl5AuE0LzJkLA==" }, "@webcomponents/webcomponentsjs": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/@webcomponents/webcomponentsjs/-/webcomponentsjs-2.2.2.tgz", - "integrity": "sha512-t45WI6m/dD+gmMaQ/u0k1gCrSg5yESnfGaxfFPV1GST2RL/aEScoaotFsfjfP8DPcq2OH6leyHoWBT+pSuGsdQ==", + "version": "2.2.5", + "resolved": "https://registry.npmjs.org/@webcomponents/webcomponentsjs/-/webcomponentsjs-2.2.5.tgz", + "integrity": "sha512-aLSQa2+NjGv+6hwjQ/mHhrav7qhRf1ZMsUNWNqP3ca9BK9YoDmjsrcFFr8TaZ+ucwm+JiNVEtoQinNpbn863pw==", "dev": true }, "abbrev": { @@ -9756,7 +9756,7 @@ }, "array-flatten": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=", "dev": true }, @@ -10635,7 +10635,7 @@ }, "string_decoder": { "version": "0.10.31", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "dev": true } @@ -11119,7 +11119,7 @@ }, "concat-stream": { "version": "1.6.2", - "resolved": "http://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", "dev": true, "requires": { @@ -11145,7 +11145,7 @@ }, "content-disposition": { "version": "0.5.2", - "resolved": "http://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.2.tgz", "integrity": "sha1-DPaLud318r55YcOoUXjLhdunjLQ=", "dev": true }, @@ -11529,7 +11529,7 @@ }, "string_decoder": { "version": "0.10.31", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "dev": true } @@ -11895,7 +11895,7 @@ }, "expand-range": { "version": "1.8.2", - "resolved": "http://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", + "resolved": "https://registry.npmjs.org/expand-range/-/expand-range-1.8.2.tgz", "integrity": "sha1-opnv/TNf4nIeuujiV+x5ZE/IUzc=", "dev": true, "requires": { @@ -12144,7 +12144,7 @@ }, "is-accessor-descriptor": { "version": "0.1.6", - "resolved": "http://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "dev": true, "requires": { @@ -12164,7 +12164,7 @@ }, "is-data-descriptor": { "version": "0.1.4", - "resolved": "http://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "dev": true, "requires": { @@ -12683,15 +12683,13 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "dev": true, - "optional": true + "dev": true }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, - "optional": true, "requires": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -12708,22 +12706,19 @@ "version": "1.1.0", "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "dev": true, - "optional": true + "dev": true }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "dev": true, - "optional": true + "dev": true }, "console-control-strings": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "dev": true, - "optional": true + "dev": true }, "core-util-is": { "version": "1.0.2", @@ -12854,8 +12849,7 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", - "dev": true, - "optional": true + "dev": true }, "ini": { "version": "1.3.5", @@ -12869,7 +12863,6 @@ "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", "dev": true, - "optional": true, "requires": { "number-is-nan": "^1.0.0" } @@ -12886,7 +12879,6 @@ "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, - "optional": true, "requires": { "brace-expansion": "^1.1.7" } @@ -12895,15 +12887,13 @@ "version": "0.0.8", "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true, - "optional": true + "dev": true }, "minipass": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/minipass/-/minipass-2.2.4.tgz", "integrity": "sha512-hzXIWWet/BzWhYs2b+u7dRHlruXhwdgvlTMDKC6Cb1U7ps6Ac6yQlR39xsbjWJE377YTCtKwIXIpJ5oP+j5y8g==", "dev": true, - "optional": true, "requires": { "safe-buffer": "^5.1.1", "yallist": "^3.0.0" @@ -12924,7 +12914,6 @@ "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", "dev": true, - "optional": true, "requires": { "minimist": "0.0.8" } @@ -13013,8 +13002,7 @@ "version": "1.0.1", "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "dev": true, - "optional": true + "dev": true }, "object-assign": { "version": "4.1.1", @@ -13028,7 +13016,6 @@ "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, - "optional": true, "requires": { "wrappy": "1" } @@ -13166,7 +13153,6 @@ "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, - "optional": true, "requires": { "code-point-at": "^1.0.0", "is-fullwidth-code-point": "^1.0.0", @@ -13423,7 +13409,7 @@ }, "string_decoder": { "version": "0.10.31", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "dev": true }, @@ -13456,7 +13442,7 @@ }, "global-modules": { "version": "0.2.3", - "resolved": "http://registry.npmjs.org/global-modules/-/global-modules-0.2.3.tgz", + "resolved": "https://registry.npmjs.org/global-modules/-/global-modules-0.2.3.tgz", "integrity": "sha1-6lo77ULG1s6ZWk+KEmm12uIjgo0=", "dev": true, "requires": { @@ -13474,7 +13460,7 @@ }, "global-prefix": { "version": "0.1.5", - "resolved": "http://registry.npmjs.org/global-prefix/-/global-prefix-0.1.5.tgz", + "resolved": "https://registry.npmjs.org/global-prefix/-/global-prefix-0.1.5.tgz", "integrity": "sha1-jTvGuNo8qBEqFg2NSW/wRiv+948=", "dev": true, "requires": { @@ -14009,7 +13995,7 @@ }, "is-accessor-descriptor": { "version": "0.1.6", - "resolved": "http://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "dev": true, "requires": { @@ -14057,7 +14043,7 @@ }, "is-data-descriptor": { "version": "0.1.4", - "resolved": "http://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "dev": true, "requires": { @@ -15046,7 +15032,7 @@ }, "multimatch": { "version": "2.1.0", - "resolved": "http://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", "dev": true, "requires": { @@ -15058,7 +15044,7 @@ }, "multipipe": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/multipipe/-/multipipe-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/multipipe/-/multipipe-1.0.2.tgz", "integrity": "sha1-zBPv2DPJzamfIk+GhGG44aP9k50=", "dev": true, "requires": { @@ -15495,7 +15481,7 @@ }, "pako": { "version": "0.2.9", - "resolved": "http://registry.npmjs.org/pako/-/pako-0.2.9.tgz", + "resolved": "https://registry.npmjs.org/pako/-/pako-0.2.9.tgz", "integrity": "sha1-8/dSL073gjSNqBYbrZ7P1Rv4OnU=", "dev": true }, @@ -16079,7 +16065,7 @@ }, "pretty-bytes": { "version": "4.0.2", - "resolved": "http://registry.npmjs.org/pretty-bytes/-/pretty-bytes-4.0.2.tgz", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-4.0.2.tgz", "integrity": "sha1-sr+C5zUNZcbDOqlaqlpPYyf2HNk=", "dev": true }, @@ -16378,7 +16364,7 @@ }, "is-accessor-descriptor": { "version": "0.1.6", - "resolved": "http://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "dev": true, "requires": { @@ -16398,7 +16384,7 @@ }, "is-data-descriptor": { "version": "0.1.4", - "resolved": "http://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "dev": true, "requires": { @@ -16792,7 +16778,7 @@ }, "resolve-dir": { "version": "0.1.1", - "resolved": "http://registry.npmjs.org/resolve-dir/-/resolve-dir-0.1.1.tgz", + "resolved": "https://registry.npmjs.org/resolve-dir/-/resolve-dir-0.1.1.tgz", "integrity": "sha1-shklmlYC+sXFxJatiUpujMQwJh4=", "dev": true, "requires": { @@ -17555,7 +17541,7 @@ }, "string-width": { "version": "1.0.2", - "resolved": "http://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", "dev": true, "requires": { @@ -17566,7 +17552,7 @@ }, "string_decoder": { "version": "1.1.1", - "resolved": "http://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { @@ -17624,7 +17610,7 @@ }, "supports-color": { "version": "2.0.0", - "resolved": "http://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-2.0.0.tgz", "integrity": "sha1-U10EXOa2Nj+kARcIRimZXp3zJMc=", "dev": true }, @@ -17767,7 +17753,7 @@ }, "temp": { "version": "0.8.3", - "resolved": "http://registry.npmjs.org/temp/-/temp-0.8.3.tgz", + "resolved": "https://registry.npmjs.org/temp/-/temp-0.8.3.tgz", "integrity": "sha1-4Ma8TSa5AxJEEOT+2BEDAU38H1k=", "dev": true, "requires": { @@ -18116,7 +18102,7 @@ }, "underscore": { "version": "1.6.0", - "resolved": "http://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", "dev": true }, @@ -18302,7 +18288,7 @@ "dependencies": { "ansi-align": { "version": "1.1.0", - "resolved": "http://registry.npmjs.org/ansi-align/-/ansi-align-1.1.0.tgz", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-1.1.0.tgz", "integrity": "sha1-LwwWWIKXOa3V67FeawxuNCPwFro=", "dev": true, "requires": { @@ -18930,7 +18916,7 @@ }, "is-accessor-descriptor": { "version": "0.1.6", - "resolved": "http://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", "dev": true, "requires": { @@ -18950,7 +18936,7 @@ }, "is-data-descriptor": { "version": "0.1.4", - "resolved": "http://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", "dev": true, "requires": { @@ -21021,7 +21007,7 @@ }, "stream-combiner": { "version": "0.2.2", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz", + "resolved": "http://registry.npmjs.org/stream-combiner/-/stream-combiner-0.2.2.tgz", "integrity": "sha1-rsjLrBd7Vrb0+kec7YwZEs7lKFg=", "dev": true, "requires": { diff --git a/package.json b/package.json index 26c688e629..860067b899 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "@polymer/gen-typescript-declarations": "^1.5.1", "@polymer/iron-component-page": "^3.0.0-pre.12", "@polymer/test-fixture": "^3.0.0-pre.12", - "@webcomponents/webcomponentsjs": "^2.2.2", + "@webcomponents/webcomponentsjs": "^2.2.5", "babel-eslint": "^7.2.3", "babel-preset-minify": "^0.2.0", "del": "^3.0.0", From 98304fb60143fd26bd1679be04ed7c0648c2a489 Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Mon, 4 Feb 2019 12:01:09 -0800 Subject: [PATCH 4/8] Updates based on review. --- lib/mixins/property-effects.js | 27 +++--- test/unit/path-effects-elements.js | 132 ++++++++++++++++++++++++++--- test/unit/path-effects.html | 56 ++++++++++-- 3 files changed, 183 insertions(+), 32 deletions(-) diff --git a/lib/mixins/property-effects.js b/lib/mixins/property-effects.js index 030c7951c5..d78f42f657 100644 --- a/lib/mixins/property-effects.js +++ b/lib/mixins/property-effects.js @@ -964,17 +964,13 @@ function parseArg(rawArg) { return a; } -function getArgValue(data, props, structured, path) { - if (structured) { - let value = get(data, path); - // when data is not stored e.g. `splices`, get the changed value - if (value === undefined) { - value = props[path]; - } - return value; - } else { - return data[path]; +function getArgValue(data, props, path) { + let value = get(data, path); + // when data is not stored e.g. `splices`, get the changed value + if (value === undefined) { + value = props[path]; } + return value; } // data api @@ -992,8 +988,7 @@ function getArgValue(data, props, structured, path) { * @private */ function notifySplices(inst, array, path, splices) { - let splicesPath = path + '.splices'; - inst.notifyPath(splicesPath, { indexSplices: splices }); + inst.notifyPath(path + '.splices', { indexSplices: splices }); inst.notifyPath(path + '.length', array.length); } @@ -2155,14 +2150,16 @@ export const PropertyEffects = dedupingMixin(superClass => { for (let i=0, l=args.length; i Date: Mon, 4 Feb 2019 12:02:16 -0800 Subject: [PATCH 5/8] Upgrade wcjs --- package-lock.json | 6 +++--- package.json | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index b468dee87f..d3fd24d2f2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1310,9 +1310,9 @@ "integrity": "sha512-bx0TzeZ11VqYDGLuXfznen8+4u0hADk2dD5RNMFxWL9MM4c5NXCDCgNXgssb4i2zQOos/GGe4tl5AuE0LzJkLA==" }, "@webcomponents/webcomponentsjs": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/@webcomponents/webcomponentsjs/-/webcomponentsjs-2.2.5.tgz", - "integrity": "sha512-aLSQa2+NjGv+6hwjQ/mHhrav7qhRf1ZMsUNWNqP3ca9BK9YoDmjsrcFFr8TaZ+ucwm+JiNVEtoQinNpbn863pw==", + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/@webcomponents/webcomponentsjs/-/webcomponentsjs-2.2.6.tgz", + "integrity": "sha512-TbuyV7hHIq4jMlvQ8pF3C6QNEqFeBX4be9AND5DO8UCRRYcZBpjl1yH9IChbebeWr1QNcK5WlZC3voAlQCdisQ==", "dev": true }, "abbrev": { diff --git a/package.json b/package.json index 860067b899..3fcebe360a 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "@polymer/gen-typescript-declarations": "^1.5.1", "@polymer/iron-component-page": "^3.0.0-pre.12", "@polymer/test-fixture": "^3.0.0-pre.12", - "@webcomponents/webcomponentsjs": "^2.2.5", + "@webcomponents/webcomponentsjs": "^2.2.6", "babel-eslint": "^7.2.3", "babel-preset-minify": "^0.2.0", "del": "^3.0.0", From 0c85340b1282a7d81e574b7bc3eb9cff2948694f Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Mon, 4 Feb 2019 14:09:48 -0800 Subject: [PATCH 6/8] Fix lint errors. --- test/unit/path-effects-elements.js | 10 +++------- test/unit/path-effects.html | 4 ++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/test/unit/path-effects-elements.js b/test/unit/path-effects-elements.js index 7c153e4e75..c68de108b2 100644 --- a/test/unit/path-effects-elements.js +++ b/test/unit/path-effects-elements.js @@ -346,9 +346,7 @@ Polymer({ ], created() { - this.propChanged = sinon.spy(function() { - this.debug = true; - }); + this.propChanged = sinon.spy(); }, computeProp(trigger, value) { @@ -382,16 +380,14 @@ Polymer({ ], created() { - this.arrayChanged = sinon.spy(function() { - this.debug = true; - }); + this.arrayChanged = sinon.spy(); }, changeArray() { if (this.array.length === 0) { this.push('array', 'one'); } else if (this.array.length === 1) { - this.push('array', 'two') + this.push('array', 'two'); } } diff --git a/test/unit/path-effects.html b/test/unit/path-effects.html index 57ae116f80..93b8401898 100644 --- a/test/unit/path-effects.html +++ b/test/unit/path-effects.html @@ -360,7 +360,7 @@ let c = {}, b = {c}, a = {b}; el.a = a; el.resetObservers(); - c = {}, + c = {}; b = {c}; el.set('a.b', b); assert.equal(el.aChanged.callCount, 1); @@ -377,7 +377,7 @@ let c = {}, b = {c}, a = {b}; el.a = a; el.resetObservers(); - c = {}, + c = {}; el.set('a.b.c', c); assert.equal(el.aChanged.callCount, 1); assert.deepEqual(el.aChanged.firstCall.args[0], {path: 'a.b.c', base: a, value: c}); From d3f27d0ad5349727c1cc9f22549f50b4c4fa21fe Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Mon, 4 Feb 2019 15:04:32 -0800 Subject: [PATCH 7/8] Add issue for TODO --- test/unit/path-effects.html | 2 ++ 1 file changed, 2 insertions(+) diff --git a/test/unit/path-effects.html b/test/unit/path-effects.html index 93b8401898..feebb9c901 100644 --- a/test/unit/path-effects.html +++ b/test/unit/path-effects.html @@ -1218,6 +1218,7 @@ // TODO(kschaaf): address code in `getArgValue` that looks in changedProps // when `undefined` for splices, which breaks this test (latent issue) + // https://github.com/Polymer/polymer/issues/5479 test.skip('reentry after prop goes back to undefined', function() { let el = document.createElement('x-reentry-undefined'); document.body.appendChild(el); @@ -1231,6 +1232,7 @@ // TODO(kschaaf): address code in `getArgValue` that looks in changedProps // when `undefined` for splices, which breaks this test (latent issue) + // https://github.com/Polymer/polymer/issues/5479 test.skip('reentry after path goes back to undefined', function() { let el = document.createElement('x-reentry-undefined-path'); document.body.appendChild(el); From 67caf458ba189fbae170b20f99f1d0ea50bc3283 Mon Sep 17 00:00:00 2001 From: Kevin Schaaf Date: Mon, 4 Feb 2019 15:15:55 -0800 Subject: [PATCH 8/8] Add comment re: undefined issue --- lib/mixins/property-effects.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/lib/mixins/property-effects.js b/lib/mixins/property-effects.js index d78f42f657..a1808d6b2e 100644 --- a/lib/mixins/property-effects.js +++ b/lib/mixins/property-effects.js @@ -966,7 +966,11 @@ function parseArg(rawArg) { function getArgValue(data, props, path) { let value = get(data, path); - // when data is not stored e.g. `splices`, get the changed value + // when data is not stored e.g. `splices`, get the value from changedProps + // TODO(kschaaf): Note, this can cause a rare issue where the wildcard + // info.value could pull a stale value out of changedProps during a reentrant + // change that sets the value back to undefined. + // https://github.com/Polymer/polymer/issues/5479 if (value === undefined) { value = props[path]; }