"new Iterator()" throws a tautology

RESOLVED FIXED in mozilla15

Status

()

Core
JavaScript Engine
--
minor
RESOLVED FIXED
9 years ago
5 years ago

People

(Reporter: Jesse Ruderman, Assigned: evilpie)

Tracking

(Blocks: 1 bug, {testcase})

Trunk
mozilla15
testcase
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment, 1 obsolete attachment)

(Reporter)

Description

9 years ago
js> new Iterator()
typein:1: TypeError: (void 0) is undefined

This isn't an especially helpful error message.  Even I don't know what it's trying to tell me.
js> new Iterator()
typein:1: TypeError: Iterator is undefined

More to your liking?
(Reporter)

Comment 2

6 years ago
Well, that's just false. I think that's worse than a tautology?
(Reporter)

Comment 3

6 years ago
js> Iterator
function Iterator() {[native code]}

js> new Iterator()
typein:8: TypeError: Iterator is undefined

js> orly?
(Reporter)

Updated

6 years ago
Duplicate of this bug: 466396
OS: Mac OS X → All
Hardware: x86 → All
(Assignee)

Comment 5

5 years ago
Created attachment 624518 [details] [diff] [review]
v1

Well, I guess this can't hurt.
Assignee: general → evilpies
Status: NEW → ASSIGNED
Attachment #624518 - Flags: review?(luke)

Comment 6

5 years ago
Comment on attachment 624518 [details] [diff] [review]
v1

The logic looks fine.  r+ assuming f+ from dherman.
Attachment #624518 - Flags: review?(luke)
Attachment #624518 - Flags: review+
Attachment #624518 - Flags: feedback?(dherman)
(Assignee)

Comment 7

5 years ago
Created attachment 624536 [details] [diff] [review]
v2

*sorry* This is really stupid, but the previous code put the argument[0] into *vp so after conversation it would be the return value.
Attachment #624518 - Attachment is obsolete: true
Attachment #624536 - Flags: review?(luke)
Attachment #624536 - Flags: feedback?
Attachment #624518 - Flags: feedback?(dherman)

Updated

5 years ago
Attachment #624536 - Flags: review?(luke)
Attachment #624536 - Flags: review+
Attachment #624536 - Flags: feedback?(dherman)
Attachment #624536 - Flags: feedback?
Comment on attachment 624536 [details] [diff] [review]
v2

Will this still give a weird error message for new Iterator(null)? Anyway, looks fine to me.

Dave
Attachment #624536 - Flags: feedback?(dherman) → feedback+
(Assignee)

Comment 9

5 years ago
Thanks. Yes sadly still produces a rather weird error, because js_ValueToNonNullObject calls js_ReportIsNullOrUndefined, which is a bit hacky and doesn't fit the purpose here.
(Assignee)

Comment 10

5 years ago
http://hg.mozilla.org/integration/mozilla-inbound/rev/690c6018064d
Target Milestone: --- → mozilla15
https://hg.mozilla.org/mozilla-central/rev/690c6018064d
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.