From b4ff802e28a0c82194190a6cc614a5abfa5d8ead Mon Sep 17 00:00:00 2001 From: Vojta Jina Date: Thu, 6 Nov 2014 15:31:17 -0800 Subject: [PATCH] feat(deps): update Traceur 0.0.74 --- karma-js.conf.js | 1 + modules/rtts_assert/src/rtts_assert.es6 | 4 ++++ modules/rtts_assert/test/rtts_assert_spec.es6 | 4 ++-- package.json | 2 +- traceur-runtime-patch.js | 6 ++++++ 5 files changed, 14 insertions(+), 3 deletions(-) create mode 100644 traceur-runtime-patch.js diff --git a/karma-js.conf.js b/karma-js.conf.js index 24b9bebb07..22fbe33376 100644 --- a/karma-js.conf.js +++ b/karma-js.conf.js @@ -14,6 +14,7 @@ module.exports = function(config) { {pattern: 'tools/transpiler/**', included: false}, 'node_modules/traceur/bin/traceur-runtime.js', + 'traceur-runtime-patch.js', 'node_modules/es6-module-loader/dist/es6-module-loader-sans-promises.src.js', // Including systemjs because it defines `__eval`, which produces correct stack traces. 'node_modules/systemjs/dist/system.src.js', diff --git a/modules/rtts_assert/src/rtts_assert.es6 b/modules/rtts_assert/src/rtts_assert.es6 index c035a498ba..5ba6712fb1 100644 --- a/modules/rtts_assert/src/rtts_assert.es6 +++ b/modules/rtts_assert/src/rtts_assert.es6 @@ -62,6 +62,10 @@ function prettyPrint(value) { } if (typeof value === 'object') { + if (value.__assertName) { + return value.__assertName; + } + if (value.map) { return '[' + value.map(prettyPrint).join(', ') + ']'; } diff --git a/modules/rtts_assert/test/rtts_assert_spec.es6 b/modules/rtts_assert/test/rtts_assert_spec.es6 index 8e93538961..061ccac3b3 100644 --- a/modules/rtts_assert/test/rtts_assert_spec.es6 +++ b/modules/rtts_assert/test/rtts_assert_spec.es6 @@ -361,13 +361,13 @@ describe('Traceur', function() { it('should fail when a value returned', function() { expect(() => foo('bar')) - .toThrowError('Expected to return an instance of voidType, got "bar"!'); + .toThrowError('Expected to return an instance of void, got "bar"!'); }); it('should fail when null returned', function() { expect(() => foo(null)) - .toThrowError('Expected to return an instance of voidType, got null!'); + .toThrowError('Expected to return an instance of void, got null!'); }); }); }); diff --git a/package.json b/package.json index 9be1eadfea..a828644f24 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,6 @@ "run-sequence": "^0.3.6", "glob": "^4.0.6", "gulp-ejs": "^0.3.1", - "traceur": "0.0.66" + "traceur": "0.0.74" } } diff --git a/traceur-runtime-patch.js b/traceur-runtime-patch.js new file mode 100644 index 0000000000..2b3d2fc228 --- /dev/null +++ b/traceur-runtime-patch.js @@ -0,0 +1,6 @@ +(function(type) { + Object.keys(type).forEach(function(name) { + type[name].__assertName = name; + }); +})(window.$traceurRuntime.type); +