Last Comment Bug 312260 - Bogus "undefined property" strict warning in switch discriminants
: Bogus "undefined property" strict warning in switch discriminants
: verified1.8
Product: Core
Classification: Components
Component: JavaScript Engine (show other bugs)
: Trunk
: All All
-- normal (vote)
: mozilla1.8rc1
Assigned To: Jeff Walden [:Waldo] (remove +bmo to email)
: Jason Orendorff [:jorendorff]
Depends on:
  Show dependency treegraph
Reported: 2005-10-12 20:50 PDT by :Gavin Sharp [email:]
Modified: 2006-04-09 21:23 PDT (History)
5 users (show)
bob: in‑testsuite+
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---
Has Regression Range: ---
Has STR: ---

This easy? (3.20 KB, patch)
2005-10-14 16:07 PDT, Jeff Walden [:Waldo] (remove +bmo to email)
brendan: review+
Details | Diff | Splinter Review

Description User image :Gavin Sharp [email:] 2005-10-12 20:50:59 PDT
switch ({}.foo) {}

Warning: reference to undefined property {}.foo

<brendan> in a switch discriminant, that should be a Detecting case
<brendan> so this strict warning is bogus, a bug
Comment 1 User image Brendan Eich [:brendan] 2005-10-12 21:17:27 PDT
Anyone want to take this?  It should be easy.

Comment 2 User image Jeff Walden [:Waldo] (remove +bmo to email) 2005-10-14 16:07:01 PDT
Created attachment 199610 [details] [diff] [review]
This easy?

This was tested against both the given testcase and against a testcase with
2000 case statements which should require one of the extended switch bytecodes.
 I haven't looked at this code (or much of the rest of js, for that matter) *at
all* before this, however, so I might be missing something obvious to anyone
more familiar with the code.
Comment 3 User image Brendan Eich [:brendan] 2005-10-14 16:48:39 PDT
Comment on attachment 199610 [details] [diff] [review]
This easy?

Yes, that easy.  Thanks, please feel free to check in if you have CVS access
(if you don't have CVS access, but want access, file a bug in the
product, CVS access component, and reference your patch-work).

Comment 4 User image :Gavin Sharp [email:] 2005-10-16 15:15:17 PDT
Checked in on the trunk.
mozilla/js/src/jsopcode.tbl; new revision: 3.45;
Comment 5 User image Bob Clary [:bc:] 2005-10-21 01:37:06 PDT
Checking in regress-312260.js;
/cvsroot/mozilla/js/tests/js1_5/Regress/regress-312260.js,v  <--  regress-312260.js
initial revision: 1.1
Comment 6 User image Brendan Eich [:brendan] 2005-10-23 20:08:43 PDT
Looks like I fixed this on the branch in a patch for another bug.  No harm.

Comment 7 User image Bob Clary [:bc:] 2006-04-09 21:23:59 PDT
verified fixed 1.8.x and trunk.

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