Skip to content

Commit

Permalink
Update dependencies and dev dependencies
Browse files Browse the repository at this point in the history
Notably removing the "wd" dev dependency which seems to be no longer used.
  • Loading branch information
domenic committed Aug 2, 2021
1 parent acbf496 commit 9dae17b
Show file tree
Hide file tree
Showing 8 changed files with 276 additions and 659 deletions.
2 changes: 1 addition & 1 deletion lib/jsdom/browser/resources/resource-loader.js
Expand Up @@ -25,7 +25,7 @@ module.exports = class ResourceLoader {
const dataURL = dataURLFromRecord(urlRecord);
let timeoutId;
const promise = new Promise(resolve => {
timeoutId = setTimeout(resolve, 0, dataURL.body);
timeoutId = setTimeout(resolve, 0, Buffer.from(dataURL.body));
});
promise.abort = () => {
if (timeoutId !== undefined) {
Expand Down
8 changes: 4 additions & 4 deletions lib/jsdom/living/websockets/WebSocket-impl.js
Expand Up @@ -197,13 +197,13 @@ class WebSocketImpl extends EventTargetImpl {
fireAnEvent("open", this);
}

_onMessageReceived(data) {
_onMessageReceived(data, isBinary) {
if (this.readyState !== OPEN) {
return;
}
let dataForEvent;
if (typeof data === "string") {
dataForEvent = data;
if (!isBinary) {
dataForEvent = data.toString();
} else if (this.binaryType === "arraybuffer") {
if (isArrayBuffer(data)) {
dataForEvent = data;
Expand Down Expand Up @@ -235,7 +235,7 @@ class WebSocketImpl extends EventTargetImpl {
fireAnEvent("close", this, CloseEvent, {
wasClean,
code,
reason
reason: reason.toString()
});
}

Expand Down
3 changes: 2 additions & 1 deletion lib/jsdom/living/window/navigation.js
Expand Up @@ -6,7 +6,8 @@ const idlUtils = require("../generated/utils.js");

exports.evaluateJavaScriptURL = (window, urlRecord) => {
const urlString = whatwgURL.serializeURL(urlRecord);
const scriptSource = whatwgURL.percentDecode(Buffer.from(urlString)).toString();
const encodedScriptSource = urlString.substring("javascript:".length);
const scriptSource = Buffer.from(whatwgURL.percentDecodeString(encodedScriptSource)).toString();
if (window._runScripts === "dangerously") {
try {
return window.eval(scriptSource);
Expand Down
2 changes: 1 addition & 1 deletion lib/jsdom/living/xhr/xhr-utils.js
Expand Up @@ -216,7 +216,7 @@ function createClient(xhr) {
try {
const parsed = parseDataURL(uri);
const contentType = parsed.mimeType.toString();
buffer = parsed.body;
buffer = Buffer.from(parsed.body);
response.statusCode = 200;
response.rawHeaders = ["Content-Type", contentType];
response.headers = { "content-type": contentType };
Expand Down
23 changes: 11 additions & 12 deletions package.json
Expand Up @@ -21,15 +21,15 @@
"repository": "jsdom/jsdom",
"dependencies": {
"abab": "^2.0.5",
"acorn": "^8.2.4",
"acorn": "^8.4.1",
"acorn-globals": "^6.0.0",
"cssom": "^0.4.4",
"cssom": "^0.5.0",
"cssstyle": "^2.3.0",
"data-urls": "^2.0.0",
"decimal.js": "^10.2.1",
"data-urls": "^3.0.0",
"decimal.js": "^10.3.1",
"domexception": "^2.0.1",
"escodegen": "^2.0.0",
"form-data": "^3.0.0",
"form-data": "^4.0.0",
"html-encoding-sniffer": "^2.0.1",
"http-proxy-agent": "^4.0.1",
"https-proxy-agent": "^5.0.0",
Expand All @@ -44,8 +44,8 @@
"webidl-conversions": "^6.1.0",
"whatwg-encoding": "^1.0.5",
"whatwg-mimetype": "^2.3.0",
"whatwg-url": "^8.5.0",
"ws": "^7.4.6",
"whatwg-url": "^9.0.0",
"ws": "^8.0.0",
"xml-name-validator": "^3.0.0"
},
"_dependenciesComments": {
Expand All @@ -64,23 +64,22 @@
"benchmark": "^2.1.4",
"browserify": "^17.0.0",
"chai": "^4.3.4",
"eslint": "^7.27.0",
"eslint": "^7.32.0",
"eslint-plugin-html": "^6.1.2",
"eslint-plugin-jsdom-internal": "link:./scripts/eslint-plugin",
"js-yaml": "^4.1.0",
"karma": "^6.3.2",
"karma-browserify": "^8.0.0",
"karma": "^6.3.4",
"karma-browserify": "^8.1.0",
"karma-chrome-launcher": "^3.1.0",
"karma-mocha": "^2.0.1",
"karma-mocha-webworker": "^1.3.0",
"minimatch": "^3.0.4",
"mocha": "^8.4.0",
"mocha": "^9.0.3",
"mocha-sugar-free": "^1.4.0",
"pngjs": "^6.0.0",
"rimraf": "^3.0.2",
"server-destroy": "^1.0.1",
"watchify": "^4.0.0",
"wd": "^1.14.0",
"webidl2js": "^16.2.0",
"yargs": "^17.0.1"
},
Expand Down
2 changes: 1 addition & 1 deletion test/to-port-to-wpts/htmlcanvaselement.js
Expand Up @@ -104,7 +104,7 @@ describe("htmlcanvaselement", () => {
const expectedImg = PNG.sync.read(expectedPNG);

const gotDataURL = parseDataURL(canvas.toDataURL());
const gotPNG = gotDataURL.body;
const gotPNG = Buffer.from(gotDataURL.body);
const gotImg = PNG.sync.read(gotPNG);

assert.strictEqual(gotImg.width, expectedImg.width, "width");
Expand Down
1 change: 1 addition & 0 deletions test/web-platform-tests/to-run.yaml
Expand Up @@ -1268,6 +1268,7 @@ DIR: websockets
"*.any.sharedworker.html?wss": [fail-slow, Needs SharedWorker implementation]
"*.any.worker.html?wss": [fail-slow, Needs Worker implementation]
Create-blocked-port.any.html: [fail-slow, Not implemented]
Create-blocked-port.any.html?wss: [fail-slow, Not implemented]
Create-on-worker-shutdown.any.html: [fail, Needs Worker implementation]
Send-data.worker.html?wss: [fail-slow, Needs Worker implementation]
basic-auth.any.serviceworker.html?wss: [fail-slow, Unknown]
Expand Down

0 comments on commit 9dae17b

Please sign in to comment.