Enforce stricter file-level closures in JavaScript code.

Review Request #9188 — Created Sept. 8, 2017 and submitted

Information

Djblets
release-0.10.x
e02ea71...

Reviewers

With the move to ES6, we've been using { ... } around files that need
to define local variables and assuming Babel would do the right thing.

It doesn't.

Each resulting variable defined on a file level ran the risk of being
redefined by another file, and this would break all sorts of things in
confusing ways when that variable is accessed by any other code. The fix
to this is to go back to wrapping files with (function() { ... })(),
which is the only way to guarantee safety.

All files using simple braces around the file contents to enforce scope
have been updated. All future files will need to use the old form to
ensure safe scoping rules.

Unit tests pass.

david
  1. Ship It!
  2. 
      
chipx86
Review request changed

Status: Closed (submitted)

Change Summary:

Pushed to release-0.10.x (46d856c)
Loading...