Make options object prototype-inherited#2300
Conversation
There was a problem hiding this comment.
we could also reuse L.Util.create above for proto creation, right?
|
This is awesome, thanks a lot for taking on this! |
|
BTW, did you look how it affects performance? Like, measure instantiating 100000 markers with some options? |
|
Also, I guess accessing properties that got inherited will become a bit slower because of prototype chain lookup, but it would be insignificant in theory. |
There was a problem hiding this comment.
Is there a real use case for this? Not doing the hasOwnProperty check makes it a little faster.
There was a problem hiding this comment.
I was thinking that if L.Util.setOptions was called multiple times on the same object you wouldn't want it to add another link in the prototype chain each time.
There was a problem hiding this comment.
Oh, yeah that makes sense! So all the setStyle stuff would be affected, etc.
|
No, I didn't do any performance testing. |
Make options object prototype-inherited
Fixes #2294