-
-
Notifications
You must be signed in to change notification settings - Fork 21
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
Base.prototype.isRegistered defaults to register = true #30
Comments
Thanks for catching that. Want to do a pr to fix? Or I can do it as soon as I have a chance. |
What part do you want fixed? The code or the annotation? |
Bump. |
Sorry, I missed the notif for your reply. Thanks for the bump.
IMHO just the docs should be corrected, but I'm open to code fixes too if you were thinking the behavior isn't what is expected. Thoughts? |
I'd opt for a code change that matches the annotated examples. Unfortunately there is really no good way to deprecate the old signature. I'd argue though that the annotation is the contract and the current implementation should be considered a bug. |
Perhaps we're thinking of different uses for the method, but how would that imply a getter, given that it can't ever return a useful value without receiving at least one argument? The Edit: I still think fixing the docs is the best approach. We use base extensively and every plugin, generator and place where a check is done to see if a plugin is registered would need to be updated if we inverted Regarding the docs being a contract, that's a bit like saying a book should be updated to match its cover, isn't it? |
Aplogies, I meant "getter" in the sense that the function returns information about a state. In my opinion
I think 3. is the most important part and a strong argument for changing the behavior instead of the docs. If on the other hand you guys are the primary consumers by a large margin and 2. applies to you, then I guess there's nothing to argue about. In that case one has to be pragmatic and update the docs instead. |
The |
Version: 0.11.2 (the one used by the latest assemble release)
Something I noticed while creating typings for base:
In
Base.prototype.isRegistered(name, register)
, the paramregister
is implicitely documented as defaulting to false. What actually seems to happen though is that the plugin will get registered unlessfalse
is passed explicitely. (Source)The text was updated successfully, but these errors were encountered: