Skip to content

Commit

Permalink
Eliminate rest args for better perf on stable chrome.
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinpschaaf committed Apr 13, 2017
1 parent 86e35e3 commit fa67457
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions lib/mixins/property-effects.html
Original file line number Diff line number Diff line change
Expand Up @@ -89,16 +89,16 @@
* @param {string} type Type of effect to run
* @param {Object} props Bag of current property changes
* @param {Object=} oldProps Bag of previous values for changed properties
* @param {boolean} hasPaths True with `props` contains one or more paths
* @param {*} var_args Additional metadata to pass to effect function
* @param {boolean=} hasPaths True with `props` contains one or more paths
* @param {*=} extraArgs Additional metadata to pass to effect function
* @private
*/
function runEffects(inst, effects, props, oldProps, hasPaths, ...args) {
function runEffects(inst, effects, props, oldProps, hasPaths, extraArgs) {
if (effects) {
let ran;
let id = dedupeId++;
for (let prop in props) {
if (runEffectsForProperty(inst, effects, id, prop, props, oldProps, hasPaths, ...args)) {
if (runEffectsForProperty(inst, effects, id, prop, props, oldProps, hasPaths, extraArgs)) {
ran = true;
}
}
Expand All @@ -115,11 +115,11 @@
* @param {string} prop Name of changed property
* @param {*} props Changed properties
* @param {*} oldProps Old properties
* @param {boolean} hasPaths True with `props` contains one or more paths
* @param {*} var_args Additional metadata to pass to effect function
* @param {boolean=} hasPaths True with `props` contains one or more paths
* @param {*=} extraArgs Additional metadata to pass to effect function
* @private
*/
function runEffectsForProperty(inst, effects, dedupeId, prop, props, oldProps, hasPaths, ...args) {
function runEffectsForProperty(inst, effects, dedupeId, prop, props, oldProps, hasPaths, extraArgs) {
let ran;
let rootProperty = hasPaths ? Polymer.Path.root(prop) : prop;
let fxs = effects[rootProperty];
Expand All @@ -130,7 +130,7 @@
if (fx.info) {
fx.info.lastRun = dedupeId;
}
fx.fn(inst, prop, props, oldProps, fx.info, hasPaths, ...args);
fx.fn(inst, prop, props, oldProps, fx.info, hasPaths, extraArgs);
ran = true;
}
}
Expand Down

0 comments on commit fa67457

Please sign in to comment.