Open jamesplease opened 9 years ago
Oh, you know what, I just tried typing a variable that isn't explicitly defined in the code ("moment") and it ended up returning nothing without any problems. That's a combination of awesome, because it does what I want it to do, but maybe not so awesome, 'cause that might be unexpected behavior.
Maybe the updated behavior should be:
false
.+1, I've been meaning to do this. I think the rule should be that if something is exported, you have to supply a name, otherwise the name will be ignored.
Sounds good to me. Should I try to whip up a PR?
That'd be great! Thanks. Shout if anything in the code doesn't make sense
Shout if anything in the code doesn't make sense
Tabs? Tabs?
jkjkjk
:stuck_out_tongue:
I know, right? It isn't really the default choice these days. That said, if your editor has an EditorConfig plugin then you don't really have to even think about it.
That said, if your editor has an EditorConfig plugin then you don't really have to even think about it.
Good point!
I was just messin' around, though :wink:
looool
on another note...
template strings :open_mouth: :open_hands:
My favorite old hack – setting the name property to be a nonexistent variable – seems to no longer work to get around this. Shucks :stuck_out_tongue:
Not all libraries export variables. For instance, if I'm writing a plugin for
momentjs
, I will likely just modify the moment library and not return anything.Would you be willing to support a feature where the module doesn't export anything? For the UMD case, it might cause bugs if you just let the name go undefined, so maybe requiring an explicit
false
to be set would help prevent those problems while also adding in this functionality.