diff --git a/bower.json b/bower.json index 8238110..56ea4db 100644 --- a/bower.json +++ b/bower.json @@ -16,7 +16,8 @@ "license": "BSD", "ignore": [], "devDependencies": { - "web-component-tester": "^4.0.1", - "webcomponentsjs": "webcomponents/webcomponentsjs#^0.7.22" + "web-component-tester": "6.0.0-prerelease.3", + "webcomponentsjs": "webcomponents/webcomponentsjs#v1", + "es6-promise": "stefanpenner/es6-promise#^4.0.0" } } diff --git a/package.json b/package.json index c2d6567..36de4b4 100644 --- a/package.json +++ b/package.json @@ -16,14 +16,16 @@ "url": "https://github.com/webcomponents/custom-elements/issues" }, "scripts": { + "install": "$(npm bin)/bower install", "build": "gulp", "test": "wct" }, "homepage": "http://webcomponents.org", "devDependencies": { + "bower": "^1.8.0", "google-closure-compiler": "^20160822.1.0", "gulp": "^3.8.8", "gulp-sourcemaps": "^1.6.0", - "web-component-tester": "^4.0.1" + "web-component-tester": "6.0.0-prerelease.3" } } diff --git a/src/native-shim.js b/src/native-shim.js index d55bfec..735f3d7 100644 --- a/src/native-shim.js +++ b/src/native-shim.js @@ -61,6 +61,9 @@ (() => { 'use strict'; + // Do nothing if `customElements` does not exist. + if (!window.customElements) return; + const NativeHTMLElement = window.HTMLElement; const nativeDefine = window.customElements.define; const nativeGet = window.customElements.get; diff --git a/tests/html/imports.html b/tests/html/imports.html index 8dbe461..ebf207d 100644 --- a/tests/html/imports.html +++ b/tests/html/imports.html @@ -12,7 +12,7 @@ Custom Elements: imports integration + - + @@ -17,6 +18,12 @@ suite('Native Shim', () => { + // Do nothing if the browser does not natively support custom elements. + if (!window.customElements) { + test.skip('The native shim does not apply to this browser.', () => {}); + return; + } + test('works with createElement()', () => { function ES5Element1() { return HTMLElement.apply(this); diff --git a/tests/index.html b/tests/index.html index 269062d..34d9eac 100644 --- a/tests/index.html +++ b/tests/index.html @@ -11,8 +11,9 @@ Custom Elements Tests + @@ -26,7 +27,6 @@ 'js/closure.js', 'js/upgrade.js', 'js/shadow-dom.js', - 'js/patching.js', 'html/imports.html', 'html/shim.html', // 'chromium/custom-elements/spec/callback.html', diff --git a/tests/js/patching.js b/tests/js/patching.js deleted file mode 100644 index 2694751..0000000 --- a/tests/js/patching.js +++ /dev/null @@ -1,23 +0,0 @@ -/** - * @license - * Copyright (c) 2016 The Polymer Project Authors. All rights reserved. - * This code may only be used under the BSD style license found at http://polymer.github.io/LICENSE.txt - * The complete set of authors may be found at http://polymer.github.io/AUTHORS.txt - * The complete set of contributors may be found at http://polymer.github.io/CONTRIBUTORS.txt - * Code distributed by Google as part of the polymer project is also - * subject to an additional IP rights grant found at http://polymer.github.io/PATENTS.txt - */ - -suite('patching', function() { - - suite('HTMLElement', function () { - - test('constructor is configurable and writable', function() { - var descriptor = Object.getOwnPropertyDescriptor(HTMLElement.prototype, 'constructor'); - assert.isTrue(descriptor.configurable); - assert.isTrue(descriptor.writable); - }); - - }); - -});