mirror of
https://github.com/systemjs/systemjs.git
synced 2026-02-01 15:59:54 +00:00
manual merge of TypeScript work
This commit is contained in:
parent
c6522d206f
commit
5af8d5531d
@ -22,7 +22,8 @@
|
||||
setMetaGlobal(this, 'babel');
|
||||
setMetaGlobal(this, 'traceur');
|
||||
setMetaGlobal(this, 'traceur-runtime');
|
||||
setMetaGlobal(this, 'babel/external-helpers');
|
||||
setMetaGlobal(this, 'babel/external-helpers.js');
|
||||
setMetaGlobal(this, 'typescript/bin/typescript.js');
|
||||
};
|
||||
});
|
||||
|
||||
@ -84,7 +85,7 @@
|
||||
});
|
||||
}
|
||||
if (!__global.babelHelpers && load.source.match(babelHelpersRegEx)) {
|
||||
return loader['import']('babel/external-helpers').then(function() {
|
||||
return loader['import']('babel/external-helpers.js').then(function() {
|
||||
return source;
|
||||
});
|
||||
}
|
||||
|
||||
@ -15,7 +15,8 @@
|
||||
"devDependencies": {
|
||||
"babel-core": "^5.0.10",
|
||||
"qunit": "^0.6.2",
|
||||
"traceur": "0.0.87",
|
||||
"traceur": "0.0.88",
|
||||
"typescript": "mhegazy/typescript#v1.5-beta2",
|
||||
"uglify-js": "~2.4.13"
|
||||
},
|
||||
"scripts": {
|
||||
|
||||
32
test/test-typescript.html
Normal file
32
test/test-typescript.html
Normal file
@ -0,0 +1,32 @@
|
||||
<!doctype html>
|
||||
<html>
|
||||
<head>
|
||||
<link rel="stylesheet" type="text/css" href="../bower_components/qunit/qunit/qunit.css"/>
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<h1 id="qunit-header">SystemJS Test Suite</h1>
|
||||
|
||||
<h2 id="qunit-banner"></h2>
|
||||
<div id="qunit-testrunner-toolbar"></div>
|
||||
<h2 id="qunit-userAgent"></h2>
|
||||
<ol id="qunit-tests"></ol>
|
||||
<div id="qunit-test-area"></div>
|
||||
|
||||
<!-- <script src="../bower_components/traceur/traceur.js"></script> -->
|
||||
<script src="../node_modules/es6-module-loader/dist/es6-module-loader.src.js"></script>
|
||||
<script src="../dist/system.src.js" type="text/javascript"></script>
|
||||
<script>
|
||||
System.paths['typescript'] = '../node_modules/typescript/bin/typescript.js';
|
||||
System.meta['typescript'] = { format: 'global', exports: 'ts' };
|
||||
System.transpiler = 'typescript';
|
||||
System['import']('test.js')['catch'](function(e) {
|
||||
setTimeout(function() {
|
||||
throw e;
|
||||
})
|
||||
});
|
||||
</script>
|
||||
|
||||
<script src="../bower_components/qunit/qunit/qunit.js"></script>
|
||||
</body>
|
||||
</html>
|
||||
@ -484,6 +484,8 @@ asyncTest('ES6 named export loading of CJS', function() {
|
||||
});
|
||||
});
|
||||
|
||||
// TypeScript does not support async functions yet
|
||||
if (System.transpiler !== 'typescript')
|
||||
asyncTest('Async functions', function() {
|
||||
System.babelOptions = { stage: 0 };
|
||||
System.traceurOptions = { asyncFunctions: true };
|
||||
@ -493,6 +495,7 @@ asyncTest('Async functions', function() {
|
||||
});
|
||||
});
|
||||
|
||||
if (System.transpiler !== 'typescript')
|
||||
asyncTest('Wrapper module support', function() {
|
||||
System['import']('tests/wrapper.js').then(function(m) {
|
||||
ok(m.d == 'default1', 'Wrapper module not defined.');
|
||||
|
||||
16
test/tests/worker-typescript.js
Normal file
16
test/tests/worker-typescript.js
Normal file
@ -0,0 +1,16 @@
|
||||
importScripts('../../node_modules/es6-module-loader/dist/es6-module-loader.js',
|
||||
'../../dist/system.js');
|
||||
|
||||
System.baseURL = '../';
|
||||
System.paths['typescript'] = '../../node_modules/typescript/bin/typescript.js';
|
||||
System.meta['typescript'] = { format: 'global', exports: 'ts' };
|
||||
System.transpiler = 'typescript';
|
||||
|
||||
System.import('tests/es6-and-amd').then(function(m) {
|
||||
postMessage({
|
||||
amd: m.amd_module,
|
||||
es6: m.es6_module
|
||||
});
|
||||
}, function(err) {
|
||||
console.error(err);
|
||||
});
|
||||
Loading…
x
Reference in New Issue
Block a user