Implement realm object and support realms for built-ins and JS functions (#4354)
- Type for realm objects is introduced (ecma_global_object_t) - Realm reference is added to built-in objects and ECMAScript functions - Resolving built-ins, global environments, and scopes require realm object - Unnecessary global object accesses are removed from the code Missing: external functions and static snapshot functions have no realm reference JerryScript-DCO-1.0-Signed-off-by: Zoltan Herczeg zherczeg.u-szeged@partner.samsung.com
This commit is contained in:
@@ -141,6 +141,8 @@ Possible compile time enabled feature types:
|
||||
- JERRY_FEATURE_SET - Set support
|
||||
- JERRY_FEATURE_WEAKMAP - WeakMap support
|
||||
- JERRY_FEATURE_WEAKSET - WeakSet support
|
||||
- JERRY_FEATURE_BIGINT - BigInt support
|
||||
- JERRY_FEATURE_REALM - realm support
|
||||
|
||||
*New in version 2.0*.
|
||||
|
||||
@@ -5969,6 +5971,38 @@ jerry_create_undefined (void);
|
||||
- [jerry_release_value](#jerry_release_value)
|
||||
|
||||
|
||||
## jerry_create_realm
|
||||
|
||||
**Summary**
|
||||
|
||||
Creates a `jerry_value_t` representing a new global object.
|
||||
|
||||
**Prototype**
|
||||
|
||||
```c
|
||||
jerry_value_t
|
||||
jerry_create_realm (void);
|
||||
```
|
||||
|
||||
- return value - realm object value
|
||||
|
||||
**Example**
|
||||
|
||||
```c
|
||||
{
|
||||
jerry_value_t realm_value = jerry_create_realm ();
|
||||
|
||||
... // usage of the value
|
||||
|
||||
jerry_release_value (realm_value);
|
||||
}
|
||||
```
|
||||
|
||||
**See also**
|
||||
|
||||
- [jerry_release_value](#jerry_release_value)
|
||||
|
||||
|
||||
# General API functions of JS objects
|
||||
|
||||
## jerry_has_property
|
||||
|
||||
Reference in New Issue
Block a user