tests passing no wayyyyy yo

adjust-boundary-error-message
S. Elliott Johnson 2 weeks ago
parent 9802fd460a
commit df67afefee

@ -181,8 +181,6 @@ export function RegularElement(node, context) {
} }
if (select_with_value) { if (select_with_value) {
state.template.push(b.stmt(b.assignment('=', b.id('$$payload.select_value'), b.void0)));
// we need to create a child scope so that the `select_value` only applies children of this select element // we need to create a child scope so that the `select_value` only applies children of this select element
// in an async world, we could technically have two adjacent select elements with async children, in which case // in an async world, we could technically have two adjacent select elements with async children, in which case
// the second element's select_value would override the first element's select_value if the children of the first // the second element's select_value would override the first element's select_value if the children of the first

@ -221,8 +221,8 @@ export class Payload extends BasePayload {
/** @type {HeadPayload} */ /** @type {HeadPayload} */
#head; #head;
/** @type {string} */ /** @type {string | undefined} */
select_value = ''; select_value;
get css() { get css() {
return this.#css; return this.#css;
@ -237,18 +237,20 @@ export class Payload extends BasePayload {
} }
/** /**
* @param {{ id_prefix?: string, head?: HeadPayload, uid?: () => string, css?: Set<{ hash: string; code: string }>, select_value?: any }} args * @param {{ id_prefix?: string, head?: HeadPayload, uid?: () => string, css?: Set<{ hash: string; code: string }>, select_value?: string | undefined }} args
*/ */
constructor({ constructor({
id_prefix = '', id_prefix = '',
head = new HeadPayload(), head = new HeadPayload(),
uid = props_id_generator(id_prefix), uid = props_id_generator(id_prefix),
css = new Set() css = new Set(),
select_value
} = {}) { } = {}) {
super(); super();
this.#uid = uid; this.#uid = uid;
this.#css = css; this.#css = css;
this.#head = head; this.#head = head;
this.select_value = select_value;
} }
copy() { copy() {
@ -258,6 +260,7 @@ export class Payload extends BasePayload {
head: this.#head.copy() head: this.#head.copy()
}); });
payload.select_value = this.select_value;
payload.promise = this.promise; payload.promise = this.promise;
payload.out = [...this.out]; payload.out = [...this.out];
return payload; return payload;
@ -270,6 +273,7 @@ export class Payload extends BasePayload {
// @ts-expect-error // @ts-expect-error
this.out = [...other.out]; this.out = [...other.out];
this.promise = other.promise; this.promise = other.promise;
this.select_value = other.select_value;
this.#css = other.#css; this.#css = other.#css;
this.#uid = other.#uid; this.#uid = other.#uid;
this.#head.subsume(other.#head); this.#head.subsume(other.#head);

Loading…
Cancel
Save