Browse Source

Add break statements to switch

Adding break statements to the case switch statements prevents throwing of errors when using the **ignore** option
pull/125/head
Christopher Brown 7 years ago committed by GitHub
parent
commit
9790f2f62b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 24
      resemble.js

24
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;
}
}

Loading…
Cancel
Save