Skip to content

Commit

Permalink
🐞 #57 remove .includes for IE11
Browse files Browse the repository at this point in the history
Thx @natemoo-e for cluing me in #63
  • Loading branch information
desandro committed Jun 14, 2019
1 parent 5077413 commit 2d81d50
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 additions & 4 deletions js/anchor.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,14 @@ Anchor.prototype.setOptions = function( options ) {
var optionKeys = this.constructor.optionKeys;

for ( var key in options ) {
if ( optionKeys.includes( key ) ) {
if ( optionKeys.indexOf( key ) != -1 ) {
this[ key ] = options[ key ];
}
}
};

Anchor.prototype.addChild = function( shape ) {
var index = this.children.indexOf( shape );
if ( index != -1 ) {
if ( this.children.indexOf( shape ) != -1 ) {
return;
}
shape.remove(); // remove previous parent
Expand Down Expand Up @@ -231,7 +230,7 @@ function getSubclass( Super ) {
Item.optionKeys = Super.optionKeys.slice(0);
// add defaults keys to optionKeys, dedupe
Object.keys( Item.defaults ).forEach( function( key ) {
if ( !Item.optionKeys.includes( key ) ) {
if ( !Item.optionKeys.indexOf( key ) != 1 ) {
Item.optionKeys.push( key );
}
});
Expand Down
2 changes: 1 addition & 1 deletion js/shape.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Shape.prototype.updatePathCommands = function() {
var method = keys[0];
var points = pathPart[ method ];
// default to line if no instruction
var isInstruction = keys.length == 1 && actionNames.includes( method );
var isInstruction = keys.length == 1 && actionNames.indexOf( method ) != -1;
if ( !isInstruction ) {
method = 'line';
points = pathPart;
Expand Down

0 comments on commit 2d81d50

Please sign in to comment.