MCPcopy Create free account
hub / github.com/EsperoTech/yaade / hasCustomToString

Function hasCustomToString

client/src/utils/jasmine/jasmine.js:7246–7259  ·  view source on GitHub ↗
(value)

Source from the content-addressed store, hash-verified

7244 }
7245
7246 function hasCustomToString(value) {
7247 // value.toString !== Object.prototype.toString if value has no custom toString but is from another context (e.g.
7248 // iframe, web worker)
7249 try {
7250 return (
7251 j$.isFunction_(value.toString) &&
7252 value.toString !== Object.prototype.toString &&
7253 value.toString() !== Object.prototype.toString.call(value)
7254 );
7255 } catch (e) {
7256 // The custom toString() threw.
7257 return true;
7258 }
7259 }
7260
7261 function truncate(s, maxlen) {
7262 if (s.length <= maxlen) {

Callers 1

formatMethod · 0.70

Calls 1

toStringMethod · 0.45

Tested by

no test coverage detected