From 100e45f25a8a8a5b20fb964527009183f8e3ab38 Mon Sep 17 00:00:00 2001 From: "Scott J. Miles" Date: Thu, 1 Aug 2013 19:41:20 -0700 Subject: [PATCH] any value that defines 'register' in flags turns on polyfill --- src/CustomElements.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/CustomElements.js b/src/CustomElements.js index c8fdda8..61436b6 100644 --- a/src/CustomElements.js +++ b/src/CustomElements.js @@ -22,7 +22,7 @@ if (!scope) { // native document.register? -scope.hasNative = (document.webkitRegister || document.register) && scope.flags.register !== 'polyfill'; +scope.hasNative = !scope.flags.register && (document.webkitRegister || document.register); if (scope.hasNative) { // normalize @@ -88,7 +88,7 @@ if (scope.hasNative) { // TODO(sjmiles): probably should clone inOptions instead of mutating it var definition = inOptions || {}; if (!inName) { - // TODO(sjmiles): replace with more appropriate error (Erik can probably + // TODO(sjmiles): replace with more appropriate error (EricB can probably // offer guidance) throw new Error('Name argument must not be empty'); } @@ -97,7 +97,7 @@ if (scope.hasNative) { // must have a prototype, default to an extension of HTMLElement // TODO(sjmiles): probably should throw if no prototype, check spec if (!definition.prototype) { - // TODO(sjmiles): replace with more appropriate error (Erik can probably + // TODO(sjmiles): replace with more appropriate error (EricB can probably // offer guidance) throw new Error('Options missing required prototype property'); }