Skip to content

Commit

Permalink
Turn extras value to string if not clonable (#228)
Browse files Browse the repository at this point in the history
  • Loading branch information
kungfooman authored Feb 14, 2025
1 parent 7acf7d2 commit d09cf1f
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src-runtime/inspectType.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,17 @@ function inspectType(value, expect, loc, name, critical = true) {
if (!isClonable(value)) {
value = valueToString;
}
crossContextPostMessage({type: 'rti', action: 'addError', destination: 'ui', value, expect, loc, name, valueToString, strings, extras, key});
for (const extra of extras) {
if (!isClonable(extra)) {
extra.value = extra.value?.toString();
}
}
const msg = {type: 'rti', action: 'addError', destination: 'ui', value, expect, loc, name, valueToString, strings, extras, key};
try {
crossContextPostMessage(msg);
} catch (e) {
console.error(e, msg);
}
}
return ret;
}
Expand Down

0 comments on commit d09cf1f

Please sign in to comment.