Last Comment Bug 420837 - "new Iterator()" throws a tautology
: "new Iterator()" throws a tautology
Status: RESOLVED FIXED
: testcase
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All All
: -- minor (vote)
: mozilla15
Assigned To: Tom Schuster [:evilpie]
:
Mentors:
: 466396 (view as bug list)
Depends on:
Blocks: jsfunfuzz
  Show dependency treegraph
 
Reported: 2008-03-04 01:29 PST by Jesse Ruderman
Modified: 2012-06-01 08:12 PDT (History)
3 users (show)
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---


Attachments
v1 (1.11 KB, patch)
2012-05-16 13:56 PDT, Tom Schuster [:evilpie]
luke: review+
Details | Diff | Review
v2 (1.17 KB, patch)
2012-05-16 14:23 PDT, Tom Schuster [:evilpie]
luke: review+
dherman: feedback+
Details | Diff | Review

Description Jesse Ruderman 2008-03-04 01:29:30 PST
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.
Comment 1 Ryan VanderMeulen [:RyanVM] 2011-11-16 19:33:31 PST
js> new Iterator()
typein:1: TypeError: Iterator is undefined

More to your liking?
Comment 2 Jesse Ruderman 2011-11-18 15:01:45 PST
Well, that's just false. I think that's worse than a tautology?
Comment 3 Jesse Ruderman 2011-11-18 15:02:39 PST
js> Iterator
function Iterator() {[native code]}

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

js> orly?
Comment 4 Jesse Ruderman 2011-11-18 15:43:48 PST
*** Bug 466396 has been marked as a duplicate of this bug. ***
Comment 5 Tom Schuster [:evilpie] 2012-05-16 13:56:45 PDT
Created attachment 624518 [details] [diff] [review]
v1

Well, I guess this can't hurt.
Comment 6 Luke Wagner [:luke] 2012-05-16 14:02:16 PDT
Comment on attachment 624518 [details] [diff] [review]
v1

The logic looks fine.  r+ assuming f+ from dherman.
Comment 7 Tom Schuster [:evilpie] 2012-05-16 14:23:52 PDT
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.
Comment 8 Dave Herman [:dherman] 2012-05-29 08:54:59 PDT
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
Comment 9 Tom Schuster [:evilpie] 2012-05-29 09:12:28 PDT
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.
Comment 11 Ed Morley [:emorley] 2012-06-01 08:12:22 PDT
https://hg.mozilla.org/mozilla-central/rev/690c6018064d

Note You need to log in before you can comment on or make changes to this bug.