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
Miscellaneous work #45
Conversation
This file seems to be a placeholder |
let allocatedLength = allocated.length; | ||
let freeLength = free.length; | ||
let reAlloc = allocated.slice(0, size - freeLength); | ||
freeAll: function freeAllPool() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Have you considered switching to
freeAll() {}
rather than trying to name the fn's yourself? In large codebases I find that manually naming things is one of the first things to go unmaintained. Over time I end up seeing:
{
methodOne: function methodOne() {},
methodTwo: function methodOne() {},
methodThree: function methodOne() {}
}
which is understandable, 'cause it's so easy to miss!
You might know this already, but in an ES2015-compliant environment, even anonymous functions will be automatically named (spec here), but this isn't implemented in any environment that I know of atm. What is implemented is giving a name to a function defined with the shorthand syntax, like:
freeAll() {}
You can test this by running these quick tests in Chrome:
var testOne = {
someProp: function() {}
};
testOne.someProp.name === ""; // true
var testTwo = {
someProp() {}
};
testTwo.someProp.name === "someProp"; // true
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a good point. I should refactor this code. The reason why Pool
was attached is that I was colliding with internal variables. Like var protect = []
and then function protect
would collide. This is easily fixed by updating the variable names to reflect what they are.
@jugglinmike had shown me the new naming semantics, but you're right I don't think they are actually implemented anywhere.
Yup that file was added with the intention of migrating some code out of |
1dba79b
to
8ae5f26
Compare
- Experimenting with webpack, although not sure it's a huge win since the dist is run through derequire - Added function names instead of leaving them anonymous - Swapped out for clearer Array#push instead of using Array#length and assigning directly - Fixed the bug where transitions were always recursively called into children when only attached and detached should - Better HTML markup handling, we conform better to the HTML spec, by removing whitespace between <html></html> and automatically add in missing <head></head> and <body></body>.
This is a collection of miscellaneous work I've been doing. Some stuff floating around in this PR:
<html></html>
and automatically add in missing<head></head>
and<body></body>
.