Skip to content

[feature request] add new isBaseObject predicate function #42

@DerekNonGeneric

Description

@DerekNonGeneric

This predicate function seems like it would be useful.

private static boolean isBaseObject(Scriptable s) {
  // A direct instance of Object is the only Object whose prototype's
  // prototype is null.
  Scriptable proto = s.getPrototype();
  return proto != null && proto.getPrototype() == null;
}

Refs: http://cajadores.com/docs/java/com/google/caja/util/RhinoAsserts.html#isBaseObject(org.mozilla.javascript.Scriptable)

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions