questionable dead code in NativeRegExp.java

VERIFIED FIXED in 1.5R3

Status

--
trivial
VERIFIED FIXED
17 years ago
15 years ago

People

(Reporter: bdc, Assigned: norrisboyd)

Tracking

other
1.5R3

Details

(Reporter)

Description

17 years ago
We have a tool that looks for a scary noop case of assigning an instance field 
to itself. this usually comes from a constructor that assigns a argument to a 
instance field with the same name and then later the argument changes name. we 
ran our tool on all of our classes we have in our classpath here and found this 
problem in your code.

rhino1_5R2/src/org/mozilla/javascript/regexp/NativeRegExp.java line 159 it has:
        this.flags = flags;

This seems to be a bad cut and paste from the CompilerState constructor on line 
2155. or has some initialization that used to work been lost?

Comment 1

17 years ago
cc'ing Roger - 

Updated

17 years ago
OS: Windows 2000 → All
Summary: questionable dead code → questionable dead code in NativeRegExp.java
(Assignee)

Comment 2

17 years ago
Fixed-- The value of flags is computed earlier in the method, so I believe
it is safe just to remove the assignment.

Thanks for finding this.
Status: NEW → RESOLVED
Last Resolved: 17 years ago
Resolution: --- → FIXED

Comment 3

17 years ago
Marking Verified - 
Status: RESOLVED → VERIFIED

Comment 4

15 years ago
Targeting as resolved against 1.5R3
Target Milestone: --- → 1.5R3
You need to log in before you can comment on or make changes to this bug.