This does not work like you think it does. ThrowRangeError() only _schedules_ the exception, it doesn't return it. It's actual return value is Undefined which, when cast to Object, will produce undefined (pun intended) behavior.