demo/amd/rjs/output/unified/marionette-build.js
function _registerDataAttribute ( name, options ) {
        var existingNames = _getRegisteredDataAttributeNames(),
            fullName = "data-" + name,
            type = options && options.isJSON ? "json" : "primitives",
            names = registeredDataAttributes[type];

        if ( name.indexOf( "data-" ) === 0 ) throw new CustomizationError( 'registerDataAttribute(): Illegal attribute name "' + name + '", must be registered without "data-" prefix' );
        if ( name === "html" || name === "compiled" ) throw new CustomizationError( 'registerDataAttribute(): Cannot register attribute name "' + name + '" because it is reserved' );
        if ( _.contains( existingNames, name ) ) throw new CustomizationError( 'registerDataAttribute(): Cannot register attribute name "' + name + '" because it has already been registered' );

        // Add the name to the list of registered data attributes
        names.push( name );
        registeredDataAttributes[type] = _.uniq( names );

        // Create amd store a regex matching the attribute and its value in an HTML/template string, for transfer onto a
        // wrapper node (see _wrapRawTemplate())
        rxRegisteredDataAttributes[fullName] = new RegExp( fullName + "\\s*=\\s*(['\"])([\\s\\S]+?)\\1" );

        // Update the regular expression which tests an HTML/template string and detects a comment containing registered
        // attributes.
        rxElDefinitionComment = _createElDefinitionCommentRx();
    }
function _registerDataAttribute ( name, options ) {
        var existingNames = _getRegisteredDataAttributeNames(),
            fullName = "data-" + name,
            type = options && options.isJSON ? "json" : "primitives",
            names = registeredDataAttributes[type];

        if ( name.indexOf( "data-" ) === 0 ) throw new CustomizationError( 'registerDataAttribute(): Illegal attribute name "' + name + '", must be registered without "data-" prefix' );
        if ( name === "html" || name === "compiled" ) throw new CustomizationError( 'registerDataAttribute(): Cannot register attribute name "' + name + '" because it is reserved' );
        if ( _.contains( existingNames, name ) ) throw new CustomizationError( 'registerDataAttribute(): Cannot register attribute name "' + name + '" because it has already been registered' );

        // Add the name to the list of registered data attributes
        names.push( name );
        registeredDataAttributes[type] = _.uniq( names );

        // Create amd store a regex matching the attribute and its value in an HTML/template string, for transfer onto a
        // wrapper node (see _wrapRawTemplate())
        rxRegisteredDataAttributes[fullName] = new RegExp( fullName + "\\s*=\\s*(['\"])([\\s\\S]+?)\\1" );

        // Update the regular expression which tests an HTML/template string and detects a comment containing registered
        // attributes.
        rxElDefinitionComment = _createElDefinitionCommentRx();
    }
Adds a name to the list of data attributes which are used and managed by Backbone.Declarative.Views. The name
must be passed without the "data-" prefix, but written as in the data attribute (ie "tag-name", not "tagName").

When a data attribute is used to store stringified JSON objects, the flag `{ isJSON: true }` must be set in the
options. Primitive data attributes (of type string, number, boolean) don't need a flag.

The names "html" and "compiled" are illegal because they are reserved. They are already in use in the cache
object, so there could be a conflict further down the line. Also, a name can only be registered once. And, as
said before, it must not be prefixed with "data-". Violations of these rules cause an error to be thrown.

Registering a data attribute has the following effects:

- When a registered data attribute is queried by Backbone.Declarative.Views, the attribute is refreshed from the
DOM and updated in the jQuery data cache. Changes to the attribute in the DOM are picked up that way. The
update can also be triggered externally, e.g. by a plugin, with `updateJqueryDataCache()`.

- A registered data attribute is detected in a raw HTML/template string, provided that it is placed into a
comment. It must be written as it would appear on a script or template tag, ie in dashed form and including the
"data-" prefix, just like the standard `el`-defining attributes. Custom attributes and `el`-defining attributes
must be placed into the same, single comment.

The registered attribute is then created on the temporary script tag which is wrapped around the template
string, along with the `el`-defining data attributes. But unlike these, the custom attribute does not make it
into the cache (nor does the script tag).

However, the script tag can be accessed and examined by a custom loader. For that to happen, the custom loader
has to invoke the default loader before processing the result further. Custom attributes can be read this way.

@param {string}  name                    as in the data attribute (e.g. "tag-name", not "tagName"), and without "data-" prefix
@param {object}  [options]
@param {boolean} [options.isJSON=false]