jsweet icon indicating copy to clipboard operation
jsweet copied to clipboard

Variables named document, window not sanitized

Open rendaw opened this issue 4 years ago • 0 comments

public class ThingA {
  void x() {
    int document = 3;
    Globals.document.createElement(StringTypes.div);
  }
}

produces the error

property 'createElement' does not exist on type 'number'

because Globals.document becomes document and collides with the declaration on the previous line.

The same things happens if there's a variable named window and Globals.window is accessed.

rendaw avatar Feb 07 '21 04:02 rendaw