Fix Gerrit global scoping issue

I47a487e3 added the definition of the Gerrit global to help enable
Closure compilation. However, the object created by
`let Gerrit = window.Gerrit || {}` was never reassigned to
window.Gerrit, leading to window.Gerrit being initialized to a different
empty object when the first behavior was loaded.

A gr-endpoint-decorator element is included in gr-app.html. For that
specific endpoint, the Gerrit object referenced in
gr-endpoint-decorator.js was not the window.Gerrit object that contained
the properly initialized endpoints.

With this change, the object reference is reassigned window.Gerrit in
every root view touched by the aforementioned change.

Change-Id: I0d571918043311ac07a966d0faf126d355b55a5b
This commit is contained in:
Kasper Nilsson 2018-09-19 14:03:39 -07:00
parent a5fe3c44d7
commit 18ded36feb
3 changed files with 4 additions and 1 deletions

View File

@ -29,6 +29,7 @@ limitations under the License.
// Needed for JSCompiler to understand it's global.
// eslint-disable-next-line no-unused-vars, prefer-const
let Gerrit = window.Gerrit || {};
window.Gerrit = Gerrit;
</script>
<link rel="import" href="../bower_components/polymer/polymer.html">

View File

@ -18,6 +18,7 @@ limitations under the License.
// Needed for JSCompiler to understand it's global.
// eslint-disable-next-line no-unused-vars, prefer-const
let Gerrit = window.Gerrit || {};
window.Gerrit = Gerrit;
</script>
<link rel="import" href="../bower_components/polymer/polymer.html">
<link rel="import" href="../elements/change/gr-change-view/gr-change-view.html">

View File

@ -2,5 +2,6 @@
// Needed for JSCompiler to understand it's global.
// eslint-disable-next-line no-unused-vars, prefer-const
let Gerrit = window.Gerrit || {};
window.Gerrit = Gerrit;
</script>
<link rel="import" href="../elements/diff/gr-diff/gr-diff.html">
<link rel="import" href="../elements/diff/gr-diff/gr-diff.html">