Skip to content
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

Runner.prototype.globals refactor #1024

Closed
wants to merge 1 commit into from
Closed

Runner.prototype.globals refactor #1024

wants to merge 1 commit into from

Conversation

L8D
Copy link

@L8D L8D commented Nov 4, 2013

Instead of doing a verbose .forEach with this.globals.push, it should just use this.globals = this.globals.concat which is optimized by V8’s JIT compiler.

Instead of doing a verbose `.forEach` with `this.globals.push`, it should just use `this.globals = this.globals.concat` which is optimized by V8’s JIT compiler.
@travisjeffery
Copy link
Contributor

cool, wrong spot for the change tho. mocha.js is compiled from the real src files.

@L8D
Copy link
Author

L8D commented Nov 6, 2013

That would explain why I was editing a ~4000 line file…But also, why keep 0 == arguments.length? !arguments.length if shorter, safer, and more readable.

@tj
Copy link
Contributor

tj commented Nov 6, 2013

haha that's not really worth even arguing about :p shaving a few bytes means nothing

@L8D L8D deleted the patch-1 branch November 6, 2013 02:10
@L8D
Copy link
Author

L8D commented Nov 6, 2013

@visionmedia I see you wrote the original code from my blaming…

Why would you loop over an array just to push each item to another array? Did you forget your coffee that day?

@tj
Copy link
Contributor

tj commented Nov 6, 2013

I don't remember why that's there, not a huge deal either way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants