-
Notifications
You must be signed in to change notification settings - Fork 13
Conversation
@caridy ? |
What's the motivation for this? IIRC @thetalecrafter suggested the opposite at some point. |
Throwing without
|
Hah, I'm the total opposite, so yeah, it's a matter of preference. I love the |
Preferences aside, it's probably a lot safer to start with throwing if called without new. If we decide there is a great use for calling as a function later, it's more likely to be web compatible than trying the other way. |
It also allows a polyfill to define it with a class. |
Being consistent with classes was a big piece of motivation for throwing for other new objects in ES, so it makes sense to apply that here. |
@zbraniecki don't commit the generated HTML, that makes the review more difficult, and more conflict-prompt anyways. we can generate the HTML from time to time. |
@caridy For repositories I maintain, I regenerate the HTML on each commit. This makes it easier for me and others to see the most recently rendered version. I check in the HTML into the gh-pages branch of the same repository, so it doesn't mess up the history of any other branch and so it's automatically on GitHub pages. I believe @bterlson has a nice setup where Travis-CI does this build for him. I haven't taken the time to set that up for my repos yet; maybe it would be a nice thing to document in @ljharb's repository template eventually. |
I believe we should be throwing if constructor called without new.