This approach has the benefit that it does not require any *a priori* initialization, and that each context pointer is identified by the way in which it was created. Additionally, retrieving the context pointer now requires that the entity responsible for creating/destroying it (the manager) be given. Since managers are stored in global static const structures, they should not normally be visible across source files, and thus there should be no danger that a context item will be retrieved by the wrong manager and thus cast into the wrong data type. Since the items are stored in a linked list, their number will be limited to exactly as many as are needed for a given context, with the caveat that storing too many on a context will cause slow retrieval. Thanks @mhdawson for the idea! Fixes https://github.com/jerryscript-project/jerryscript/issues/1845 JerryScript-DCO-1.0-Signed-off-by: Gabriel Schulhof gabriel.schulhof@intel.com
JerryScript: JavaScript engine for the Internet of Things
JerryScript is a lightweight JavaScript engine for resource-constrained devices such as microcontrollers. It can run on devices with less than 64 KB of RAM and less than 200 KB of flash memory.
Key characteristics of JerryScript:
- Full ECMAScript 5.1 standard compliance
- 160K binary size when compiled for ARM Thumb-2
- Heavily optimized for low memory consumption
- Written in C99 for maximum portability
- Snapshot support for precompiling JavaScript source code to byte code
- Mature C API, easy to embed in applications
Additional information can be found on our project page and Wiki.
IRC channel: #jerryscript on freenode
Mailing list: jerryscript-dev@groups.io, you can subscribe here and access the mailing list archive here.
Quick Start
Getting the sources
git clone https://github.com/jerryscript-project/jerryscript.git
cd jerryscript
Building JerryScript
python tools/build.py
For additional information see Getting Started.
Documentation
Contributing
The project can only accept contributions which are licensed under the Apache License 2.0 and are signed according to the JerryScript Developer's Certificate of Origin. For further information please see our Contribution Guidelines.
License
JerryScript is open source software under the Apache License 2.0. Complete license and copyright information can be found in the source code.
Copyright JS Foundation and other contributors, http://js.foundation
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
