Open
Bug 901442
Opened 11 years ago
Updated 8 months ago
Don't allocate an object when doing if(Object(x) === x)
Categories
(Core :: JavaScript Engine, enhancement, P3)
Core
JavaScript Engine
Tracking
()
NEW
People
(Reporter: bruant.d, Unassigned)
References
(Blocks 1 open bug)
Details
|if(Object(x) === x)| is recurrent boilerplate used to know whether a value is an object (because typeof is broken). Per spec, it's supposed to allocate an object if x isn't one (and return x if it is), so this particular pattern doesn't need the extra allocation of an object which will not be used (except for its identity)
Assignee | ||
Updated•10 years ago
|
Assignee: general → nobody
Updated•2 years ago
|
Severity: normal → S3
Comment 1•8 months ago
|
||
(Unclear if this is still a super common pattern)
You need to log in
before you can comment on or make changes to this bug.
Description
•