Open
Description
Too often in code reviews (just saw @lrhn's code review) we are instructing developers to avoid creating new RegExp('...')
as a class-level or local field (I've even seen it in tight-loops!). Can the RegExp
class support a const
constructor that is canonicalized?
assert(identical(const RegExp('a-z'), const RegExp('a-z'));
(Even if the implementation for the VM is not-so, we'd like this in dart2js badly)
/cc @rakudrama