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

Pierced module bundler does not avoid shadowing names #66

bakkot opened this Issue Apr 4, 2019 · 0 comments


None yet
1 participant
Copy link

bakkot commented Apr 4, 2019

Suppose we have


export function thing() {
  return 42;


import { thing as other } from './a.js';

window.x = function () {
  return function thing() {

Running bandolier with default options and passing b.js as the entrypoint produces

(function(e) {
  'use strict';
  window.x = function() {
    return function thing() {
  var t = { __proto__: null };
  if (e.Symbol) e.Object.defineProperty(t, e.Symbol.toStringTag, { value: 'Module' });
  t = e.Object.freeze(t);
  return t;

That's wrong: thing should not call itself, it should call the function which returns 42.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.