Commit 83a112ae authored by Mikaël Salson's avatar Mikaël Salson
Browse files

segmenter.js: includes() method is a bit new

It is part of the ECMAScript 2016 standard while indexOf is part of the
ECMAScript 5.1 standard (2011).
parent 2bb0a44d
......@@ -872,7 +872,7 @@ Segment.prototype = {
var clone = this.m.clone(j);
for (var i in clone) {
if (! forbidden_fields.includes(i) &&(this.isDNA(clone[i]) || this.isPos(clone[i]) )){
if (forbidden_fields.indexOf(i) == -1 &&(this.isDNA(clone[i]) || this.isPos(clone[i]) )){
if (result.indexOf(i) == -1) result.push(i);
}
}
......@@ -880,7 +880,7 @@ Segment.prototype = {
// In the .seg element, What looks like DNA sequence or what is a Pos field
if (clone.hasSeg()){
for (var i in clone.seg) {
if (! forbidden_fields.includes(i) &&(this.isDNA(clone.seg[i]) || this.isPos(clone.seg[i])) ){
if (forbidden_fields.indexOf(i) == -1 &&(this.isDNA(clone.seg[i]) || this.isPos(clone.seg[i])) ){
if (result.indexOf(i) == -1) result.push(i);
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment