blob: 54460ce1497a6e2f35ac6318ac37cd11d958bd38 [file] [log] [blame]
// Copyright (C) 2017 André Bargull. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
description: >
Including isConstructor.js will expose one function:
isConstructor
includes: [isConstructor.js]
features: [generators, Reflect.construct]
---*/
assert.sameValue(typeof isConstructor, "function");
assert.sameValue(isConstructor(), false);
assert.sameValue(isConstructor(undefined), false);
assert.sameValue(isConstructor(null), false);
assert.sameValue(isConstructor(123), false);
assert.sameValue(isConstructor(true), false);
assert.sameValue(isConstructor(false), false);
assert.sameValue(isConstructor("string"), false);
assert.sameValue(isConstructor({}), false);
assert.sameValue(isConstructor([]), false);
assert.sameValue(isConstructor(function(){}), true);
assert.sameValue(isConstructor(function*(){}), false);
assert.sameValue(isConstructor(() => {}), false);
assert.sameValue(isConstructor(Array), true);
assert.sameValue(isConstructor(Array.prototype.map), false);