How to use the es-abstract/es2019.IsConstructor function in es-abstract

To help you get started, we’ve selected a few es-abstract examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github es-shims / Promise.try / implementation.js View on Github external
var promiseTry = function try_(callbackfn) {
	/* eslint no-invalid-this: 0 */

	var C = this;
	if (ES.Type(C) !== 'Object') {
		throw new TypeError('receiver must be an object');
	}

	if (!ES.IsConstructor(C)) {
		throw new TypeError('receiver must be a constructor');
	}

	return new C(function (resolve) {
		resolve(callbackfn());
	});
};
if (Object.getOwnPropertyDescriptor && Object.getOwnPropertyDescriptor(promiseTry, 'name').configurable) {