Skip to content

EXTEND_PROTOTYPES false by default. #9269

@jdalton

Description

@jdalton

Currently Ember extends built-in prototypes of Array, Function, & String by default. Although Ember doesn't require these extensions and they can be disabled, because they are enabled by default they tend to stay that way as evident by sites like vine, twitch, nbcnews, & discourse using the default settings.

The problem with adding methods like Array#compact, Array#without, Array#uniq, Function#on, & String#capitalize is that it increases the likelihood that they'll be used and cause problems/roadblocks for future built-in language extensions. For example, if ES7 tried to add Array#without that behaved in a different way than Ember's Array#without newer environments would get the built-in version while older would get Ember's causing an inconsistency and increased possibility of breaking thing. We've seen this recently with MooTools and Array#contains, but it's happened before with Function#bind, String#contains, and even DOM4 Element#remove.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions