Skip to content

Commit

Permalink
fix: replace global with globalThis
Browse files Browse the repository at this point in the history
This improves compatibility with cloudflare workers.
  • Loading branch information
alan-agius4 committed Oct 26, 2023
1 parent f2435fe commit 9e7881d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions lib/Element.js
Original file line number Diff line number Diff line change
Expand Up @@ -1101,8 +1101,8 @@ AttributesArray.prototype = Object.create(NamedNodeMap.prototype, {

// We can't make direct array access work (without Proxies, node >=6)
// but we can make `Array.from(node.attributes)` and for-of loops work.
if (global.Symbol && global.Symbol.iterator) {
AttributesArray.prototype[global.Symbol.iterator] = function() {
if (globalThis.Symbol?.iterator) {
AttributesArray.prototype[globalThis.Symbol.iterator] = function() {
var i=0, n=this.length, self=this;
return {
next: function() {
Expand Down
2 changes: 1 addition & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@
* you call `require("domino")`.
*/

exports.isApiWritable = !global.__domino_frozen__;
exports.isApiWritable = !globalThis.__domino_frozen__;

0 comments on commit 9e7881d

Please sign in to comment.