diff --git a/gulpfile.js b/gulpfile.js index de112a2730..5e3aa9da38 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -91,19 +91,18 @@ var treatTestErrorsAsFatal = true; function runJasmineTests(globs, done) { var args = ['--'].concat(globs); - fork('./tools/traceur-jasmine', args, { - stdio: 'inherit' - }).on('close', function jasmineCloseHandler(exitCode) { - if (exitCode && treatTestErrorsAsFatal) { - var err = new Error('Jasmine tests failed'); - // Mark the error for gulp similar to how gulp-utils.PluginError does it. - // The stack is not useful in this context. - err.showStack = false; - done(err); - } else { - done(); - } - }); + fork('./tools/cjs-jasmine', args, {stdio: 'inherit'}) + .on('close', function jasmineCloseHandler(exitCode) { + if (exitCode && treatTestErrorsAsFatal) { + var err = new Error('Jasmine tests failed'); + // Mark the error for gulp similar to how gulp-utils.PluginError does it. + // The stack is not useful in this context. + err.showStack = false; + done(err); + } else { + done(); + } + }); } // Note: when DART_SDK is not found, all gulp tasks ending with `.dart` will be skipped. @@ -141,11 +140,8 @@ var BENCHPRESS_BUNDLE_CONFIG = { 'angular2' ], excludes: [ - 'traceur', - 'traceur/bin/traceur-runtime', 'reflect-metadata', 'selenium-webdriver', - 'rtts_assert', 'zone.js' ], ignore: [ @@ -837,47 +833,46 @@ gulp.task('build/pure-packages.dart', function() { ]) .pipe(gulp.dest(path.join(CONFIG.dest.dart, 'angular2'))); - var moveStream = gulp - .src([ - 'modules_dart/**/*.dart', - 'modules_dart/**/pubspec.yaml', - '!modules_dart/transform/**' - ]) - .pipe(through2.obj(function(file, enc, done) { - if (file.path.endsWith('pubspec.yaml')) { - // Pure packages specify dependency_overrides relative to - // `modules_dart`, so they have to walk up and into `dist`. - // - // Example: - // - // dependency_overrides: - // angular2: - // path: ../../dist/dart/angular2 - // - // When we copy a pure package into `dist` the relative path - // must be updated. The code below replaces paths accordingly. - // So the example above is turned into: - // - // dependency_overrides: - // angular2: - // path: ../angular2 - // - var pubspec = yaml.safeLoad(file.contents.toString()); - var overrides = pubspec.dependency_overrides; - if (overrides) { - Object.keys(overrides).forEach(function(pkg) { - var overridePath = overrides[pkg].path; - if (overridePath.startsWith(originalPrefix)) { - overrides[pkg].path = overridePath.replace(originalPrefix, '../'); - } - }); - file.contents = new Buffer(yaml.safeDump(pubspec)); - } - } - this.push(file); - done(); - })) - .pipe(gulp.dest(CONFIG.dest.dart)); + var moveStream = gulp.src([ + 'modules_dart/**/*.dart', + 'modules_dart/**/pubspec.yaml', + '!modules_dart/transform/**' + ]) + .pipe(through2.obj(function(file, enc, done) { + if (/pubspec.yaml$/.test(file.path)) { + // Pure packages specify dependency_overrides relative to + // `modules_dart`, so they have to walk up and into `dist`. + // + // Example: + // + // dependency_overrides: + // angular2: + // path: ../../dist/dart/angular2 + // + // When we copy a pure package into `dist` the relative path + // must be updated. The code below replaces paths accordingly. + // So the example above is turned into: + // + // dependency_overrides: + // angular2: + // path: ../angular2 + // + var pubspec = yaml.safeLoad(file.contents.toString()); + var overrides = pubspec.dependency_overrides; + if (overrides) { + Object.keys(overrides).forEach(function(pkg) { + var overridePath = overrides[pkg].path; + if ((new RegExp('^' + originalPrefix)).test(overridePath)) { + overrides[pkg].path = overridePath.replace(originalPrefix, '../'); + } + }); + file.contents = new Buffer(yaml.safeDump(pubspec)); + } + } + this.push(file); + done(); + })) + .pipe(gulp.dest(CONFIG.dest.dart)); return merge2(transformStream, moveStream); @@ -1145,13 +1140,11 @@ gulp.task('!bundle.js.min.deps', ['!bundle.js.min'], function() { }); var JS_DEV_DEPS = [ - licenseWrap('node_modules/zone.js/LICENSE', true), - 'node_modules/zone.js/dist/zone-microtask.js', - 'node_modules/zone.js/dist/long-stack-trace-zone.js', - licenseWrap('node_modules/reflect-metadata/LICENSE', true), - 'node_modules/reflect-metadata/Reflect.js', - // traceur-runtime is always first in the bundle - licenseWrap('node_modules/traceur/LICENSE', true) + licenseWrap('node_modules/zone.js/LICENSE', true), + 'node_modules/zone.js/dist/zone-microtask.js', + 'node_modules/zone.js/dist/long-stack-trace-zone.js', + licenseWrap('node_modules/reflect-metadata/LICENSE', true), + 'node_modules/reflect-metadata/Reflect.js' ]; // Splice in RX license if rx is in the bundle. diff --git a/karma-js.conf.js b/karma-js.conf.js index 1e97d2219e..e8d5add617 100644 --- a/karma-js.conf.js +++ b/karma-js.conf.js @@ -17,7 +17,7 @@ module.exports = function(config) { 'node_modules/zone.js/dist/long-stack-trace-zone.js', 'node_modules/zone.js/dist/jasmine-patch.js', - 'node_modules/traceur/bin/traceur-runtime.js', + 'node_modules/es6-shim/es6-shim.js', // Including systemjs because it defines `__eval`, which produces correct stack traces. 'modules/angular2/src/test_lib/shims_for_IE.js', 'node_modules/systemjs/dist/system.src.js', @@ -28,10 +28,7 @@ module.exports = function(config) { {pattern: 'modules/**/test/**/static_assets/**', included: false, watched: false} ], - exclude: [ - 'dist/js/dev/es5/**/e2e_test/**', - 'dist/angular1_router.js' - ], + exclude: ['dist/js/dev/es5/**/e2e_test/**', 'dist/angular1_router.js'], customLaunchers: sauceConf.customLaunchers, diff --git a/modules/angular1_router/build.js b/modules/angular1_router/build.js index ba8f3d3447..35877a5f3a 100644 --- a/modules/angular1_router/build.js +++ b/modules/angular1_router/build.js @@ -21,8 +21,8 @@ var files = [ var PRELUDE = '(function(){\n'; var POSTLUDE = '\n}());\n'; var FACADES = fs.readFileSync(__dirname + '/lib/facades.es5', 'utf8'); -var TRACEUR_RUNTIME = fs.readFileSync(__dirname + '/../../node_modules/traceur/bin/traceur-runtime.js', 'utf8'); var DIRECTIVES = fs.readFileSync(__dirname + '/src/ng_outlet.js', 'utf8'); +var ES6_SHIM = fs.readFileSync(__dirname + '/../../node_modules/es6-shim/es6-shim.js', 'utf8'); function main() { var dir = __dirname + '/../angular2/src/router/'; @@ -85,7 +85,7 @@ function main() { "return router;" ].join('\n')); - return PRELUDE + TRACEUR_RUNTIME + DIRECTIVES + out + POSTLUDE; + return PRELUDE + ES6_SHIM + DIRECTIVES + out + POSTLUDE; } diff --git a/modules/angular1_router/lib/facades.es5 b/modules/angular1_router/lib/facades.es5 index d65f3667e3..cdac8bfa52 100644 --- a/modules/angular1_router/lib/facades.es5 +++ b/modules/angular1_router/lib/facades.es5 @@ -128,7 +128,7 @@ var StringMapWrapper = { }, forEach: function (m, fn) { - for (prop in m) { + for (var prop in m) { if (m.hasOwnProperty(prop)) { fn(m[prop], prop); } diff --git a/modules/angular2/docs/web_workers/web_workers.md b/modules/angular2/docs/web_workers/web_workers.md index 0104d5cbac..82acf99a41 100644 --- a/modules/angular2/docs/web_workers/web_workers.md +++ b/modules/angular2/docs/web_workers/web_workers.md @@ -27,7 +27,7 @@ To bootstrap Hello World in a WebWorker we do the following in TypeScript ```HTML
- + @@ -44,7 +44,7 @@ bootstrap("loader.js"); ``` ```JavaScript // loader.js -importScripts("https://github.jspm.io/jmcriffey/bower-traceur-runtime@0.0.87/traceur-runtime.js", "https://jspm.io/system@0.16.js", "angular2/web_worker/worker.js"); +importScripts("https://cdnjs.cloudflare.com/ajax/libs/es6-shim/0.33.3/es6-shim.js", "https://jspm.io/system@0.16.js", "angular2/web_worker/worker.js"); System.import("app"); ``` ```TypeScript diff --git a/modules/angular2/manual_typings/traceur-runtime.d.ts b/modules/angular2/manual_typings/traceur-runtime.d.ts index cac659bb15..f7dbd00436 100644 --- a/modules/angular2/manual_typings/traceur-runtime.d.ts +++ b/modules/angular2/manual_typings/traceur-runtime.d.ts @@ -15,7 +15,7 @@ interface PromiseLike