perf(view): inline and refactor view instantiation and hydration

- Don’t convert DOM array into JS array via `Array.slice`
- Inline static methods for instantiation and hydration
- Misc cleanup

Closes #291
This commit is contained in:
Tobias Bosch
2014-12-09 10:31:19 -08:00
parent 8acf9fb609
commit 3ec3d5e084
11 changed files with 223 additions and 254 deletions

View File

@ -63,11 +63,8 @@ export class DOM {
static clone(node:Node) {
return node.cloneNode(true);
}
static setProperty(element:Element, name:string, value) {
element[name] = value;
}
static getProperty(element:Element, name:string) {
return element[name];
static hasProperty(element:Element, name:string) {
return name in element;
}
static getElementsByClassName(element:Element, name:string) {
return element.getElementsByClassName(name);