clone() objects are not retaining properties #88

ghost opened this Issue Sep 16, 2013 · 1 comment


None yet
1 participant

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:

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


This comment has been minimized.

Show comment
Hide comment

koggdal Sep 16, 2013




koggdal commented Sep 16, 2013


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