From 9790f2f62b4410b53c7caa20eb06c77797a62def Mon Sep 17 00:00:00 2001 From: Christopher Brown Date: Mon, 22 Jan 2018 00:22:02 -0700 Subject: [PATCH] Add break statements to switch Adding break statements to the case switch statements prevents throwing of errors when using the **ignore** option --- resemble.js | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/resemble.js b/resemble.js index b265e66..7ba0b0d 100644 --- a/resemble.js +++ b/resemble.js @@ -808,12 +808,24 @@ URL: https://github.com/Huddle/Resemble.js function applyIgnore(api, ignore) { switch (ignore) { - case 'nothing': api.ignoreNothing(); - case 'less': api.ignoreLess(); - case 'antialiasing': api.ignoreAntialiasing(); - case 'colors': api.ignoreColors(); - case 'alpha': api.ignoreAlpha(); - default: throw new Error('Invalid ignore: ' + ignore); + case 'nothing': + api.ignoreNothing(); + break; + case 'less': + api.ignoreLess(); + break; + case 'antialiasing': + api.ignoreAntialiasing(); + break; + case 'colors': + api.ignoreColors(); + break; + case 'alpha': + api.ignoreAlpha(); + break; + default: + throw new Error('Invalid ignore: ' + ignore); + break; } }