Closed Bug 394693 Opened 17 years ago Closed 3 years ago

Add strict warning for "if (! p in o)" and "if (! a instanceof b)"

Categories

(Core :: JavaScript Engine, enhancement)

enhancement
Not set
normal

Tracking

()

RESOLVED INVALID

People

(Reporter: jruderman, Unassigned)

References

Details

(Keywords: testcase)

js> var o = {}, p = "a"; if (! p in o) { print("no a in p") }; void 0 js> var o = {}, p = "a"; if (!(p in o)) { print("no a in p") }; void 0 no a in p I think the first one should trigger a strict warning, to help avoid bugs like bug 382075. It rarely makes sense to have a boolean expression on the LHS of the "in" operator, and it never makes sense with the "instanceof" operator.
Blocks: 296661
OS: Mac OS X → All
Hardware: x86 → All
Assignee: general → nobody

No longer valid after bug 1619177.

Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.