Skip to content

add checks for early references to global names #583

@nicks

Description

@nicks

this class of error seems to hit me a bunch:

// ==ClosureCompiler==
// @compilation_level ADVANCED_OPTIMIZATIONS
// @output_file_name default.js
// ==/ClosureCompiler==

var x = {};
alert(x.y);
x.y = 3;

closure-compiler does not warn about this today, but I think it should. I was thinking about either moving theVariableReferenceCheck after CollapseProperties, or doing something clever in CheckGlobalNames.

any thoughts or advice on this?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions