Skip to content

Commit

Permalink
#6: Fixes bug where global.Error is undefined.
Browse files Browse the repository at this point in the history
  • Loading branch information
capricorn86 committed Oct 7, 2019
1 parent d79e8f7 commit d92b1c2
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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. |
Expand Down
7 changes: 2 additions & 5 deletions src/Window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}

Expand Down

0 comments on commit d92b1c2

Please sign in to comment.