rolling back to the 'or' operator approach. Is safer if the passed parameter is an empty string, for example

This commit is contained in:
rssilva 2015-09-29 21:24:08 -03:00
parent 14baab7386
commit 439d4bb624

View File

@ -140,8 +140,8 @@ class ClipboardAction {
* Sets the `action` to be performed which can be either 'copy' or 'cut'.
* @param {String} action
*/
set action(action = 'copy') {
this._action = action;
set action(action) {
this._action = action || 'copy';
if (this._action !== 'copy' && this._action !== 'cut') {
throw new Error('Invalid "action" value, use either "copy" or "cut"');