feat(compiler): DOM adapters + html5lib implementation; misc fixes

This commit is contained in:
Yegor Jbanov
2015-02-27 14:50:06 -08:00
parent ab42664e76
commit 757eae8ad3
79 changed files with 1223 additions and 643 deletions

View File

@ -17,21 +17,25 @@ System.paths = {
'transpiler/*': '../tools/transpiler/*.js'
}
// Import all the specs, execute their `main()` method and kick off Karma (Jasmine).
Promise.all(
Object.keys(window.__karma__.files) // All files served by Karma.
.filter(onlySpecFiles)
.map(window.file2moduleName) // Normalize paths to module names.
.map(function(path) {
return System.import(path).then(function(module) {
if (module.hasOwnProperty('main')) {
module.main()
} else {
throw new Error('Module ' + path + ' does not implement main() method.');
}
});
})).then(function() {
System.import('angular2/src/dom/browser_adapter').then(function(browser_adapter) {
browser_adapter.BrowserDomAdapter.makeCurrent();
}).then(function() {
return Promise.all(
Object.keys(window.__karma__.files) // All files served by Karma.
.filter(onlySpecFiles)
.map(window.file2moduleName) // Normalize paths to module names.
.map(function(path) {
return System.import(path).then(function(module) {
if (module.hasOwnProperty('main')) {
module.main()
} else {
throw new Error('Module ' + path + ' does not implement main() method.');
}
});
}))
})
.then(function() {
__karma__.start();
}, function(error) {
console.error(error.stack || error)