
Inline adoc files when they are included exactly once. Also fix language tags because this inlining gives us better information on what language the code is written in.
49 lines
1014 B
Plaintext
49 lines
1014 B
Plaintext
== Why is this an issue?
|
|
|
|
The meaning of a boolean parameter may seem perfectly clear when you first write a method call, but that meaning is likely to fade for you over time, and could be completely opaque to those who come behind you.
|
|
|
|
|
|
Instead, object literals should be used.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,javascript]
|
|
----
|
|
widget.repaint(false); // Noncompliant; does this mean never repaint?
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,javascript]
|
|
----
|
|
widget.repaint({immediate: false});
|
|
----
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Use an object literal instead.
|
|
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== relates to: S2495
|
|
|
|
=== on 29 Jan 2015, 18:48:41 Ann Campbell wrote:
|
|
Appropriate for any of your other langauges, [~linda.martin]?
|
|
|
|
=== on 13 Nov 2015, 14:48:41 Linda Martin wrote:
|
|
\[~ann.campbell.2] Sorry for the delay, I would say yes as it is a general pattern.
|
|
|
|
endif::env-github,rspecator-view[]
|