Skip to content

Commit

Permalink
Remove use of Array.prototype.find
Browse files Browse the repository at this point in the history
Not supported in IE11
  • Loading branch information
Anand Thakker committed Nov 16, 2016
1 parent a9f7dc4 commit 9820f53
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions js/style/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,9 @@ class Style extends Evented {
return false;
}

const firstUnimplementedOperation = changes.find(op => !(op.command in supportedDiffOperations));
if (firstUnimplementedOperation) {
// - setTransition: looks like this is used at update-time, so it may be safe to simply rely on setting `this.stylesheet` to the up-to-date style (i.e., no diff magic required)
throw new Error(`Unimplemented: ${firstUnimplementedOperation.command}.`);
const unimplementedOps = changes.filter(op => !(op.command in supportedDiffOperations));
if (unimplementedOps.length > 0) {
throw new Error(`Unimplemented: ${unimplementedOps.map(op => op.command).join(', ')}.`);
}

changes.forEach((op) => {
Expand Down

0 comments on commit 9820f53

Please sign in to comment.