← Back to release summary

ES2015 RegExp subclassing semantics

Category
JavaScript
Type
New or changed feature
Status
Enabled by default (Chrome 51)
Intent stage
None

Summary

This feature allows RegExp subclasses to override RegExp.prototype.exec and flags to change the semantics of higher-level functionality, such as String.prototype.replace. Previous JavaScript versions always used the original value of exec from replace. This feature makes it easier to implement new RegExp subclasses by changing a single core piece, without duplicating the higher level integration logic.

Standards & signals

View on chromestatus.com