Skip to content

Commit

Permalink
Detect <script type="module"> and strict mode
Browse files Browse the repository at this point in the history
  • Loading branch information
TimDaub committed Jul 15, 2020
1 parent dcfe5a6 commit 04236c7
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions lib/ical/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,13 @@
* Portions Copyright (C) Philipp Kewisch, 2011-2015 */


if ('noModule' in HTMLScriptElement.prototype) {
// In case ical.js is executed in a JavaScript module, strict mode is enabled
// and requires a global variable to be assigned explicitly to e.g. the window
// object.
window.ICAL = {};
}

/* istanbul ignore next */
/* jshint ignore:start */
if (typeof module === 'object') {
Expand Down

0 comments on commit 04236c7

Please sign in to comment.