Skip to content

canReflect.assignDeep doesn't deep copy DefineMap #150

@green3g

Description

@green3g

Code Sample:

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


const a = {};
const b = new DefineMap({
	prop: {
		test: 'hello'
	}
});

Reflect.assignDeep(a, b);

console.log(a.prop === b.prop); // true

https://codepen.io/anon/pen/rQOBPx?editors=0011

Objects nested inside a define map won't be deep copied, instead they will still reference the original object.

I may be wrong on this, but I would expect a to be a plain object with all of the properties from b copied over, not referenced.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions