MCPcopy Create free account
hub / github.com/caike/jQuery-Simple-Timer / compareConstructors

Function compareConstructors

tests/qunit-2.9.2.js:328–354  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

326 }
327
328 function compareConstructors(a, b) {
329 var protoA = getProto(a);
330 var protoB = getProto(b);
331
332 // Comparing constructors is more strict than using `instanceof`
333 if (a.constructor === b.constructor) {
334 return true;
335 }
336
337 // Ref #851
338 // If the obj prototype descends from a null constructor, treat it
339 // as a null prototype.
340 if (protoA && protoA.constructor === null) {
341 protoA = null;
342 }
343 if (protoB && protoB.constructor === null) {
344 protoB = null;
345 }
346
347 // Allow objects with no prototype to be equivalent to
348 // objects with Object as their constructor.
349 if (protoA === null && protoB === Object.prototype || protoB === null && protoA === Object.prototype) {
350 return true;
351 }
352
353 return false;
354 }
355
356 function getRegExpFlags(regexp) {
357 return "flags" in regexp ? regexp.flags : regexp.toString().match(/[gimuy]*$/)[0];

Callers 1

qunit-2.9.2.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected