Pairs the validated lexical form with the validated BCP 47 tag identifying its natural language. The returned record
is frozen.
Both components are checked here rather than at serialisation: Tag is a documentation alias for string, so
nothing in the type stops a caller from supplying a tag carrying grammar delimiters, and no RDF syntax defines an
escape for a language tag, leaving a serialiser to render it verbatim into forged statements.
A frozen Tagged record carrying the lexical form and the language tag
Throws
RangeError if text is not a well-formed Unicode string, that is if it holds an isolated UTF-16 surrogate
code point, or if language is not a well-formed BCP 47 language tag
Creates an RDF language-tagged string.
Pairs the validated lexical form with the validated BCP 47 tag identifying its natural language. The returned record is frozen.
Both components are checked here rather than at serialisation: Tag is a documentation alias for
string, so nothing in the type stops a caller from supplying a tag carrying grammar delimiters, and no RDF syntax defines an escape for a language tag, leaving a serialiser to render it verbatim into forged statements.