Fix for #659

The problem here is that the function wrapWithDebugger() is being called twice by jasmine.HtmlReporter.specFilter() (or self.specFilter) (in jasmine-html.js) , i.e each file is debugged twice. It can be fixed by planting a flag for each file and if it was already debugged the debugging step can be skipped.

function wrapWithDebugger(originalFunction) {
    return function() {
        var stepIntoThisFunction = originalFunction.bind(this);
        debugger;
        stepIntoThisFunction();
    };
}
var state = {};
self.specFilter = function(spec) {
    var paramMap = [];
    var params = jasmine.HtmlReporter.parameters(doc);

    for (var i = 0; i < params.length; i++) {
      var p = params[i].split('=');
      paramMap[decodeURIComponent(p[0])] = decodeURIComponent(p[1]);
    }

    if (paramMap.debug && spec.getFullName() === paramMap.debug && state[spec.id]==undefined) {
      var block = spec.queue.blocks[0];
      block.func = wrapWithDebugger(block.func);
    }

    state[spec.id]=true;
.....
}

But this is not a proper fix, so I looked at the specFilter function and eventually found out that it was also being called twice. I looked at the function that called the specFilter function ie. jasmine.HtmlReporter.addSpecs() but it was being called only once, so the actual problem begins here. I searched a lot and finally found this in SpecRunner.js

env.addReporter(reporter);
env.specFilter = reporter.specFilter;
env.execute();

 where env is an instance of jasmine.getEnv() and reporter is an instance of jasmine.HtmlReporter(); env gets the specFilter definition from reporter and executes it in env.execute(); When a proper method called addSpecs is available to execute specFilter why it separately added to env and executed again?? If I'm wrong do let me know..  By the way, I commented out env.specFilter = reporter.specFilter and ran jsHint and all the tests, they passed successfully and I had to step into the function only once. :-)