-
-
Notifications
You must be signed in to change notification settings - Fork 217
WebWorkers compatibility #8
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
Conversation
The window object doesn't exists in webworkers, self must be used instead.
base64.js
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/exists/exist/
|
Inferring the environment is an increasingly challenging issue in JavaScript projects. :\ This change seems fine to me, but I'd like to get an "LGTM" from @michaelficarra before merging it. |
|
@sebcap26: In a WebWorker environment, what is the result of |
|
It seems that "this" can also be used instead of "self" in a WebWorker. Debugging WebWorkers is hard, so I had to do that in my webworker : throw new Error("test : " + (self === this)); The error message in console is "test : true". But the w3c specs refers to "self" : http://www.w3.org/TR/workers/#the-workerglobalscope-common-interface |
|
Then just changing |
Very nice. Mind updating the pull request, @sebcap26? |
|
Should I also update the minified version ? I'm not sure to have the required dependencies to "make" it :/ |
|
Try the following commands: |
|
Error on setup : ERR! Error: No compatible version found: source-map@'>=0.1.7- <0.2.0-' |
I don't know what was going on there (works for me). I made the change and pushed to master. I'll publish a new version now. |
The window object doesn't exists in webworkers, self must be used instead.