joyent/node — Issue #2476: Incorrect results with UglifyJS (regression)
Author: kripken
Created: 2012-01-06 19:34:56+00:00
State: open

A testcase is here:

http://syntensity.com/static/testcase.tar.bz2

Unpack it, then to see the bug enter the directory UglifyJS that was created, and run

````
node testcase.js < emcc-3-pretty.js > new.js ; diff emcc-3-pretty.js new.js | grep -C 3 seq
````

The output is

````
317c317
< var tempDoubleBuffer = new ArrayBuffer(8);
---
> var tempDoubleBuffer = seq;
93703c93703
< absolutePath: (function(relative, base) {
---
````

Which is incorrect - the testcase only parsed and unparses the source (which was already prettified, so nothing of substance should happen). The output of that command should be empty, instead of "= seq" replacing something it shouldn't.

The bug happens in Node 0.6.5 and 0.6.6, but not in Node 0.4.9, so it looks like a regression somewhere in that range.

I have been seeing this bug in my project for a while, but as an intermittent failure that happened in our test suite once every few days. However, with the attached testcase, it appears to happen every single time.