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

Enable removeAttr on Map keys with dot #774

Merged
merged 2 commits into from Mar 13, 2014

Conversation

Projects
None yet
2 participants
@janza
Contributor

janza commented Mar 11, 2014

Allows removal of Map keys with dots in case nested property does not exist.
Similar to #318, shouldn't affect any existing functionality.

@daffl daffl added this to the 2.0.6 milestone Mar 12, 2014

@daffl daffl added the Bug label Mar 12, 2014

@@ -55,6 +55,15 @@ steal("can/map", "can/compute", "can/test", function (undefined) {
deepEqual(can.Map.keys(state), ["productType"], "one property");
});
test("remove attr on key with dot", function () {
var state = new can.Map({
"key.with.dots": 12,

This comment has been minimized.

@daffl

daffl Mar 12, 2014

Contributor

We might also want to make sure that something like

var state = new can.Map({
    "key.with.dots": 12,
    key: { with: { something: 'else' } }
});

state.removeAttr('key.with.something')

still works. Besides that, great catch, thanks!

@daffl

daffl Mar 12, 2014

Contributor

We might also want to make sure that something like

var state = new can.Map({
    "key.with.dots": 12,
    key: { with: { something: 'else' } }
});

state.removeAttr('key.with.something')

still works. Besides that, great catch, thanks!

@janza

This comment has been minimized.

Show comment
Hide comment
@janza

janza Mar 12, 2014

Contributor

Alright, updated the test in pull request.

Contributor

janza commented Mar 12, 2014

Alright, updated the test in pull request.

@daffl

This comment has been minimized.

Show comment
Hide comment
@daffl

daffl Mar 13, 2014

Contributor

Awesome, thank you!

Contributor

daffl commented Mar 13, 2014

Awesome, thank you!

daffl added a commit that referenced this pull request Mar 13, 2014

Merge pull request #774 from janza/removeattr-dotted-keys
Enable removeAttr on Map keys with dot

@daffl daffl merged commit 98eeccf into canjs:master Mar 13, 2014

1 check passed

default The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment