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

Do not assume global variables are assigned to self. #205

Merged
merged 2 commits into from
Nov 2, 2019

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Nov 2, 2019

requirejs is a global variable (provided by loader.js here). The prior code made the assumption that all global variables are assigned to self/window, but this is only true in some circumstances. For example, when the entire bundle is evaluated within an IIFE self.requirejs is undefined.

Fixes #202

`requirejs` is a global variable (provided by [loader.js
here](https://github.com/ember-cli/loader.js/blob/v4.7.0/lib/loader/loader.js#L1)).
The prior code made the assumption that all global variables are
assigned to `self`/`window`, but this is _only_ true in some
circumstances. For example, when the entire bundle is evaluated within
an IIFE `self.requirejs` is undefined.
@rwjblue rwjblue merged commit 3c0e3ff into ember-cli:master Nov 2, 2019
@rwjblue rwjblue deleted the remove-self-reference branch November 2, 2019 13:20
@rwjblue rwjblue added the bug label Nov 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

v2.1.0 breaking app boot
1 participant