This is not hoisting.
What's happening here is the following:
(function(){
"use strict";
// this returns an element otherwise the next line would not work
// that means the element is found in the DOM
var div = document.getElementById("hook"),
// this returns the value `undefined` or `null`
ul = div.firstElementChild,
// this is a TypeError, since `ul` is undefined
last_li = ul.lastElementChild;
alert(div) // we never actually get to this line
})();
It's possible that the Element you have has no Elements in it (maybe just text nodes?)
Here is a fiddle reproducting the issue.
Here is a fiddle where it works.