Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jsdom

Package Overview
Dependencies
Maintainers
6
Versions
265
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsdom - npm Package Compare versions

Comparing version 25.0.1 to 26.0.0

9

lib/jsdom/browser/js-globals.json

@@ -142,7 +142,2 @@ {

},
"Atomics": {
"writable": true,
"enumerable": false,
"configurable": true
},
"Uint8Array": {

@@ -298,3 +293,3 @@ "writable": true,

},
"Iterator": {
"SharedArrayBuffer": {
"writable": true,

@@ -304,3 +299,3 @@ "enumerable": false,

},
"SharedArrayBuffer": {
"Atomics": {
"writable": true,

@@ -307,0 +302,0 @@ "enumerable": false,

@@ -18,2 +18,5 @@ "use strict";

this.abortAlgorithms = new Set();
this._dependent = false;
this._sourceSignals = new Set();
this._dependentSignals = new Set();
}

@@ -41,2 +44,29 @@

// https://dom.spec.whatwg.org/#abortsignal-dependent
static any(globalObject, signals) {
const resultSignal = AbortSignal.createImpl(globalObject, []);
for (const signal of signals) {
if (signal.aborted) {
resultSignal.reason = signal.reason;
return resultSignal;
}
}
resultSignal.dependent = true;
for (const signal of signals) {
if (!signal.dependent) {
resultSignal._sourceSignals.add(signal);
signal._dependentSignals.add(resultSignal);
} else {
for (const sourceSignal of signal._sourceSignals) {
if (!sourceSignal.aborted && !sourceSignal.dependent) {
resultSignal._sourceSignals.add(sourceSignal);
sourceSignal._dependentSignals.add(resultSignal);
}
}
}
}
return resultSignal;
}
static timeout(globalObject, milliseconds) {

@@ -51,2 +81,3 @@ const signal = AbortSignal.createImpl(globalObject, []);

// https://dom.spec.whatwg.org/#abortsignal-signal-abort
_signalAbort(reason) {

@@ -63,2 +94,18 @@ if (this.aborted) {

const dependentSignalsToAbort = [];
for (const dependentSignal of this._dependentSignals) {
if (!dependentSignal.aborted) {
dependentSignal.reason = this.reason;
dependentSignalsToAbort.push(dependentSignal);
}
}
this._runAbortStep();
for (const dependentSignal of dependentSignalsToAbort) {
dependentSignal._runAbortStep();
}
}
_runAbortStep() {
for (const algorithm of this.abortAlgorithms) {

@@ -65,0 +112,0 @@ algorithm();

@@ -132,2 +132,3 @@ "use strict";

let observedAttributes = [];
let formAssociated = false;
const lifecycleCallbacks = {

@@ -172,4 +173,7 @@ connectedCallback: null,

const formAssociatedValue = ctor.formAssociated;
disableInternals = disabledFeatures.includes("internals");
disableShadow = disabledFeatures.includes("shadow");
formAssociated = webIDLConversions.boolean(formAssociatedValue);
} catch (err) {

@@ -190,2 +194,3 @@ caughtError = err;

objectReference: ctor,
formAssociated,
observedAttributes,

@@ -192,0 +197,0 @@ lifecycleCallbacks,

"use strict";
const DOMException = require("../generated/DOMException");
const { getLabelsForLabelable } = require("../helpers/form-controls");
class ElementInternalsImpl {

@@ -18,2 +21,13 @@ constructor(globalObject, args, { targetElement }) {

get labels() {
if (!this._targetElement._ceDefinition.formAssociated) {
throw DOMException.create(this._targetElement._globalObject, [
"Accesing an ElementInternal's labels property is only supported for form-associated custom elements",
"NotSupportedError"
]);
}
return getLabelsForLabelable(this._targetElement);
}
// https://html.spec.whatwg.org/#reflecting-content-attributes-in-idl-attributes

@@ -20,0 +34,0 @@ _reflectGetTheElement() {

@@ -197,2 +197,32 @@ "use strict";

}
static any(signals) {
if (arguments.length < 1) {
throw new globalObject.TypeError(
`Failed to execute 'any' on 'AbortSignal': 1 argument required, but only ${arguments.length} present.`
);
}
const args = [];
{
let curArg = arguments[0];
if (!utils.isObject(curArg)) {
throw new globalObject.TypeError(
"Failed to execute 'any' on 'AbortSignal': parameter 1" + " is not an iterable object."
);
} else {
const V = [];
const tmp = curArg;
for (let nextItem of tmp) {
nextItem = exports.convert(globalObject, nextItem, {
context: "Failed to execute 'any' on 'AbortSignal': parameter 1" + "'s element"
});
V.push(nextItem);
}
curArg = V;
}
args.push(curArg);
}
return utils.tryWrapperForImpl(Impl.implementation.any(globalObject, ...args));
}
}

@@ -206,3 +236,7 @@ Object.defineProperties(AbortSignal.prototype, {

});
Object.defineProperties(AbortSignal, { abort: { enumerable: true }, timeout: { enumerable: true } });
Object.defineProperties(AbortSignal, {
abort: { enumerable: true },
timeout: { enumerable: true },
any: { enumerable: true }
});
ctorRegistry[interfaceName] = AbortSignal;

@@ -209,0 +243,0 @@

@@ -135,2 +135,5 @@ "use strict";

}
if (node._ceDefinition?.formAssociated) {
return true;
}

@@ -146,3 +149,3 @@ return false;

const root = labelable.getRootNode({});
labelable._labels = NodeList.create(root._globalObject, [], {
labelable._labels = NodeList.createImpl(root._globalObject, [], {
element: root,

@@ -149,0 +152,0 @@ query: () => {

@@ -193,5 +193,10 @@ "use strict";

if (!resendWithAuth) {
const nextURL = redirectAddress.startsWith("https:") ?
new URL(redirectAddress) :
new URL(redirectAddress, this.currentURL);
let nextURL;
try {
nextURL = new URL(redirectAddress, this.currentURL);
} catch (e) {
this.emit("error", e);
return;
}
if (nextURL.hostname !== previousHostName) {

@@ -198,0 +203,0 @@ this._removeMatchingHeaders(/^authorization$/i);

@@ -204,3 +204,4 @@ "use strict";

_defaultView._length = frames.length;
Array.prototype.forEach.call(frames, (frame, i) => {
for (let i = 0; i < frames.length; ++i) {
const frame = frames.item(i);
Object.defineProperty(_defaultView, i, {

@@ -213,3 +214,3 @@ configurable: true,

});
});
}
}

@@ -216,0 +217,0 @@

@@ -72,6 +72,8 @@ "use strict";

// Warning for internal users: this returns a NodeList containing IDL wrappers instead of impls
// WARNING FOR INTERNAL USERS:
// This returns a NodeList impl, not a NodeList wrapper. NodeList impls are not iterable and do not have indexed
// properties. To iterate over them, use `for (let i = 0; i < nodeListImpl.length; ++i) { nodeListImpl.item(i) }`.
querySelectorAll(selectors) {
if (shouldAlwaysSelectNothing(this)) {
return NodeList.create(this._globalObject, [], { nodes: [] });
return NodeList.createImpl(this._globalObject, [], { nodes: [] });
}

@@ -81,3 +83,3 @@ const matcher = addNwsapi(this);

return NodeList.create(this._globalObject, [], { nodes: list.map(n => idlUtils.tryImplForWrapper(n)) });
return NodeList.createImpl(this._globalObject, [], { nodes: list.map(n => idlUtils.tryImplForWrapper(n)) });
}

@@ -84,0 +86,0 @@ }

{
"name": "jsdom",
"version": "25.0.1",
"version": "26.0.0",
"description": "A JavaScript implementation of many web standards",

@@ -26,13 +26,13 @@ "keywords": [

"dependencies": {
"cssstyle": "^4.1.0",
"cssstyle": "^4.2.1",
"data-urls": "^5.0.0",
"decimal.js": "^10.4.3",
"form-data": "^4.0.0",
"form-data": "^4.0.1",
"html-encoding-sniffer": "^4.0.0",
"http-proxy-agent": "^7.0.2",
"https-proxy-agent": "^7.0.5",
"https-proxy-agent": "^7.0.6",
"is-potential-custom-element-name": "^1.0.1",
"nwsapi": "^2.2.12",
"parse5": "^7.1.2",
"rrweb-cssom": "^0.7.1",
"nwsapi": "^2.2.16",
"parse5": "^7.2.1",
"rrweb-cssom": "^0.8.0",
"saxes": "^6.0.0",

@@ -45,3 +45,3 @@ "symbol-tree": "^3.2.4",

"whatwg-mimetype": "^4.0.0",
"whatwg-url": "^14.0.0",
"whatwg-url": "^14.1.0",
"ws": "^8.18.0",

@@ -51,3 +51,3 @@ "xml-name-validator": "^5.0.0"

"peerDependencies": {
"canvas": "^2.11.2"
"canvas": "^3.0.0"
},

@@ -62,8 +62,8 @@ "peerDependenciesMeta": {

"benchmark": "^2.1.4",
"eslint": "^9.11.0",
"eslint": "^9.17.0",
"eslint-plugin-html": "^8.1.2",
"globals": "^15.9.0",
"globals": "^15.14.0",
"js-yaml": "^4.1.0",
"minimatch": "^9.0.5",
"mocha": "^10.7.3",
"mocha": "^11.0.1",
"mocha-sugar-free": "^1.4.0",

@@ -70,0 +70,0 @@ "pngjs": "^7.0.0",

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc