Fred Tingaud 16f6c0aecf
Inline adoc when include has no additional value (#1940)
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.
2023-05-25 14:18:12 +02:00

55 lines
966 B
Plaintext

== Why is this an issue?
Using the ``++this++`` keyword inside the scope of an object to refer to the object's properties and methods yields cleaner, clearer code, and helps avoid confusion when there are variables or functions outside the object scope with the same or similar names.
=== Noncompliant code example
[source,javascript]
----
function Person(name, birthdate) {
this.name = name;
this.birthdate = birthdate;
get name() {
return name; // Noncompliant
}
}
----
=== Compliant solution
[source,javascript]
----
function Person(name, birthdate) {
this.name = name;
this.birthdate = birthdate;
get name() {
return this.name;
}
}
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Add "this" to this reference.
'''
== Comments And Links
(visible only on this page)
=== on 12 Nov 2015, 18:27:14 Linda Martin wrote:
OK!
endif::env-github,rspecator-view[]