Skip to content

Shallow options#193

Closed
jzaefferer wants to merge 4 commits into
masterfrom
shallow-options
Closed

Shallow options#193
jzaefferer wants to merge 4 commits into
masterfrom
shallow-options

Conversation

@jzaefferer
Copy link
Copy Markdown
Member

This addresses the issue of $.widget deep copying all options, which is a problem when dealing with large arrays, both for performance and identity reasons.

The tests are mostly taken from jQuery core's testsuite to maintain compability, with the exception of not deep-copying arrays, just plain objects.

semantics mostly the same, but without cloning anything but plain
objects, e.g. not cloning of arrays
Comment thread tests/unit/widget/widget_extend.js Outdated
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm confused what's being tested here. settings has already been extended with options at this point, so the next assertion should be true even if no merging occurs here.

@jzaefferer
Copy link
Copy Markdown
Member Author

Updated.

@jzaefferer
Copy link
Copy Markdown
Member Author

Another update.

@jzaefferer
Copy link
Copy Markdown
Member Author

Okay, now there is another update. Including messed up commit message..

@scottgonzalez
Copy link
Copy Markdown
Member

Landed in b915325. I switched back to $.extend() on the constructor, since that doesn't deal with options, also removed the test for extending functions, since that shouldn't occur in options.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants