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

DefineMap set new prop undefined #408

Closed
Mattchewone opened this Issue Nov 16, 2018 · 1 comment

Comments

Projects
None yet
3 participants
@Mattchewone
Copy link
Contributor

Mattchewone commented Nov 16, 2018

Expected: setting a new prop should fire add even if new prop is undefined

import { DefineMap, Reflect } from "//unpkg.com/can@5/core.mjs";

const obj = new DefineMap({});
Reflect.onPatches(obj, handler);
obj.set("foo", undefined);  
obj.set("foo", "baz");  

Calling obj.set("foo", undefined); for the first time should log the following:

[{ type: "add", key: "foo", value: undefined }]

The type should be add since the property was not defined and is now defined albeit undefined

@cherifGsoul

This comment has been minimized.

Copy link
Member

cherifGsoul commented Dec 11, 2018

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