Last Comment Bug 420837 - "new Iterator()" throws a tautology
: "new Iterator()" throws a tautology
: testcase
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All All
-- minor (vote)
: mozilla15
Assigned To: Tom Schuster [:evilpie]
: Jason Orendorff [:jorendorff]
: 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:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

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

Description User image 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 User image 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 User image Jesse Ruderman 2011-11-18 15:01:45 PST
Well, that's just false. I think that's worse than a tautology?
Comment 3 User image 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 User image Jesse Ruderman 2011-11-18 15:43:48 PST
*** Bug 466396 has been marked as a duplicate of this bug. ***
Comment 5 User image Tom Schuster [:evilpie] 2012-05-16 13:56:45 PDT
Created attachment 624518 [details] [diff] [review]

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

The logic looks fine.  r+ assuming f+ from dherman.
Comment 7 User image Tom Schuster [:evilpie] 2012-05-16 14:23:52 PDT
Created attachment 624536 [details] [diff] [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.
Comment 8 User image Dave Herman [:dherman] 2012-05-29 08:54:59 PDT
Comment on attachment 624536 [details] [diff] [review]

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

Comment 9 User image 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 User image Ed Morley [:emorley] 2012-06-01 08:12:22 PDT

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