Open pYr0x opened 5 years ago
I think this would break some things since we set some properties on Scope.prototype
:
So things like scope.vm.foo
wouldn't work because scope.hasOwnProperty("vm")
would be false.
Ok... good point
What if we check first with hasOwnProperty and if we didn’t found the key we check in a for-loop that’s special keys?
But how can we get this keys form can-view-scope into can-stache-key?
What if we check first with hasOwnProperty and if we didn’t found the key we check in a for-loop that’s special keys?
You mean if it isn't an own property, just check if it is one of the special properties added by can-view-scope?
yep ;), but how do we get these special properties form can-view-scope
Can you share a performance profile related to this?
btw, we need that b/c functions are almost always on the prototype.
very time
can-stache-key
reads from object in line 239 (https://github.com/canjs/can-stache-key/blob/77cd4802a6a31b18835c30305ccb3c1f94c1f68b/can-stache-key.js#L239) we check the whole object included the prototype, which we dont need (i think). by doing this thousand of time this slow down. i would recommend to replace this line intoif(value.hasOwnProperty(prop.key)) {
@phillipskevin @justinbmeyer