rstacruz/jsdom-global

Globalizing window keys

Closed this issue · 3 comments

amsul commented

Please see: jsdom/jsdom#1549

From their changelog for v9.4.0:

Fixed all constructors that appears as globals on the jsdom window object to be non-enumerable.

This means that these lines no longer work:

jsdom-global/index.js

Lines 37 to 41 in bc52cfe

Object.keys(window).forEach(function (key) {
if (blacklist.indexOf(key) !== -1) return
keys.push(key)
global[key] = window[key]
})

Object.keys(window).forEach(function (key) {
  if (blacklist.indexOf(key) !== -1) return
  keys.push(key)
  global[key] = window[key]
}))

I'm not exactly sure if they have a better API to allow globalizing the window properties.. So I'm waiting for a reply until I can suggest a solution. But maybe you have some thoughts around this.

Cheers!

Interesting, I'm gonna guess we can just maintain a hard-coded list of
keys.

On Mon, Jul 4, 2016, 2:09 PM amsul notifications@github.com wrote:

Please see: jsdom/jsdom#1549
jsdom/jsdom#1549

From their changelog for v9.4.0:

Fixed all constructors that appears as globals on the jsdom window object
to be non-enumerable.

This means that these lines no longer work:

jsdom-global/index.js

Lines 37 to 41 in bc52cfe

Object.keys(window).forEach(function (key) {
if (blacklist.indexOf(key) !== -1) return
keys.push(key)
global[key] = window[key]
})

Object.keys(window).forEach(function (key) {
if (blacklist.indexOf(key) !== -1) return
keys.push(key)
global[key] = window[key]
}))

I'm not exactly sure if they have a better API to allow globalizing the
window properties.. So I'm waiting for a reply until I can suggest a
solution. But maybe you have some thoughts around this.

Cheers!


You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub
#6, or mute the thread
https://github.com/notifications/unsubscribe/AAEikQpIMl4F5qwaoS0yey9lcoAnY4Kxks5qSKN-gaJpZM4JEE1E
.

amsul commented
amsul commented

Solved with #7 (comment)