Closed Bug 466396 Opened 16 years ago Closed 13 years ago

"TypeError: var x is undefined" with for each, Iterator()

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
minor

Tracking

()

RESOLVED DUPLICATE of bug 420837

People

(Reporter: jruderman, Unassigned)

Details

(Keywords: testcase)

for each (var x in [void 0]) { Iterator(); }

Result:
  TypeError: var x is undefined

Expected:
  TypeError: (void 0) is undefined
or:
  TypeError: missing argument 0 when calling function Iterator

A recent addition to jsfunfuzz caught this bug: it now checks the validity of expressions that appear in certain error messages.  "(var x)" is not a valid expression.

Strange that the value of |x| influences an error message that should have nothing to do with |x|.
With a current js shell:

js> for each (var x in [void 0]) { Iterator(); }
typein:10: TypeError: Iterator is undefined
Status: NEW → RESOLVED
Closed: 13 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.