diff --git a/fixtures/transpile-moved-args/expectation.js b/fixtures/transpile-moved-args/expectation.js new file mode 100644 index 0000000..8c713d1 --- /dev/null +++ b/fixtures/transpile-moved-args/expectation.js @@ -0,0 +1,6 @@ +function wrappedWarn() { + var _console, _console2; + + (_console = console).warn.apply(_console, arguments); + (true && (_console2 = console).warn.apply(_console2, arguments)); +} diff --git a/fixtures/transpile-moved-args/sample.js b/fixtures/transpile-moved-args/sample.js new file mode 100644 index 0000000..8243ef8 --- /dev/null +++ b/fixtures/transpile-moved-args/sample.js @@ -0,0 +1,6 @@ +import { warn } from '@ember/debug-tools'; + +function wrappedWarn() { + console.warn(...arguments); + warn(...arguments); +} diff --git a/package.json b/package.json index 9a7329c..3a02af2 100644 --- a/package.json +++ b/package.json @@ -2,6 +2,7 @@ "devDependencies": { "babel-cli": "^6.22.2", "babel-core": "^6.22.1", + "babel-plugin-transform-es2015-spread": "^6.22.0", "babel-preset-env": "^1.2.2", "babel-preset-latest": "^6.24.0", "babel-register": "^6.22.0", diff --git a/src/tests/debug-tools-test.js b/src/tests/debug-tools-test.js index 8fce164..d2bbcf6 100644 --- a/src/tests/debug-tools-test.js +++ b/src/tests/debug-tools-test.js @@ -1,5 +1,6 @@ import DebugToolsPlugin from '../index'; import { transform } from 'babel-core'; +import Es2015Spread from 'babel-plugin-transform-es2015-spread'; import { expect } from 'chai'; import { file } from 'chai-files'; import { lstatSync, writeFileSync } from 'fs'; @@ -77,6 +78,30 @@ let cases = { ] }, + 'transpile moved args': { + transformOptions: { + presets, + plugins: [ + Es2015Spread, + [DebugToolsPlugin, { + debugTools: { + source: '@ember/debug-tools', + assertPredicateIndex: 0 + }, + envFlags: { + source: '@ember/env-flags', + flags: { + DEBUG: true + } + } + }], + ] + }, + fixtures: [ + 'transpile-moved-args', + ], + }, + 'foreign debug imports': { transformOptions: { presets,