Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature request] add new isBaseObject predicate function #42

Open
DerekNonGeneric opened this issue Aug 9, 2022 · 0 comments
Open

Comments

@DerekNonGeneric
Copy link
Member

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)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant