You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An issue occurs when L10N is being used in a browserless environment, such as being run directly using Node.
The issues largely come from the assumption that certain objects will exist, such as self, XMLHttpRequest and document, with the former two causing ReferenceErrors when they are reached in the code. This is particularly a problem when it comes to running Unit Tests on localization code inside environments like Mocha.
The errors in question are as follows:
ReferenceError: self is not defined at l10n.js:20:9
and
ReferenceError: XMLHttpRequest is not defined at l10n.js:196:11
I have a proposed set of changes to fix this issue for Node that I can create a PR for, if it is considered something that is in scope for the library to handle.
The text was updated successfully, but these errors were encountered:
An issue occurs when L10N is being used in a browserless environment, such as being run directly using Node.
The issues largely come from the assumption that certain objects will exist, such as
self
,XMLHttpRequest
anddocument
, with the former two causing ReferenceErrors when they are reached in the code. This is particularly a problem when it comes to running Unit Tests on localization code inside environments like Mocha.The errors in question are as follows:
ReferenceError: self is not defined at l10n.js:20:9
and
ReferenceError: XMLHttpRequest is not defined at l10n.js:196:11
I have a proposed set of changes to fix this issue for Node that I can create a PR for, if it is considered something that is in scope for the library to handle.
The text was updated successfully, but these errors were encountered: