Reflect.isTemplateObject (original) (raw)

IsTemplateObject is realm-agnostic. Since template objects are frozen before escaping GetTemplateObject, testing (IsTemplateObject(x) and x.[[Prototype]] is the realm's %Array.prototype%) is sufficient to determine whether an x is a template object in a particular realm.

In user code, Reflect.isTemplateObject(x) && x instanceof Array is an equivalent test, assuming no changes to builtins.