@@ -23,9 +23,9 @@ if (!scope) {
2323}
2424var flags = scope . flags ;
2525
26- // native document.register ?
26+ // native document.registerElement ?
2727
28- var hasNative = Boolean ( document . register ) ;
28+ var hasNative = Boolean ( document . registerElement ) ;
2929var useNative = ! flags . register && hasNative ;
3030
3131if ( useNative ) {
@@ -73,7 +73,7 @@ if (useNative) {
7373 * element.
7474 *
7575 * @example
76- * FancyButton = document.register ("fancy-button", {
76+ * FancyButton = document.registerElement ("fancy-button", {
7777 * extends: 'button',
7878 * prototype: Object.create(HTMLButtonElement.prototype, {
7979 * readyCallback: {
@@ -86,19 +86,19 @@ if (useNative) {
8686 * @return {Function } Constructor for the newly registered type.
8787 */
8888 function register ( name , options ) {
89- //console.warn('document.register ("' + name + '", ', options, ')');
89+ //console.warn('document.registerElement ("' + name + '", ', options, ')');
9090 // construct a defintion out of options
9191 // TODO(sjmiles): probably should clone options instead of mutating it
9292 var definition = options || { } ;
9393 if ( ! name ) {
9494 // TODO(sjmiles): replace with more appropriate error (EricB can probably
9595 // offer guidance)
96- throw new Error ( 'document.register : first argument `name` must not be empty' ) ;
96+ throw new Error ( 'document.registerElement : first argument `name` must not be empty' ) ;
9797 }
9898 if ( name . indexOf ( '-' ) < 0 ) {
9999 // TODO(sjmiles): replace with more appropriate error (EricB can probably
100100 // offer guidance)
101- throw new Error ( 'document.register : first argument (\'name\') must contain a dash (\'-\'). Argument provided was \'' + String ( name ) + '\'.' ) ;
101+ throw new Error ( 'document.registerElement : first argument (\'name\') must contain a dash (\'-\'). Argument provided was \'' + String ( name ) + '\'.' ) ;
102102 }
103103 // elements may only be registered once
104104 if ( getRegisteredDefinition ( name ) ) {
@@ -359,7 +359,7 @@ if (useNative) {
359359
360360 // exports
361361
362- document . register = register ;
362+ document . registerElement = register ;
363363 document . createElement = createElement ; // override
364364 Node . prototype . cloneNode = cloneNode ; // override
365365
@@ -379,6 +379,9 @@ if (useNative) {
379379 scope . upgrade = upgradeElement ;
380380}
381381
382+ // bc
383+ document . register = document . registerElement ;
384+
382385scope . hasNative = hasNative ;
383386scope . useNative = useNative ;
384387
0 commit comments