A function declaration does not need (and should not have) a semicolon following it:
function test(o) {
}
However, if you write a function as an expression, like the variable initializer below, then the statement should be terminated with a semicolon, just like any other statement would be:
var a = function test(o) {
};
See more about constructor vs declaration(statement) vs expression.