JS_WALA icon indicating copy to clipboard operation
JS_WALA copied to clipboard

Normalization should preserve global variable declarations

Open xiemaisi opened this issue 12 years ago • 0 comments

Consider an HTML page including two scripts 1.js and 2.js, where 1.js is

var x;

and 2.js is

alert(x);

Loading this page alerts undefined.

Assume we only normalize 1.js and leave 2.js in its original state. Loading the modified page then results in a ReferenceError since global variable x is neither declared nor defined.

To enable normalized and non-normalized code to work together, the normalization should preserve global variable declarations.

xiemaisi avatar May 31 '13 06:05 xiemaisi