chore: tweak add_locations (#11761)

pull/11763/head
Rich Harris 4 months ago committed by GitHub
parent 4a708dd005
commit fec57e298e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -1,6 +1,5 @@
import { HYDRATION_END, HYDRATION_START } from '../../../constants.js';
import { hydrating } from '../dom/hydration.js';
import { is_array } from '../utils.js';
/**
* @param {any} fn
@ -12,7 +11,7 @@ export function add_locations(fn, filename, locations) {
return (/** @type {any[]} */ ...args) => {
const dom = fn(...args);
var node = hydrating && is_array(dom) ? dom[0] : dom.nodeType === 11 ? dom.firstChild : dom;
var node = hydrating ? dom : dom.nodeType === 11 ? dom.firstChild : dom;
assign_locations(node, filename, locations);
return dom;

Loading…
Cancel
Save