Fix style
This commit is contained in:
+9
-12
@@ -4,10 +4,7 @@ title: Development
|
||||
permalink: /dev-guide/
|
||||
---
|
||||
|
||||
The JerryScript Engine can be embedded into any application, providing way to run JavaScript in large range of environments - from desktops to low-memory microcontrollers.
|
||||
|
||||
* toc
|
||||
{:toc}
|
||||
JerryScript Engine can be embedded into any application, providing the way to run JavaScript in a large range of environments - from desktops to low-memory microcontrollers.
|
||||
|
||||
This guide is intended to introduce you to JerryScript embedding API through creation of simple JavaScript shell.
|
||||
|
||||
@@ -149,13 +146,13 @@ main (int argc, char * argv[]) {
|
||||
}
|
||||
{% endhighlight %}
|
||||
|
||||
The sample would also output 'Hello, World!'. However, now it is not just part of source script, but value, dynamically supplied to the engine.
|
||||
The sample will also output 'Hello, World!'. However, now it is not just a part of the source script, but the value, dynamically supplied to the engine.
|
||||
|
||||
## Step 5. Description of JavaScript value descriptors
|
||||
|
||||
Structure, used to put values to / receive values from engine is the following:
|
||||
Structure, used to put values to or receive values from the engine is the following:
|
||||
|
||||
- `type` of value:
|
||||
- `type` of the value:
|
||||
- JERRY_API_DATA_TYPE_UNDEFINED (undefined);
|
||||
- JERRY_API_DATA_TYPE_NULL (null);
|
||||
- JERRY_API_DATA_TYPE_BOOLEAN (true / false);
|
||||
@@ -167,11 +164,11 @@ Structure, used to put values to / receive values from engine is the following:
|
||||
- `v_string` (if JERRY_API_DATA_TYPE_STRING) - pointer to string;
|
||||
- `v_object` (if JERRY_API_DATA_TYPE_OBJECT) - pointer to object.
|
||||
|
||||
Abstract values, to be sent to / received from engine are described with the structure.
|
||||
Abstract values, to be sent to or received from the engine are described with the structure.
|
||||
|
||||
Pointers to strings / objects and values should be released just when become unnecessary, using `jerry_api_release_string` / `jerry_api_release_object` and `jerry_api_release_value`, correspondingly.
|
||||
Pointers to strings or objects and values should be released just when become unnecessary, using `jerry_api_release_string` or `jerry_api_release_object` and `jerry_api_release_value`, correspondingly.
|
||||
|
||||
The following example function would output a JavaScript value:
|
||||
The following example function will output a JavaScript value:
|
||||
|
||||
{% highlight cpp %}
|
||||
static void
|
||||
@@ -231,9 +228,9 @@ print_value (const jerry_api_value_t * value_p)
|
||||
|
||||
## Simple JavaScript shell
|
||||
|
||||
Now all build blocks, necessary to construct JavaScript shell, are ready.
|
||||
Now all building blocks, necessary to construct JavaScript shell, are ready.
|
||||
|
||||
Shell operation can be described with following loop:
|
||||
Shell operation can be described with the following loop:
|
||||
|
||||
- read command;
|
||||
- if command is 'quit'
|
||||
|
||||
Reference in New Issue
Block a user