Skip to content

Instantly share code, notes, and snippets.

@nfcampos
Created April 18, 2016 12:27
Show Gist options
  • Save nfcampos/216edf34ae47dfff809df41c58b58c8f to your computer and use it in GitHub Desktop.
Save nfcampos/216edf34ae47dfff809df41c58b58c8f to your computer and use it in GitHub Desktop.
_len is not defined
{
"presets": [
"es2015"
],
"plugins": [
"react-hot-loader/babel"
]
}
export function spread(...args) {
return args.push(1)
}
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.spread = spread;
function spread() {
for (var _len = arguments.length, args = Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return args.push(1);
}
(function () {
function tagSource(fn, localName) {
if (typeof fn !== "function") {
return;
}
if (fn.hasOwnProperty("__source")) {
return;
}
try {
Object.defineProperty(fn, "__source", {
enumerable: false,
configurable: true,
value: {
fileName: "abc.js",
localName: localName
}
});
} catch (err) {}
}
tagSource(spread, "spread");
tagSource(_len, "_len");
tagSource(args, "args");
tagSource(_key, "_key");
})();
@catamphetamine
Copy link

I'm having the same issue with this plugin:

ReferenceError: console_error is not defined


    exports.default = _default;

    (function () {
        function tagSource(fn, localName) {
            if (typeof fn !== "function") {
                return;
            }

            if (fn.hasOwnProperty("__source")) {
                return;
            }

            try {
                Object.defineProperty(fn, "__source", {
                    enumerable: false,
                    configurable: true,
                    value: {
                        fileName: '/Users/hotgayporn/work/webapp/code/client/routes.js',
                        localName: localName
                    }
                });
            } catch (err) {}
        }

        tagSource(console_error, 'console_error');
        tagSource(authorize, 'authorize');
        tagSource(Layout_queries, 'Layout_queries');
        tagSource(Home_queries, 'Home_queries');
        tagSource(_default, 'default');
    })();

    module.e = exports['default'];

@0x80
Copy link

0x80 commented Apr 18, 2016

I'm having the same issue at tagSource(_len, '_len');, where _len is only defined in a for loop.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment