[object Object]

← back to Wallco Ai

Fix two more PDP runtime JS errors (hint TDZ + mailto newline token)

47df49cbbec2bbd7aac3bbb5c09758ba4c228f82 · 2026-05-31 17:39:09 -0700 · Steve Abrams

- hint TDZ: inner const hint (scale-width-hint) shadowed the outer mural-hint
  hint across the mural-level function scope, so earlier hint refs in the
  level===0/else branches hit the temporal dead zone -> Cannot access hint
  before initialization. Renamed inner to widthHint.
- mailto token: literal backslash-n in the two trade-pricing mailto bodies
  collapsed to real newlines inside a single-quoted string at template-emit ->
  unterminated string -> Invalid or unexpected token. Double-escaped.

Emitted PDP now: 48 inline scripts, 0 parse failures, 0 TDZ risk.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>

Files touched

Diff

commit 47df49cbbec2bbd7aac3bbb5c09758ba4c228f82
Author: Steve Abrams <steve@designerwallcoverings.com>
Date:   Sun May 31 17:39:09 2026 -0700

    Fix two more PDP runtime JS errors (hint TDZ + mailto newline token)
    
    - hint TDZ: inner const hint (scale-width-hint) shadowed the outer mural-hint
      hint across the mural-level function scope, so earlier hint refs in the
      level===0/else branches hit the temporal dead zone -> Cannot access hint
      before initialization. Renamed inner to widthHint.
    - mailto token: literal backslash-n in the two trade-pricing mailto bodies
      collapsed to real newlines inside a single-quoted string at template-emit ->
      unterminated string -> Invalid or unexpected token. Double-escaped.
    
    Emitted PDP now: 48 inline scripts, 0 parse failures, 0 TDZ risk.
    
    Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
---
 server.js | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/server.js b/server.js
