docs
Docs
C++ API
C API
Search API
Ctrl K
2.0
2.0
latest
1.4
Ultralight C++ API
2.0.0
Toggle main menu visibility
Loading...
Searching...
No Matches
JavaScript.h
Go to the documentation of this file.
1
///
2
/// Copyright (C) 2026 Ultralight, Inc. All rights reserved.
3
/// A license is required for commercial use. https://ultralig.ht
4
///
5
#pragma once
6
#include <
JavaScriptCore/JavaScript.h
>
7
#include <
Ultralight/Defines.h
>
8
#include <
Ultralight/RefPtr.h
>
9
#include <
Ultralight/String.h
>
10
11
// The typed JavaScript layer (ultralight::js) is opt-in: include <Ultralight/JS.h> (the
12
// whole bridge) or individual <Ultralight/js/*.h> headers directly. The js/ headers carry
13
// the ULJS C API type surface, so they are deliberately not included here.
14
15
namespace
ultralight
{
16
17
///
18
/// This class wraps a JSContextRef (a JavaScript execution context for use with JavaScriptCore)
19
/// and locks the context on the current thread for the duration of its lifetime.
20
///
21
class
UExport
JSContext
:
public
RefCounted
{
22
public
:
23
/// Get the underlying JSContextRef for use with JavaScriptCore C API
24
virtual
JSContextRef
ctx
() = 0;
25
26
/// Typecast to a JSContextRef for use with JavaScriptCore C API
27
operator
JSContextRef
();
28
29
protected
:
30
virtual
~JSContext
();
31
};
32
33
}
// namespace ultralight
UExport
#define UExport
Definition
Exports.h:22
JSContextRef
const struct OpaqueJSContext * JSContextRef
Definition
JSBase.h:43
JavaScript.h
RefPtr.h
String.h
Defines.h
ultralight::JSContext
This class wraps a JSContextRef (a JavaScript execution context for use with JavaScriptCore) and lock...
Definition
JavaScript.h:21
ultralight::JSContext::ctx
virtual JSContextRef ctx()=0
Get the underlying JSContextRef for use with JavaScriptCore C API.
ultralight::JSContext::~JSContext
virtual ~JSContext()
ultralight::RefCounted
Interface for all ref-counted objects that will be managed using the RefPtr<> smart pointer.
Definition
RefPtr.h:49
ultralight
Root namespace for every public Ultralight type, function, and enumeration.
Ultralight
JavaScript.h
Docs
C++ API
C API
Version
2.0
2.0
latest
1.4