diff options
author | Filipa Lacerda <filipa@gitlab.com> | 2017-01-02 15:53:24 +0000 |
---|---|---|
committer | Filipa Lacerda <filipa@gitlab.com> | 2017-01-02 15:53:24 +0000 |
commit | afb857d1e72d31b9e93cb7b2443fcf40851f85e0 (patch) | |
tree | b55f47698ee39af98d6ef3e0a2b07f69b2839257 | |
parent | 313aa339b9b2cda26c9160f70444f107e2aafef4 (diff) | |
download | gitlab-ce-remove-custom-event-polyfill.tar.gz |
Removes CustomEvent polyfill and testsremove-custom-event-polyfill
-rw-r--r-- | app/assets/javascripts/lib/utils/custom_event_polyfill.js.es6 | 12 | ||||
-rw-r--r-- | spec/javascripts/lib/utils/custom_event_polyfill_spec.js.es6 | 43 |
2 files changed, 0 insertions, 55 deletions
diff --git a/app/assets/javascripts/lib/utils/custom_event_polyfill.js.es6 b/app/assets/javascripts/lib/utils/custom_event_polyfill.js.es6 deleted file mode 100644 index 5ae978010c9..00000000000 --- a/app/assets/javascripts/lib/utils/custom_event_polyfill.js.es6 +++ /dev/null @@ -1,12 +0,0 @@ -/** - * CustomEvent support for IE - */ -if (typeof window.CustomEvent !== 'function') { - window.CustomEvent = function CustomEvent(e, params) { - const options = params || { bubbles: false, cancelable: false, detail: undefined }; - const evt = document.createEvent('CustomEvent'); - evt.initCustomEvent(e, options.bubbles, options.cancelable, options.detail); - return evt; - }; - window.CustomEvent.prototype = window.Event.prototype; -} diff --git a/spec/javascripts/lib/utils/custom_event_polyfill_spec.js.es6 b/spec/javascripts/lib/utils/custom_event_polyfill_spec.js.es6 deleted file mode 100644 index 3645dd70c55..00000000000 --- a/spec/javascripts/lib/utils/custom_event_polyfill_spec.js.es6 +++ /dev/null @@ -1,43 +0,0 @@ -//= require lib/utils/custom_event_polyfill - -describe('Custom Event Polyfill', () => { - it('should be defined', () => { - expect(window.CustomEvent).toBeDefined(); - }); - - it('should create a `CustomEvent` instance', () => { - const e = new window.CustomEvent('foo'); - - expect(e.type).toEqual('foo'); - expect(e.bubbles).toBe(false); - expect(e.cancelable).toBe(false); - expect(e.detail).toBeFalsy(); - }); - - it('should create a `CustomEvent` instance with a `details` object', () => { - const e = new window.CustomEvent('bar', { detail: { foo: 'bar' } }); - - expect(e.type).toEqual('bar'); - expect(e.bubbles).toBe(false); - expect(e.cancelable).toBe(false); - expect(e.detail.foo).toEqual('bar'); - }); - - it('should create a `CustomEvent` instance with a `bubbles` boolean', () => { - const e = new window.CustomEvent('bar', { bubbles: true }); - - expect(e.type).toEqual('bar'); - expect(e.bubbles).toBe(true); - expect(e.cancelable).toBe(false); - expect(e.detail).toBeFalsy(); - }); - - it('should create a `CustomEvent` instance with a `cancelable` boolean', () => { - const e = new window.CustomEvent('bar', { cancelable: true }); - - expect(e.type).toEqual('bar'); - expect(e.bubbles).toBe(false); - expect(e.cancelable).toBe(true); - expect(e.detail).toBeFalsy(); - }); -}); |