Realm.h 980 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  2. * This Source Code Form is subject to the terms of the Mozilla Public
  3. * License, v. 2.0. If a copy of the MPL was not distributed with this
  4. * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
  5. /*
  6. * Ways to get various per-Realm objects. All the getters declared in this
  7. * header operate on the Realm corresponding to the current compartment on the
  8. * JSContext.
  9. */
  10. #ifndef js_Realm_h
  11. #define js_Realm_h
  12. #include "jstypes.h"
  13. struct JSContext;
  14. class JSObject;
  15. namespace JS {
  16. extern JS_PUBLIC_API(JSObject*)
  17. GetRealmObjectPrototype(JSContext* cx);
  18. extern JS_PUBLIC_API(JSObject*)
  19. GetRealmFunctionPrototype(JSContext* cx);
  20. extern JS_PUBLIC_API(JSObject*)
  21. GetRealmArrayPrototype(JSContext* cx);
  22. extern JS_PUBLIC_API(JSObject*)
  23. GetRealmErrorPrototype(JSContext* cx);
  24. extern JS_PUBLIC_API(JSObject*)
  25. GetRealmIteratorPrototype(JSContext* cx);
  26. } // namespace JS
  27. #endif // js_Realm_h