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) { function applyIgnore(api, ignore) {
switch (ignore) { switch (ignore) {
case 'nothing': api.ignoreNothing(); case 'nothing':
case 'less': api.ignoreLess(); api.ignoreNothing();
case 'antialiasing': api.ignoreAntialiasing(); break;
case 'colors': api.ignoreColors(); case 'less':
case 'alpha': api.ignoreAlpha(); api.ignoreLess();
default: throw new Error('Invalid ignore: ' + ignore); 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