MCPcopy Index your code
hub / github.com/nodejs/node / assertInstanceof

Function assertInstanceof

deps/v8/test/intl/assert.js:199–210  ·  view source on GitHub ↗

* Throws if obj is not of given type.

(obj, type)

Source from the content-addressed store, hash-verified

197 * Throws if obj is not of given type.
198 */
199function assertInstanceof(obj, type) {
200 if (!(obj instanceof type)) {
201 var actualTypeName = null;
202 var actualConstructor = Object.getPrototypeOf(obj).constructor;
203 if (typeof actualConstructor == "function") {
204 actualTypeName = actualConstructor.name || String(actualConstructor);
205 }
206 throw new Error('Object <' + obj + '> is not an instance of <' +
207 (type.name || type) + '>' +
208 (actualTypeName ? ' but of < ' + actualTypeName + '>' : ''));
209 }
210}
211
212/**
213 * Split a BCP 47 language tag into locale and extension.

Callers 15

assertThrowsFunction · 0.85
checkExpectedExceptionFunction · 0.85
testStackOverflowFunction · 0.85
regexp.jsFile · 0.85
testFunction · 0.85
strict1Function · 0.85
strict2Function · 0.85
strict3Function · 0.85
strict4Function · 0.85

Calls 1

StringClass · 0.85

Tested by 7

testFunction · 0.68
testFunction · 0.68
testFunction · 0.68
testFunction · 0.68
testFunction · 0.68
testFunction · 0.68
testFunction · 0.68

Used in the wild real call sites across dependent graphs

searching dependent graphs…