Skip to content
Myr

setOptionValue should clear option source (#1795)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

* Have setOptionValue call setOptionValueWithSource instead of the other way around * Add explicit undefined to pass tests

authored by John Gee · committed by GitHub · parent 82fcb98 · Browse files · 2 files+16 added−8 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

2 files+16 added−8 removed

  • tests:+10 added−1 removed
  • other:+6 added−7 removed

2 files+16 added−8 removed

modified:lib/command.js+6 added-7 removed
778 unmodified lines
779 * @return {Command} `this` command for chaining780 */781782 setOptionValue(key, value) {783 if (this._storeOptionsAsProperties) {784 this[key] = value;785 } else {786 this._optionValues[key] = value;787 }788 return this;783 return this.setOptionValueWithSource(key, value, undefined);784 }785786 /**787 * Store option value and where the value came from.
4 unmodified lines
792 * @return {Command} `this` command for chaining793 */794795 setOptionValueWithSource(key, value, source) {801 this.setOptionValue(key, value);796 if (this._storeOptionsAsProperties) {797 this[key] = value;798 } else {799 this._optionValues[key] = value;800 }801 this._optionValueSources[key] = source;802 return this;803 }804
1356 unmodified lines
modified:tests/options.getset.test.js+10 added-1 removed