Mercurial > hg > webaudioevaluationtool
comparison js/core.js @ 2714:52224b9d6e8b
Undefined vs null conditional checks in core.js
author | Nicholas Jillings <n.g.r.jillings@se14.qmul.ac.uk> |
---|---|
date | Fri, 14 Apr 2017 16:04:05 +0100 |
parents | 2dfc19a33bbc |
children | 23f84278dc2a |
comparison
equal
deleted
inserted
replaced
2713:2dfc19a33bbc | 2714:52224b9d6e8b |
---|---|
1200 this.initialise = function () { | 1200 this.initialise = function () { |
1201 | 1201 |
1202 // Get the data from Specification | 1202 // Get the data from Specification |
1203 var pagePool = []; | 1203 var pagePool = []; |
1204 for (var page of specification.pages) { | 1204 for (var page of specification.pages) { |
1205 if (page.position !== null || page.alwaysInclude) { | 1205 if (page.position !== undefined || page.alwaysInclude) { |
1206 page.alwaysInclude = true; | 1206 page.alwaysInclude = true; |
1207 } | 1207 } |
1208 pagePool.push(page) | 1208 pagePool.push(page) |
1209 } | 1209 } |
1210 if (specification.numPages > 0) { | 1210 if (specification.numPages > 0) { |
1213 } | 1213 } |
1214 | 1214 |
1215 // Now get the order of pages | 1215 // Now get the order of pages |
1216 var fixed = [] | 1216 var fixed = [] |
1217 for (var page of pagePool) { | 1217 for (var page of pagePool) { |
1218 if (page.position !== null) { | 1218 if (page.position !== undefined) { |
1219 fixed.push(page); | 1219 fixed.push(page); |
1220 var i = pagePool.indexOf(page); | 1220 var i = pagePool.indexOf(page); |
1221 pagePool.splice(i, 1); | 1221 pagePool.splice(i, 1); |
1222 } | 1222 } |
1223 } | 1223 } |