We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
this
Code
// export.ts export function foo() { 'use strict' console.log(this); } foo();
// import.ts import { foo } from './export'; foo();
expected
$ node import.js undefined undefined
actual
$ node import.js undefined { foo: [Function: foo] }
The text was updated successfully, but these errors were encountered:
The emitter will need to identify call/new expressions from aliases, and rewrite them using as foo.call(void 0, arg)
foo.call(void 0, arg)
A PR would be appreciated.
Sorry, something went wrong.
Thanks for your acceptance.
Babel's implementations:
(0, _assert2['default'])(true); // (A) Note that the default export is always accessed via the exports object_assert2 (line A), never directly, like this: var assert = _assert2.default; The reason for that is support for cyclic dependencies.
(0, _assert2['default'])(true); // (A)
Note that the default export is always accessed via the exports object_assert2 (line A), never directly, like this:
var assert = _assert2.default;
The reason for that is support for cyclic dependencies.
http://www.2ality.com/2015/12/babel-commonjs.html
As the current emit does this:
Object.defineProperty(exports, "__esModule", { value: true }); var export_1 = require("./export"); (0, export_1.foo)();
I think that the issue can be closed, cc @jakebailey
No branches or pull requests
Code
expected
actual
The text was updated successfully, but these errors were encountered: