Check the behavior of HTMLDocument.write() / writeln().

You should see exactly 2 'PASS' lines below:
PASS
PASS

You should see exactly 2 'null' lines below:
null
null 

You should see exactly 2 'undefined' lines below:
undefined
undefined 

