
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.
51 lines
953 B
Plaintext
51 lines
953 B
Plaintext
== Why is this an issue?
|
|
|
|
``++Symbol++`` is a primitive type introduced in ECMAScript2015. Its instances are mainly used as unique property keys.
|
|
|
|
An instance can only be created by using ``++Symbol++`` as a function. Using ``++Symbol++`` with the ``++new++`` operator will raise a ``++TypeError++``.
|
|
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,javascript]
|
|
----
|
|
const sym = new Symbol("foo"); // Noncompliant
|
|
----
|
|
|
|
|
|
=== Compliant solution
|
|
|
|
[source,javascript]
|
|
----
|
|
const sym = Symbol("foo");
|
|
----
|
|
|
|
|
|
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
=== Message
|
|
|
|
Remove this "new" operator.
|
|
|
|
|
|
=== Highlighting
|
|
|
|
Primary: "new"
|
|
|
|
Secondary: "Symbol"
|
|
|
|
|
|
'''
|
|
== Comments And Links
|
|
(visible only on this page)
|
|
|
|
=== on 19 Jan 2017, 13:00:25 Elena Vilchik wrote:
|
|
\[~jeanchristophe.collet] Could you add to the description couple of words on what is ``++Symbol++`` is? thanks!
|
|
|
|
endif::env-github,rspecator-view[]
|