Skip to content

Commit

Permalink
Remove abab dependency
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic committed Nov 26, 2023
1 parent 7027a3d commit 6d9ff2c
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
15 changes: 8 additions & 7 deletions lib/jsdom/browser/Window.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ const { fireAPageTransitionEvent } = require("../living/helpers/page-transition-
const namedPropertiesWindow = require("../living/named-properties-window");
const postMessage = require("../living/post-message");
const DOMException = require("domexception/webidl2js-wrapper");
const { btoa, atob } = require("abab");
const idlUtils = require("../living/generated/utils");
const WebSocketImpl = require("../living/websockets/WebSocket-impl").implementation;
const BarProp = require("../living/generated/BarProp");
Expand Down Expand Up @@ -757,25 +756,27 @@ function Window(options) {
this.postMessage = postMessage(window);

this.atob = function (str) {
const result = atob(str);
if (result === null) {
try {
return atob(str);
} catch (e) {
// Convert Node.js DOMException to one from our global.
throw DOMException.create(window, [
"The string to be decoded contains invalid characters.",
"InvalidCharacterError"
]);
}
return result;
};

this.btoa = function (str) {
const result = btoa(str);
if (result === null) {
try {
return btoa(str);
} catch (e) {
// Convert Node.js DOMException to one from our global.
throw DOMException.create(window, [
"The string to be encoded contains invalid characters.",
"InvalidCharacterError"
]);
}
return result;
};

this.stop = function () {
Expand Down
2 changes: 1 addition & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,6 @@
"license": "MIT",
"repository": "jsdom/jsdom",
"dependencies": {
"abab": "^2.0.6",
"cssstyle": "^3.0.0",
"data-urls": "^4.0.0",
"decimal.js": "^10.4.3",
Expand Down

0 comments on commit 6d9ff2c

Please sign in to comment.