clone() objects are not retaining properties #88

Closed
ghost opened this Issue Sep 16, 2013 · 1 comment

Comments

Projects
None yet
1 participant
@ghost

ghost commented Sep 16, 2013

I noticed this in my own code but you can actually see the effects of this problem in the docs example here:

http://ocanvas.org/docs/Display-Objects/Base/clone

There is only one black rectangle when there should be two. If the example code is edited so that:

var rectangle_2 = rectangle_1.clone({
    x: 77,
    y: 190,
    width: 200,
    height: 100
});

The rectangle will now appear.

koggdal added a commit that referenced this issue Sep 16, 2013

(patch #88) displayobject/clone: Fix error with descriptors
The last version broke the clone method in some cases, when the
properties were not directly on the object but further up the
prototype chain. oCanvas now polyfills the planned ES6 method
Object.getPropertyDescriptor to make it look through the
prototype chain as well.

@koggdal koggdal closed this Sep 16, 2013

@koggdal

This comment has been minimized.

Show comment
Hide comment
@koggdal

koggdal Sep 16, 2013

Owner

Thanks!

Owner

koggdal commented Sep 16, 2013

Thanks!

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