Skip to content

Commit

Permalink
attributeBindings is frozen, slice it before push
Browse files Browse the repository at this point in the history
As noted in the Ember v2.11 release notes, concatenated properties such
as attributeBindings are frozen in debug builds. This means we cannot
push directly onto the attributeBindings array without first copying it
via slice.

Without this change, users may see errors like this when the
`attributeBindings.push()` call is made:

Uncaught TypeError: Can't add property 2, object is not extensible

References:

emberjs/ember.js#14389
emberjs/ember.js#14601
  • Loading branch information
bgentry committed Jan 24, 2017
1 parent 168c506 commit 951872c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion addon/utils/bind-data-test-attributes.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default function bindDataTestAttributes(component) {
attributeBindings = [attributeBindings];
}

dataTestProperties.forEach(it => attributeBindings.push(it));
dataTestProperties.forEach(it => attributeBindings.slice().push(it));

component.set('attributeBindings', attributeBindings);
}

0 comments on commit 951872c

Please sign in to comment.