added debugger functionHook to make it compatible with browserify js