MCPcopy
hub / github.com/ampproject/amphtml / assertValidName

Function assertValidName

src/polyfills/custom-elements.js:54–58  ·  view source on GitHub ↗

* Asserts that the custom element name conforms to the spec. * * @param {!typeof SyntaxError} SyntaxError * @param {string} name

(SyntaxError, name)

Source from the content-addressed store, hash-verified

52 * @param {string} name
53 */
54function assertValidName(SyntaxError, name) {
55 if (!VALID_NAME.test(name) || INVALID_NAMES.includes(name)) {
56 throw new SyntaxError(`invalid custom element name "${name}"`);
57 }
58}
59
60/**
61 * Does win have a full Custom Elements registry?

Callers 2

whenDefinedMethod · 0.85
defineMethod · 0.85

Calls 1

testMethod · 0.45

Tested by

no test coverage detected