MCPcopy Create free account
hub / github.com/dynjs/dynjs / isSparse

Method isSparse

src/main/java/org/dynjs/runtime/Types.java:379–393  ·  view source on GitHub ↗
(ExecutionContext context, JSObject o)

Source from the content-addressed store, hash-verified

377 }
378
379 public static boolean isSparse(ExecutionContext context, JSObject o) {
380 if (!o.hasProperty(context, "length")) {
381 return false;
382 }
383
384 long len = Types.toUint32(context, o.get(context, "length"));
385
386 for (long i = 0; i < len; ++i) {
387 if (o.getOwnProperty(context, "" + i, false) == Types.UNDEFINED) {
388 return true;
389 }
390 }
391
392 return false;
393 }
394
395 public static Object getValue(ExecutionContext context, Object o) {
396 if (o instanceof Reference) {

Callers

nothing calls this directly

Calls 4

toUint32Method · 0.95
hasPropertyMethod · 0.65
getMethod · 0.65
getOwnPropertyMethod · 0.65

Tested by

no test coverage detected