There's an upstream bug in v8 that was cherry-picked today and merged. The bug is as follows and also is reproducible in node itself:
Bug Description:
functionfoo(){returntypeofnull==='undefined';}vara=0;varb=0;for(vari=0;i<10000;i++){foo()===true ? a++ : b++;}varpa=((a/(a+b))*100).toFixed(2);varpb=((b/(a+b))*100).toFixed(2);console.log('true '+pa+'%');console.log('false '+pb+'%');Outcome:
node typeof_null.js true 47.44%
false 52.56%
node typeof_null.js true 40.94%
false 59.06%
There's an upstream bug in v8 that was cherry-picked today and merged. The bug is as follows and also is reproducible in node itself:
Bug Description:
Outcome: