-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
v3.6.0-beta.3 JQuery.extend (recursively) is broken #17190
Comments
This is using the same version of jQuery between the two? I’m not immediately aware of a change that would have caused this. We will probably need to bisect to track it down... |
To reproduce, I created a new project (so no extra dependencies)
This installs ember@3.5.1
Then I upgraded ember
And this gives the error |
JQuery uses In ember 3.5.1
returns
and in ember 3.6.0-beta.3
As a |
I'm seeing a very similar issue with
Stacktrace shows it's this line of code code which triggers it - which is also a I've tried all beta versions (1-4) and the problem exists in all versions. |
As a workaround I execute the following code in an initializer // TODO: remove once https://github.com/emberjs/ember.js/issues/17190 has been fixed
const properties = ['[]', 'firstObject', 'lastObject', 'hasArrayObservers', '@each'];
properties.forEach(property => {
const desc = Object.getOwnPropertyDescriptor([].__proto__, property);
desc.enumerable = false;
Object.defineProperty([].__proto__, property, desc);
}); |
This seems like a regression of the fixes in #16169 which was specifically trying to address this issue... |
I can confirm that this problem still happens in 3.6 and 3.7.0-beta.1.
See also ember-cli/ember-cli#8295 Update: I created a PR to incorporate a test for this, though it doesn't actually fix the problem. |
Hmm, that seems somewhat surprising because I think that landed after this issue was reported right? |
OK, I am trying again but using more automation (was running the test myself before and may have made a mistake). Create executable rm -rf dist/ node_modules/
yarn
ember build
node -e "require('./dist/ember.debug.js'); const a = []; for (let p in a) { if (a[p] === a) { throw new Error(\`a[\"\${p}\"] === a\`)}}" Then bisect like this
When I ran this just now it finished with:
|
Awesome, that makes sense! |
Now someone just needs to fix it :D |
Fixed by #17374 |
(cherry picked from commit 3029e9d)
(cherry picked from commit 3029e9d)
We use some jquery plugins (e.g.: bootstrap-daterangepicker), which uses the extend method from jquery. In v3.6.0-beta.3, this fails as jquery recursively iterates through the
[]
property of an array (we use the array prototype extensions of Ember)ember-source@3.5.1
$.extend(true, {}, {a:['a']})
givesember-source@3.6.0-beta.3
$.extend(true, {}, {a:['a']})
givesThe text was updated successfully, but these errors were encountered: