Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

warn() arguments are not being transpiled #47

Open
Turbo87 opened this issue Oct 5, 2017 · 1 comment
Open

warn() arguments are not being transpiled #47

Turbo87 opened this issue Oct 5, 2017 · 1 comment
Labels

Comments

@Turbo87
Copy link
Member

Turbo87 commented Oct 5, 2017

warn(...arguments);

is apparently being transpiled to

 (false && _ember.default.warn(...arguments));

but ...arguments is ES6 code, which ember-cli-uglify@1 is not able to handle.

see mainmatter/ember-simple-auth#1443

/cc @rwjblue

@simonihmig
Copy link

Just ran into the same issue, reported here: emberjs/ember-cli-babel#184

Interestingly other ES transpilation seems to work, at least string templates:

This file is transpiled to:

define('ember-warn-transpilation/utils/foo', ['exports'], function (exports) {
  'use strict';

  Object.defineProperty(exports, "__esModule", {
    value: true
  });
  exports.default = foo;
  function foo() {
    var name = 'foo';
    var args = ['foo'];
    (true && Ember.warn('you should not use ' + name));
    (true && Ember.warn(...args));

    return 'foo';
  }
});

So string templates work, spread operator not! 🤔

Turbo87 added a commit to Turbo87/ember-simple-auth that referenced this issue Dec 24, 2017
`warn(...arguments)` unfortunately can't be used like this at the moment since `...arguments` won't be transpiled properly.

see ember-cli/babel-plugin-debug-macros#47
Turbo87 added a commit to Turbo87/ember-simple-auth that referenced this issue Dec 24, 2017
`warn(...arguments)` unfortunately can't be used like this at the moment since `...arguments` won't be transpiled properly.

see ember-cli/babel-plugin-debug-macros#47
Turbo87 added a commit to Turbo87/ember-simple-auth that referenced this issue Dec 24, 2017
`warn(...arguments)` unfortunately can't be used like this at the moment since `...arguments` won't be transpiled properly.

see ember-cli/babel-plugin-debug-macros#47
@Turbo87 Turbo87 added the bug label Nov 23, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants