TypeError#toString() round-trips strings using single quotes from named function but double quotes from IIFE

RESOLVED WORKSFORME

Status

()

Core
JavaScript Engine
RESOLVED WORKSFORME
3 years ago
a month ago

People

(Reporter: cpeterson, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

3 years ago
If the TypeError is thrown from the top-level or a named function, the exception string uses single quotes. If thrown from an IIFE, the exception string uses double quotes.

Is this a dupe of WONTFIX'd bug 346898?

let o = {}; o[`1.1`].random_prop;
TypeError: o['1.1'] is undefined

function f() { let o = {}; o[`1.1`].random_prop; }
f()
TypeError: o['1.1'] is undefined

(function() { let o = {}; o[`1.1`].random_prop; })()
TypeError: o["1.1"] is undefined
(Reporter)

Updated

3 years ago
Summary: TypeError#toString() round-trips strings using single from named function but double quotes from IIFE → TypeError#toString() round-trips strings using single quotes from named function but double quotes from IIFE
No longer reproducible, therefore resolving as WFM.


js> let o = {}; o[`1.1`].random_prop;
typein:1:13 TypeError: o["1.1"] is undefined
Stack:
  @typein:1:13
js> function f() { let o = {}; o[`1.1`].random_prop; } f()
typein:2:28 TypeError: o["1.1"] is undefined
Stack:
  f@typein:2:28
  @typein:2:61
js> (function() { let o = {}; o[`1.1`].random_prop; })()
typein:3:27 TypeError: o["1.1"] is undefined
Stack:
  @typein:3:27
  @typein:3:2
Status: NEW → RESOLVED
Last Resolved: a month ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.