index be8d529..198da54 100644
--- a/server.js
+++ b/server.js
@@ -14354,8 +14354,8 @@ try {
               muralRows.forEach(r  => { r.style.display = isMural ? '' : 'none'; });
               const soldBy = document.getElementById('spec-soldby');
               if (soldBy) soldBy.innerHTML = isMural ? 'Per panel (36"&nbsp;×&nbsp;11&nbsp;ft)' : 'Per roll (27&nbsp;ft)';
-              const hint = document.getElementById('scale-width-hint');
-              if (hint) hint.textContent = isMural ? '36" panel × 11 ft, sold per panel' : '24" wide, sold per roll (27 ft)';
+              const widthHint = document.getElementById('scale-width-hint');
+              if (widthHint) widthHint.textContent = isMural ? '36" panel × 11 ft, sold per panel' : '24" wide, sold per roll (27 ft)';
               // N×M tiles textual readout (UX-designer panel review 2026-05-21):
               // at zoom != 0.5× the viewport shows a magnified excerpt, not the
               // full wall — customer cannot count tiles visually. This text
@@ -15488,7 +15488,7 @@ ${(() => {
             var highEnd = Math.round(panels * (panelWidthIn/12) * panelHFt * 22);
             // Trade-priced designs get a mailto CTA instead of a public estimate.
             var costTileMural = isStudio
-              ? ('<div><a href="mailto:info@designerwallcoverings.com?subject=' + encodeURIComponent('Trade pricing inquiry — wallco.ai design #' + designId) + '&body=' + encodeURIComponent('Wall size: ' + w + ' ft × ' + h + ' ft (' + panels + ' panels @ ' + panelWidthIn + '" × 11 ft)\nDesign: https://wallco.ai/design/' + designId + '\n\nPlease send trade pricing for this install.\n') + '" style="display:inline-block;padding:8px 12px;background:#1E3550;color:#F2EADB;text-decoration:none;font:11px var(--sans);font-weight:600;letter-spacing:.08em;text-transform:uppercase;border-radius:999px">Contact for trade pricing →</a><span style="display:block;margin-top:6px;font:11px var(--sans);color:var(--ink-faint,#999);text-transform:uppercase;letter-spacing:.06em">Trade pricing</span></div>')
+              ? ('<div><a href="mailto:info@designerwallcoverings.com?subject=' + encodeURIComponent('Trade pricing inquiry — wallco.ai design #' + designId) + '&body=' + encodeURIComponent('Wall size: ' + w + ' ft × ' + h + ' ft (' + panels + ' panels @ ' + panelWidthIn + '" × 11 ft)\\nDesign: https://wallco.ai/design/' + designId + '\\n\\nPlease send trade pricing for this install.\\n') + '" style="display:inline-block;padding:8px 12px;background:#1E3550;color:#F2EADB;text-decoration:none;font:11px var(--sans);font-weight:600;letter-spacing:.08em;text-transform:uppercase;border-radius:999px">Contact for trade pricing →</a><span style="display:block;margin-top:6px;font:11px var(--sans);color:var(--ink-faint,#999);text-transform:uppercase;letter-spacing:.06em">Trade pricing</span></div>')
               : ('<div><strong style="display:block;font:22px var(--serif,Georgia,serif);color:var(--ink,#111)">~$' + lowEnd.toLocaleString() + '–$' + highEnd.toLocaleString() + '</strong><span style="font:11px var(--sans);color:var(--ink-faint,#999);text-transform:uppercase;letter-spacing:.06em">material estimate</span></div>');
             var footerMural = isStudio
               ? '<p style="margin:10px 0 0;font:11px/1.4 var(--sans);color:var(--ink-faint,#999)">Trade pricing — hand-painted-silk register. ' + panels + ' panels (' + panelWidthIn + '" × 11 ft each). Reach info@designerwallcoverings.com for a quote.</p>'
@@ -15525,7 +15525,7 @@ ${(() => {
             var highEnd = Math.round(rolls * (rollWidthIn/12) * rollLengthFt * 10);
             // Trade-priced designs hide the public $X-$Y estimate.
             var costTileWp = isStudio
-              ? ('<div><a href="mailto:info@designerwallcoverings.com?subject=' + encodeURIComponent('Trade pricing inquiry — wallco.ai design #' + designId) + '&body=' + encodeURIComponent('Wall size: ' + w + ' ft × ' + h + ' ft (' + rolls + ' rolls @ ' + rollWidthIn + '" × 27 ft)\nDesign: https://wallco.ai/design/' + designId + '\n\nPlease send trade pricing for this install.\n') + '" style="display:inline-block;padding:8px 12px;background:#1E3550;color:#F2EADB;text-decoration:none;font:11px var(--sans);font-weight:600;letter-spacing:.08em;text-transform:uppercase;border-radius:999px">Contact for trade pricing →</a><span style="display:block;margin-top:6px;font:11px var(--sans);color:var(--ink-faint,#999);text-transform:uppercase;letter-spacing:.06em">Trade pricing</span></div>')
+              ? ('<div><a href="mailto:info@designerwallcoverings.com?subject=' + encodeURIComponent('Trade pricing inquiry — wallco.ai design #' + designId) + '&body=' + encodeURIComponent('Wall size: ' + w + ' ft × ' + h + ' ft (' + rolls + ' rolls @ ' + rollWidthIn + '" × 27 ft)\\nDesign: https://wallco.ai/design/' + designId + '\\n\\nPlease send trade pricing for this install.\\n') + '" style="display:inline-block;padding:8px 12px;background:#1E3550;color:#F2EADB;text-decoration:none;font:11px var(--sans);font-weight:600;letter-spacing:.08em;text-transform:uppercase;border-radius:999px">Contact for trade pricing →</a><span style="display:block;margin-top:6px;font:11px var(--sans);color:var(--ink-faint,#999);text-transform:uppercase;letter-spacing:.06em">Trade pricing</span></div>')
               : ('<div><strong style="display:block;font:22px var(--serif,Georgia,serif);color:var(--ink,#111)">~$' + lowEnd.toLocaleString() + '–$' + highEnd.toLocaleString() + '</strong><span style="font:11px var(--sans);color:var(--ink-faint,#999);text-transform:uppercase;letter-spacing:.06em">material estimate</span></div>');
             var footerWp = isStudio
               ? '<p style="margin:10px 0 0;font:11px/1.4 var(--sans);color:var(--ink-faint,#999)">Trade pricing — mural-only design (panels join edge-to-edge); these wallpaper-roll numbers are a rough cross-reference. Reach info@designerwallcoverings.com for a quote.</p>'

← 6b5a6a1 theme-gallery: Set Live promotes a variant to take over the  ·  back to Wallco Ai  ·  Fix two more PDP inline-script newline-in-string token error 6675f7f →