MCPcopy
hub / github.com/jsdom/jsdom / createCDATASection

Method createCDATASection

lib/jsdom/living/nodes/Document-impl.js:748–767  ·  view source on GitHub ↗
(data)

Source from the content-addressed store, hash-verified

746
747 // https://dom.spec.whatwg.org/#dom-document-createcdatasection
748 createCDATASection(data) {
749 if (this._parsingMode === "html") {
750 throw DOMException.create(this._globalObject, [
751 "Cannot create CDATA sections in HTML documents",
752 "NotSupportedError"
753 ]);
754 }
755
756 if (data.includes("]]>")) {
757 throw DOMException.create(this._globalObject, [
758 "CDATA section data cannot contain the string \"]]>\"",
759 "InvalidCharacterError"
760 ]);
761 }
762
763 return CDATASection.createImpl(this._globalObject, [], {
764 ownerDocument: this,
765 data
766 });
767 }
768
769 createTextNode(data) {
770 return Text.createImpl(this._globalObject, [], {

Callers 3

node.jsFile · 0.80
hc_staff.xml.jsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected