Closed Bug 420837 Opened 16 years ago Closed 12 years ago

"new Iterator()" throws a tautology

Categories

(Core :: JavaScript Engine, defect)

defect
Not set
minor

Tracking

()

RESOLVED FIXED
mozilla15

People

(Reporter: jruderman, Assigned: evilpie)

References

Details

(Keywords: testcase)

Attachments

(1 file, 1 obsolete file)

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?
Well, that's just false. I think that's worse than a tautology?
js> Iterator
function Iterator() {[native code]}

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

js> orly?
OS: Mac OS X → All
Hardware: x86 → All
Attached patch v1 (obsolete) — Splinter Review
Well, I guess this can't hurt.
Assignee: general → evilpies
Status: NEW → ASSIGNED
Attachment #624518 - Flags: review?(luke)
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)
Attached patch v2Splinter Review
*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)
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+
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.
http://hg.mozilla.org/integration/mozilla-inbound/rev/690c6018064d
Target Milestone: --- → mozilla15
https://hg.mozilla.org/mozilla-central/rev/690c6018064d
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: