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

babel error - diffview.js #21

Closed
mglazer-cengage opened this issue Feb 23, 2016 · 1 comment · May be fixed by #35
Closed

babel error - diffview.js #21

mglazer-cengage opened this issue Feb 23, 2016 · 1 comment · May be fixed by #35

Comments

@mglazer-cengage
Copy link

ReferenceError: Strict mode forbids implicit creation of global property 'diffview'

Can you please add a 'var' declaration on line 30 of diffview.js?

var diffview = {

Please merge PR #22

@sgbeal
Copy link

sgbeal commented Dec 19, 2018

i know this is old, but wanted to point out that this change breaks client code (shamefully, mine) which loads diffview.js/difflib.js dynamically via eval and expects diffview/difflib to be declared globally after those scripts are loaded. (Granted, the use of eval in the first place was not my best idea ever, but i'm hesitant to go back and patch otherwise unmaintained trees for this.) A different, backwards-compatible approach would have been:

window.diffview = {...}

And likewise for difflib. That approach is semantically identical to the older approach, but is not in violation of strict mode.

Not a big deal, just pointing it out.

abbaskiko added a commit to abbaskiko/jsdifflib that referenced this issue Sep 17, 2021
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

Successfully merging a pull request may close this issue.

3 participants
@sgbeal @mglazer-cengage and others