diff --git a/README.md b/README.md index fa862caf7..344593195 100644 --- a/README.md +++ b/README.md @@ -194,6 +194,7 @@ If you have a need for a missing feature or if you have found a bug, please let | Version | Date | Description | | ------- | ---------- | ---------------- | +| 0.3.1 | 2019-10-07 | Fixes bug where global.Error is undefined. (#6) | 0.3.0 | 2019-10-06 | Adds support for scrollTop, scrollLeft, scrollTo(), offsetLeft, offsetTop offsetHeight, offsetWidth. | | 0.2.16 | 2019-10-06 | Major bug fixes with server side rendering. | | 0.2.0 | 2019-09-20 | Adds support for SVGSVGElement, SVGElement and SVGGraphicsElement. | diff --git a/src/Window.ts b/src/Window.ts index 0b5c41485..1c8f7e6f9 100644 --- a/src/Window.ts +++ b/src/Window.ts @@ -73,11 +73,8 @@ export default class Window extends EventTarget { // Copies functionality from global (like eval, String, Array, Object etc.) if (global !== undefined) { - for (const key of Object.keys(global)) { - if (typeof this[key] === 'undefined') { - this[key] = global[key]; - } - } + const descriptors = Object.getOwnPropertyDescriptors(global); + Object.defineProperties(this, descriptors); } }