Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/icy-otters-fall.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'svelte': patch
---

fix: locate Rollup annontaion friendly to JS downgraders
4 changes: 3 additions & 1 deletion packages/svelte/src/internal/client/constants.js
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,9 @@ export const STALE_REACTION = new (class StaleReactionError extends Error {
message = 'The reaction that called `getAbortSignal()` was re-run or destroyed';
})();

export const IS_XHTML = /* @__PURE__ */ globalThis.document?.contentType?.includes('xml') ?? false;
export const IS_XHTML =
!!globalThis.document?.contentType &&
Comment thread
dummdidumm marked this conversation as resolved.
/* @__PURE__ */ globalThis.document.contentType.includes('xml');
export const ELEMENT_NODE = 1;
export const TEXT_NODE = 3;
export const COMMENT_NODE = 8;
Expand Down
9 changes: 4 additions & 5 deletions packages/svelte/src/internal/client/dom/reconciler.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,14 @@

import { create_element } from './operations.js';

const policy = /* @__PURE__ */ globalThis?.window?.trustedTypes?.createPolicy(
'svelte-trusted-html',
{
const policy =
globalThis?.window?.trustedTypes &&
Comment thread
dummdidumm marked this conversation as resolved.
/* @__PURE__ */ globalThis.window.trustedTypes.createPolicy('svelte-trusted-html', {
/** @param {string} html */
createHTML: (html) => {
return html;
}
}
);
});

/** @param {string} html */
function create_trusted_html(html) {
Expand Down
Loading