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

63 lines
1.4 KiB
Plaintext

== Why is this an issue?
The following words may be used as keywords in future evolutions of the language, so using them as identifiers should be avoided to allow an easier adoption of those potential future versions:
* ``++await++``
* ``++class++``
* ``++const++``
* ``++enum++``
* ``++export++``
* ``++extends++``
* ``++implements++``
* ``++import++``
* ``++interface++``
* ``++let++``
* ``++package++``
* ``++private++``
* ``++protected++``
* ``++public++``
* ``++static++``
* ``++super++``
* ``++yield++``
Use of these words as identifiers would produce an error in JavaScript ``++strict++`` mode code.
This list includes also the keywords that have been adopted by the latest versions of ECMAScript. They are kept to support legacy JavaScript codebases.
=== Noncompliant code example
[source,javascript]
----
var package = document.getElementsByName("foo"); // Noncompliant
var someData = { package: true }; // Compliant, as it is not used as an identifier here
----
=== Compliant solution
[source,javascript]
----
var elements = document.getElementsByName("foo"); // Compliant
----
ifdef::env-github,rspecator-view[]
'''
== Implementation Specification
(visible only on this page)
=== Message
Rename "{0}" identifier to prevent potential conflicts with future evolutions of the JavaScript language.
'''
== Comments And Links
(visible only on this page)
include::../comments-and-links.adoc[]
endif::env-github,rspecator-view[]