Closed Bug 104493 Opened 24 years ago Closed 24 years ago

questionable dead code in NativeRegExp.java

Categories

(Rhino Graveyard :: Core, defect)

defect
Not set
trivial

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: bdc, Assigned: norrisboyd)

Details

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?
cc'ing Roger -
OS: Windows 2000 → All
Summary: questionable dead code → questionable dead code in NativeRegExp.java
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
Closed: 24 years ago
Resolution: --- → FIXED
Marking Verified -
Status: RESOLVED → VERIFIED
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.