Skip to content

Ember.A seems to modify array instance #15020

@marcoow

Description

@marcoow

We're seeing a bug in the Ember Simple Auth dummy app (mainmatter/ember-simple-auth#1260) that seems to be caused by the fact that Enumerable.uniqEmber.A tries to modify the provided array. This only seems to affect addon projects where prototype extension is disabled (this is mostly an assumption for now though).

Reproduction steps:

var array = ['a', 'a'];
Object.freeze(array);
Ember.A(array);

// =>
ember.debug.js:21542 Uncaught TypeError: Cannot add property nextObject, object is not extensible
    at Object.defineProperty (ember.debug.js:21542)
    at applyMixin (ember.debug.js:20576)
    at MixinPrototype.apply (ember.debug.js:20770)
    at Object.A (ember.debug.js:37397)
    at eval (eval at init (query-string.js:35), <anonymous>:1:7)
    at Class.init (query-string.js:35)
    at new Class (ember.debug.js:36118)
    at Function._ClassMixinProps.create (ember.debug.js:36306)
    at Class.buildQueryString (oauth2-code.js:110)
    at Class.buildUrl (oauth2-code.js:120)

This only seems to fail in addon dummy apps but not in real apps.

/cc @Turbo87

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions