Sha256: 600e7ed97b81521ddd4cecb12f65e6174b9bd3fb22eec04d8c3205676685bfb2

Contents?: true

Size: 561 Bytes

Versions: 34

Compression:

Stored size: 561 Bytes

Contents

'use strict';
var core = require('./core');

function unwrapEvent(event) {
	if (event && event.detail && event.detail.promise) {
		return event.detail;
	}

	return event;
}

module.exports = function (w) {
	w = w || window;
	var c = core();

	w.addEventListener('unhandledrejection', function (event) {
		event = unwrapEvent(event);
		c.onUnhandledRejection(event.reason, event.promise);
	});

	w.addEventListener('rejectionhandled', function (event) {
		event = unwrapEvent(event);
		c.onRejectionHandled(event.promise);
	});

	return c.currentlyUnhandled;
};

Version data entries

34 entries across 33 versions & 14 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/currently-unhandled/browser.js
disco_app-0.18.0 test/dummy/node_modules/currently-unhandled/browser.js
disco_app-0.18.2 test/dummy/node_modules/currently-unhandled/browser.js
tang-0.2.1 spec/tang_app/node_modules/currently-unhandled/browser.js
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/currently-unhandled/browser.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/currently-unhandled/browser.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/currently-unhandled/browser.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/currently-unhandled/browser.js
tang-0.2.0 spec/tang_app/node_modules/currently-unhandled/browser.js
tang-0.1.0 spec/tang_app/node_modules/currently-unhandled/browser.js
tang-0.0.9 spec/tang_app/node_modules/currently-unhandled/browser.js
enju_library-0.3.8 spec/dummy/node_modules/currently-unhandled/browser.js
ilog-0.4.1 node_modules/currently-unhandled/browser.js
ilog-0.4.0 node_modules/currently-unhandled/browser.js
ilog-0.3.3 node_modules/currently-unhandled/browser.js
jester-data-8.0.0 node_modules/currently-unhandled/browser.js
ezii-os-5.2.1 node_modules/currently-unhandled/browser.js
ezii-os-2.0.1 node_modules/currently-unhandled/browser.js
ezii-os-1.1.0 node_modules/currently-unhandled/browser.js
ezii-os-1.0.0 node_modules/currently-unhandled/browser.js