-
Notifications
You must be signed in to change notification settings - Fork 547
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
global is undefined in strict mode #324
Comments
Sorry for the delay. I think the reason there is so much ceremony around a simple Without using if (console && console.warn) {
// ..snip...
} If there is a way to perform this check without being broken by strict mode? |
if ((typeof console !== 'undefined') && console.warn) {
// ...
} |
aciccarello
added a commit
to TypeStrong/typedoc-default-themes
that referenced
this issue
Apr 28, 2019
fixes lunr error olivernn/lunr.js#324
aciccarello
added a commit
to TypeStrong/typedoc-default-themes
that referenced
this issue
Apr 28, 2019
* add file references to ensure concat order * remove strict modes fixes lunr error olivernn/lunr.js#324
will this be addressed any time soon? |
irnc
added a commit
to irnc/lunr.js
that referenced
this issue
May 14, 2022
Fixes olivernn#324 (allowing lunr.js import as module and usage in other strict environments) by switching lunr itself to strict mode and fixing `this` usage. `wrapper_end` was updated to the latest version of template, which uses `self` to access window and thus works in strict mode. `lurn.utils.warn` was changed as in olivernn#411 Tests added work both in Node and browser.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm using lunr with es6 syntax which need babel to compile. but babel will always enable the strict mode which will make an error in following source code:
this
in strict mode will be undefined instead of thewindow
object .By the way, I don't understand why using
global.console
instead ofconsole
, is it necessary for some edge case?The text was updated successfully, but these errors were encountered: