Allow matchTagNames = null in ve.dm.Converter

This won't usefully register the node with the converter right now, but
we need to allow this because the ModelFactory tests will need to have
stub nodes with tag-only matches.

Change-Id: I023cc8ff647363ab55c73dff39b17ca47e9e6681
This commit is contained in:
Catrope 2013-01-22 17:26:15 -08:00
parent 47b728bed9
commit 99df776543

View file

@ -77,13 +77,11 @@ ve.dm.Converter.getDataContentFromText = function ( text, annotations ) {
* @throws {Error} Missing conversion data in node implementation
*/
ve.dm.Converter.prototype.onNodeRegister = function ( dataElementType, constructor ) {
if ( !constructor.static.matchTagNames || !constructor.static.toDomElement ||
!constructor.static.toDataElement
) {
if ( !constructor.static.toDomElement || !constructor.static.toDataElement ) {
throw new Error( 'Missing static properties in node implementation of ' + dataElementType );
} else {
var i,
domElementTypes = constructor.static.matchTagNames,
domElementTypes = constructor.static.matchTagNames || [],
toDomElement = constructor.static.toDomElement,
toDataElement = constructor.static.toDataElement;
// Registration