Paul Sokolovsky 80dc523ad3 targets/zephyr: REPL: Print expression result, or exception value.
With this change, REPL works almost the same as a standard JS REPL does
(browser console, Node.js, etc.). A result of each expression is
printed, e.g. "2+2" will print "4". Result is printed even if its
value is "undefined", e.g. "print(1)" will print "1", and on the next
line "undefined" (which is again how "normal" JS console work, except
a normal JS way to print to console is console.log()).

If an exception occured, a message "Error executing statement:", followed
by external representation of exception object, is printed. Note that
distinctive exception objects are supported only in "cp" (compact profile),
not in "cp_minimal". In the latter case, there's only exception hierarchy
top-level prototype, so any error message will look like:

    Error executing statement: [object Function]

(That's the reason why there's error message prefix - so it weren't too
confusing even if used in cp_minimal config. Unfortunately, compile-time
JerryScript configuration isn't available to Zephyr's main.c, so there's
no easy way to implement cp vs cp_minimal distinction).

JerryScript-DCO-1.0-Signed-off-by: Paul Sokolovsky paul.sokolovsky@linaro.org
2016-07-20 17:39:20 +03:00
2016-06-26 23:45:58 -07:00
2016-05-13 15:52:56 +02:00
2016-07-05 13:58:04 +02:00
2016-06-21 08:26:16 +02:00
2016-07-19 17:16:37 +02:00
2016-02-05 13:37:16 +01:00
2016-02-05 13:37:16 +01:00
2016-07-11 09:01:29 +02:00
2016-07-18 09:57:32 +02:00

JerryScript: JavaScript engine for the Internet of Things

License Build Status

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@gna.org, you can subscribe here and access the mailing list archive here.

Quick Start

Getting the sources

git clone https://github.com/Samsung/jerryscript.git
cd jerryscript

Building JerryScript

make release.linux -j

For additional information see Getting Started.

Documentation

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 2015 Samsung Electronics Co., Ltd.

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.

Description
Ultra-lightweight JavaScript engine for the Internet of Things.
Readme Apache-2.0 77 MiB
Languages
C 70.5%
JavaScript 25.1%
Python 2.7%
CMake 1%
Shell 0.5%