Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Just use window to define globals to avoid complicated iife stuff #86

Open
brad4d opened this issue Apr 19, 2017 · 0 comments
Open

Just use window to define globals to avoid complicated iife stuff #86

brad4d opened this issue Apr 19, 2017 · 0 comments

Comments

@brad4d
Copy link

brad4d commented Apr 19, 2017

This is an offshoot of #85

test-helpers.js and other files use a complicated pass-global-and-scope-object-to-an-iife method of defining things in an effort to support both some complex loading situations and closure-compiler compilation.

An explanation and understandable emotional reaction may be found here.
#69

As a member of the closure-compiler team, I'd like to suggest that you just use window.foo = ... to define your globals. My rationale is this:

  1. You are polymer. You must be running in a browser environment, so you know window is always available.
  2. You're already using window in lots of the implementations anyway.
  3. We're moving rapidly toward a strict-mode-only world. In strict mode this isn't even defined in global scope.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant