wala / jsdelta

A delta debugger for JavaScript

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

avoid minimizing function call argument list in quick mode

msridhar opened this issue · comments

In quick mode (on the modernise branch), we still seem to try to delete individual arguments to function calls, since we're minimizing all arrays. Ideally, this wouldn't happen. It's not a huge deal, except for cases where each run of the JS-processing program takes a long time, and you really want quick mode to not dig in beyond the statement level.

Could you provide a short example of this behaviour? I can't immediately see how this would happen, so I'll need to trace it through in the debugger.

Now that I look again, I can't seem to reproduce this problem. I'll re-open if I see it happening.

Ok, found an example to reproduce:

var compiler = new TypeScript.TypeScriptCompiler(outerr);

Here's the predicate I used:

var fs = require('fs');

var contents = String(fs.readFileSync(process.argv[2]));
console.log(contents);
if (contents === "var compiler = new TypeScript.TypeScriptCompiler(outerr);\n") {
  process.exit(1);
}

With the input in /tmp/foo.js and the predicate in /tmp/dummy.js, I get:

$ node ~/git-repos/jsdelta/delta.js -q --cmd "node /tmp/dummy.js" /tmp/foo.js
Testing candidate /tmp/tmp4/delta_js_0.js (58 bytes)
    aborted with error
Testing candidate /tmp/tmp4/delta_js_1.js (0 bytes)
    completed successfully
Testing candidate /tmp/tmp4/delta_js_2.js (51 bytes)
    completed successfully
Minimisation finished; final version is in /tmp/tmp4/delta_js_smallest.js

And /tmp/tmp4/delta_js_2.js contains:

var compiler = new TypeScript.TypeScriptCompiler();

This is on the modernise branch.

FYI, I just merged the modernise branch back to master, so we can fix this issue there.