-
-
Notifications
You must be signed in to change notification settings - Fork 35.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Extend simplification + EMCAScript5 compatibility #3022
Conversation
Signed-off-by: Ben Houston <ben@exocortex.com>
|
1 - I can't answer question 1 as I am not an expert here. 2 - Seems to be costly as it requires a temporary and I'd prefer not to handle that case as |
As for point 2: it’s not expensive at all. See benchmark. Also, every big javascript lib with |
Okay. Will fix this as per Jsperf. Thx. Sent from my phone, sorry for my grammar and terseness.
|
…. Optimize Object.keys() based on @paulmillr suggestion.
@paulmillr, I have just incorporated your suggestions for improving THREE.extends but I left in backwards compatibility with browsers that don't yet support Object.keys. The reason is that THREE.js doesn't necessarily have to be used with WebGL, it can be used with CSS, Canvas, or SVG, or nothing at all if you just want to transfer data around. Thus I feel it is unfair to raise the requirements for Three.js here just to save a few lines of code. Can you @paulmillr review my changes to make sure that it is best practices? |
Very true. Thanks for being careful with this :) |
This PR contains these changes to THREE.extend:
Examples and unit tests still work.